gcc/testsuite/gcc.dg/nested-func-11.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-O2 -fno-omit-frame-pointer" } */ |
| 3 | |
| 4 | int __attribute__((noipa)) foo (int i) |
| 5 | { |
| 6 | int a; |
| 7 | |
| 8 | void __attribute__((noipa)) nested2 (int i) |
| 9 | { |
| 10 | a = i; |
| 11 | } |
| 12 | |
| 13 | void __attribute__((noipa)) nested1 (int i) |
| 14 | { |
| 15 | int b[32]; |
| 16 | |
| 17 | for (int j = 0; j < 32; j++) |
| 18 | b[j] = i + j; |
| 19 | |
| 20 | nested2 (b[i]); |
| 21 | } |
| 22 | |
| 23 | nested1 (i); |
| 24 | |
| 25 | return a; |
| 26 | } |
| 27 | |
| 28 | int main (void) |
| 29 | { |
| 30 | if (foo (4) != 8) |
| 31 | __builtin_abort (); |
| 32 | |
| 33 | return 0; |
| 34 | } |