gcc/testsuite/gcc.dg/Wdeclaration-after-statement-4.c
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-std=c90 -pedantic -Wno-declaration-after-statement" } */ |
| 3 | |
| 4 | extern void abort (void); |
| 5 | extern void exit (int); |
| 6 | |
| 7 | int |
| 8 | main (void) |
| 9 | { |
| 10 | int i = 0; |
| 11 | if (i != 0) |
| 12 | abort (); |
| 13 | i++; |
| 14 | if (i != 1) |
| 15 | abort (); |
| 16 | int j = i; |
| 17 | if (j != 1) |
| 18 | abort (); |
| 19 | struct foo { int i0; } k = { 4 }; |
| 20 | if (k.i0 != 4) |
| 21 | abort (); |
| 22 | exit (0); |
| 23 | } |