gcc/testsuite/g++.dg/torture/pr43784.C
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-fno-tree-sra" } */ |
| 3 | |
| 4 | struct S {int x, y, makemelarge[5];}; |
| 5 | S __attribute__((noinline)) f (S &s) { |
| 6 | S r; |
| 7 | r.x = s.y; |
| 8 | r.y = s.x; |
| 9 | return r; |
| 10 | } |
| 11 | int __attribute__((noinline)) glob (int a, int b) |
| 12 | { |
| 13 | S local = { a, b }; |
| 14 | local = f (local); |
| 15 | return local.y; |
| 16 | } |
| 17 | extern "C" void abort (void); |
| 18 | int main (void) |
| 19 | { |
| 20 | if (glob (1, 3) != 1) |
| 21 | abort (); |
| 22 | return 0; |
| 23 | } |
| 24 |