gcc/testsuite/gcc.dg/torture/pr101278.c
raw| 1 | /* { dg-do run } */ |
| 2 | |
| 3 | struct X { int counter; }; |
| 4 | |
| 5 | struct X __attribute__((noipa)) foo (struct X x) |
| 6 | { |
| 7 | x.counter++; |
| 8 | if (x.counter == 5) |
| 9 | __builtin_exit (0); |
| 10 | return x; |
| 11 | } |
| 12 | |
| 13 | int |
| 14 | main () |
| 15 | { |
| 16 | struct X x; |
| 17 | x.counter = 0; |
| 18 | for (int i = 0; i < 10; ++i) |
| 19 | x = foo (x); |
| 20 | __builtin_abort (); |
| 21 | } |