gcc/testsuite/gcc.dg/pr99122-2.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-std=gnu17 -O2 -g -w" } */ |
| 3 | |
| 4 | static int foo (); |
| 5 | |
| 6 | int |
| 7 | bar (int n) |
| 8 | { |
| 9 | struct S { char a[n]; } x; |
| 10 | __builtin_memset (x.a, 0, n); |
| 11 | return foo (n, x); |
| 12 | } |
| 13 | |
| 14 | static inline int |
| 15 | foo (int n, struct T { char a[n]; } b) |
| 16 | { |
| 17 | int r = 0, i; |
| 18 | for (i = 0; i < n; i++) |
| 19 | r += b.a[i]; |
| 20 | return r; |
| 21 | } |