gcc/testsuite/gcc.dg/guality/zero-length-array.c
raw| 1 | /* PR debug/86985 */ |
| 2 | /* { dg-do run } */ |
| 3 | /* { dg-options "-std=c17 -g" } */ |
| 4 | |
| 5 | /* FIXME: Use -std=c17 until PR113688 if fixed. */ |
| 6 | |
| 7 | struct { |
| 8 | int foo; |
| 9 | int bar[0]; |
| 10 | } zla; /* Zero length array. */ |
| 11 | |
| 12 | struct { |
| 13 | int foo; |
| 14 | int bar[]; |
| 15 | } fam; /* Flexible array member. */ |
| 16 | |
| 17 | int |
| 18 | main () |
| 19 | { |
| 20 | /* { dg-final { gdb-test . "type:zla" "struct { int foo; int bar[0]; }" } } */ |
| 21 | /* { dg-final { gdb-test . "type:fam" "struct { int foo; int bar[]; }" } } */ |
| 22 | return 0; |
| 23 | } |