annotate gcc/testsuite/gcc.dg/c99-flex-array-3.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +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 flexible array members. Test for where structures with
kono
parents:
diff changeset
2 such members may not occur. */
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 "-std=iso9899:1999 -pedantic-errors" } */
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 struct flex { int a; int b[]; };
kono
parents:
diff changeset
8 union rf1 { struct flex a; int b; };
kono
parents:
diff changeset
9 union rf2 { int a; struct flex b; };
kono
parents:
diff changeset
10 union rf3 { int a; union rf1 b; };
kono
parents:
diff changeset
11 union rf4 { union rf2 a; int b; };
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 /* The above structure and unions may not be members of structures or
kono
parents:
diff changeset
14 elements of arrays (6.7.2.1#2). */
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 struct t0 { struct flex a; }; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
17 /* { dg-error "invalid use of structure" "struct in struct" { target *-*-* } .-1 } */
kono
parents:
diff changeset
18 struct t1 { union rf1 a; }; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
19 /* { dg-error "invalid use of structure" "union in struct" { target *-*-* } .-1 } */
kono
parents:
diff changeset
20 struct t2 { union rf2 a; }; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
21 /* { dg-error "invalid use of structure" "union in struct" { target *-*-* } .-1 } */
kono
parents:
diff changeset
22 struct t3 { union rf3 a; }; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
23 /* { dg-error "invalid use of structure" "recursive union in struct" { target *-*-* } .-1 } */
kono
parents:
diff changeset
24 struct t4 { union rf4 a; }; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
25 /* { dg-error "invalid use of structure" "recursive union in struct" { target *-*-* } .-1 } */
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 void f0 (struct flex[]); /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
28 /* { dg-error "invalid use of structure" "struct in array" { target *-*-* } .-1 } */
kono
parents:
diff changeset
29 void f1 (union rf1[]); /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
30 /* { dg-error "invalid use of structure" "union in array" { target *-*-* } .-1 } */
kono
parents:
diff changeset
31 void f2 (union rf2[]); /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
32 /* { dg-error "invalid use of structure" "union in array" { target *-*-* } .-1 } */
kono
parents:
diff changeset
33 void f3 (union rf3[]); /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
34 /* { dg-error "invalid use of structure" "recursive union in array" { target *-*-* } .-1 } */
kono
parents:
diff changeset
35 void f4 (union rf4[]); /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
36 /* { dg-error "invalid use of structure" "recursive union in array" { target *-*-* } .-1 } */
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 struct flex a0[1]; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
39 /* { dg-error "invalid use of structure" "struct in array" { target *-*-* } .-1 } */
kono
parents:
diff changeset
40 union rf1 a1[1]; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
41 /* { dg-error "invalid use of structure" "union in array" { target *-*-* } .-1 } */
kono
parents:
diff changeset
42 union rf2 a2[1]; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
43 /* { dg-error "invalid use of structure" "union in array" { target *-*-* } .-1 } */
kono
parents:
diff changeset
44 union rf3 a3[1]; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
45 /* { dg-error "invalid use of structure" "recursive union in array" { target *-*-* } .-1 } */
kono
parents:
diff changeset
46 union rf4 a4[1]; /* { dg-bogus "warning" "warning in place of error" } */
kono
parents:
diff changeset
47 /* { dg-error "invalid use of structure" "recursive union in array" { target *-*-* } .-1 } */