gcc/testsuite/gcc.dg/nested-func-16.c
raw| 1 | /* Bug 117164: ICE with -std=gnu23 inlining function containing call |
| 2 | to non-inlined nested function returning variable-size struct. */ |
| 3 | /* { dg-do run } */ |
| 4 | /* { dg-options "-O3 -fno-guess-branch-probability -std=gnu23" } */ |
| 5 | |
| 6 | void |
| 7 | foo (int n) |
| 8 | { |
| 9 | struct S { int a[n]; }; |
| 10 | |
| 11 | __attribute__ ((noinline)) struct S |
| 12 | fn (void) |
| 13 | { |
| 14 | struct S s; |
| 15 | s.a[0] = 42; |
| 16 | return s; |
| 17 | } |
| 18 | |
| 19 | fn (); |
| 20 | } |
| 21 | |
| 22 | int |
| 23 | main (void) |
| 24 | { |
| 25 | foo (1); |
| 26 | } |