gcc/testsuite/gcc.dg/ipa/pr92497-1.c
raw| 1 | /* { dg-do run } */ |
| 2 | /* { dg-options "-O2 -fno-early-inlining" } */ |
| 3 | |
| 4 | struct a {int a;}; |
| 5 | static int |
| 6 | foo (struct a a) |
| 7 | { |
| 8 | if (!__builtin_constant_p (a.a)) |
| 9 | __builtin_abort (); |
| 10 | return a.a; |
| 11 | } |
| 12 | |
| 13 | static int __attribute__ ((noinline)) |
| 14 | bar (struct a a) |
| 15 | { |
| 16 | return foo(a); |
| 17 | } |
| 18 | |
| 19 | volatile int r; |
| 20 | |
| 21 | int main() |
| 22 | { |
| 23 | struct a a={1}; |
| 24 | r = bar (a); |
| 25 | return 0; |
| 26 | } |