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
4 { dg-options "-O2 -Wall" }
5 { dg-additional-options "-mtune=generic" { target { i?86-*-* x86_64-*-* } } } */
9 void test_char_vla_location (void)
13 char vla
[nelts
]; // { dg-message "declared here|while referencing" }
16 vla
[nelts
] = 0; // { dg-warning "\\\[-Warray-bounds" }
21 void test_int_vla_location (void)
25 int vla
[nelts
]; // { dg-message "declared here|while referencing" }
28 vla
[nelts
] = 1; // { dg-warning "\\\[-Warray-bounds" }
33 void test_struct_char_vla_location (void)
38 char cvla
[nelts
]; // { dg-message "declared here|while referencing" }
42 s
.cvla
[nelts
- 1] = 0; // { dg-warning "\\\[-Wstringop-overflow" "pr102706" { target { vect_slp_v2qi_store_align } } }
43 s
.cvla
[nelts
] = 0; // { dg-warning "\\\[-Warray-bounds" }
49 void test_struct_int_vla_location (void)
54 int ivla
[nelts
]; // { dg-message "declared here|while referencing" }
58 s
.ivla
[nelts
- 1] = 0;
59 s
.ivla
[nelts
] = 0; // { dg-warning "\\\[-Warray-bounds" }