Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / Warray-bounds-51-novec.c
blobef8056d9b7f76702fd064a794ea51e903a888f43
1 /* PR middle-end/92333 - missing variable name referencing VLA in warnings
2 PR middle-end/82608 - missing -Warray-bounds on an out-of-bounds VLA index
3 { dg-do compile }
4 { dg-options "-O2 -Wall -fno-tree-vectorize" } */
6 void sink (void*);
8 void test_struct_char_vla_location (void)
10 unsigned nelts = 7;
12 struct {
13 char cvla[nelts]; // { dg-message "declared here|while referencing" }
14 } s;
16 s.cvla[0] = __LINE__;
17 s.cvla[nelts - 1] = 0;
18 s.cvla[nelts] = 0; // { dg-warning "\\\[-Warray-bounds" }
20 sink (&s);