Message ID | CAFULd4b8kNsfL9Eq3Wy5HmztdCJNHAprsDA7g7si5_oqR=ytog@mail.gmail.com |
---|---|
State | New |
Headers | show |
Index: gcc.dg/torture/pr52530.c =================================================================== --- gcc.dg/torture/pr52530.c (revision 0) +++ gcc.dg/torture/pr52530.c (revision 0) @@ -0,0 +1,30 @@ +/* { dg-do run } */ + +extern void abort (void); + +struct foo +{ + int *f; + int i; +}; + +int baz; + +void __attribute__ ((noinline)) +bar (struct foo x) +{ + *(x.f) = x.i; +} + +int +main () +{ + struct foo x = { &baz, 0xdeadbeef }; + + bar (x); + + if (baz != 0xdeadbeef) + abort (); + + return 0; +}