annotate gcc/testsuite/gcc.dg/vla-init-1.c @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test for tree-checking error when initializing a variable-length array
kono
parents:
diff changeset
2 (not allowed): constructor_max_index needs to be an INTEGER_CST. */
kono
parents:
diff changeset
3 /* Origin: Joseph Myers <jsm28@cam.ac.uk>. */
kono
parents:
diff changeset
4 /* { dg-do compile } */
kono
parents:
diff changeset
5 /* { dg-options "" } */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 int a;
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 void
kono
parents:
diff changeset
10 foo (void)
kono
parents:
diff changeset
11 {
kono
parents:
diff changeset
12 int x[a] = { 1 }; /* { dg-error "variable-sized object may not be initialized" "VLA init" } */
kono
parents:
diff changeset
13 /* { dg-warning "excess elements in array initializer" "excess" { target *-*-* } .-1 } */
kono
parents:
diff changeset
14 /* { dg-message "near initialization" "near" { target *-*-* } .-2 } */
kono
parents:
diff changeset
15 }