gcc/testsuite/gcc.dg/torture/pr87665.c
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | struct X { long x; long y; }; |
| 4 | |
| 5 | struct X a[1024], b[1024]; |
| 6 | |
| 7 | void foo () |
| 8 | { |
| 9 | for (int i = 0; i < 1024; ++i) |
| 10 | { |
| 11 | long tem = a[i].x; |
| 12 | a[i].x = 0; |
| 13 | b[i].x = tem; |
| 14 | b[i].y = a[i].y; |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | int main() |
| 19 | { |
| 20 | for (int i = 0; i < 1024; ++i) |
| 21 | a[i].x = i; |
| 22 | foo (); |
| 23 | for (int i = 0; i < 1024; ++i) |
| 24 | if (b[i].x != i) |
| 25 | __builtin_abort(); |
| 26 | return 0; |
| 27 | } |