mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
optimize s=s where s is a struct
This commit is contained in:
parent
b7a3a1942c
commit
bf3f49ac79
2 changed files with 28 additions and 0 deletions
|
@ -2507,6 +2507,26 @@ void test20574()
|
|||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct S8
|
||||
{
|
||||
int x,y,z;
|
||||
}
|
||||
|
||||
int test8x(S8 s)
|
||||
{
|
||||
s = s;
|
||||
return s.y;
|
||||
}
|
||||
|
||||
void test8()
|
||||
{
|
||||
S8 s;
|
||||
s.y = 2;
|
||||
assert(test8x(s) == 2);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
int main()
|
||||
{
|
||||
// All the various integer divide tests
|
||||
|
@ -2607,6 +2627,7 @@ int main()
|
|||
test21835();
|
||||
testDoWhileContinue();
|
||||
test20574();
|
||||
test8();
|
||||
|
||||
printf("Success\n");
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue