Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / enum-redef-1.c
blobb3fa6cbf8f112052ce2d86943fc4450e1bf52d60
1 enum a { A };
2 enum a { B }; /* { dg-bogus "nested redefinition" } */
3 /* { dg-error "redeclaration of 'enum a'" "" { target *-*-* } .-1 } */
5 enum empty {}; /* { dg-error "empty enum is invalid" } */
6 enum empty {}; /* { dg-bogus "nested redefinition" } */
7 /* { dg-error "empty enum is invalid" "" { target *-*-* } .-1 } */
9 enum nested_first {
10 C1 = sizeof(enum nested_first { C1a }), /* { dg-error "nested redefinition of 'enum nested_first" } */
11 C2 = sizeof(enum nested_first { C2a }) /* { dg-error "redeclaration of 'enum nested_first'" "" } */
14 enum nested_second {
15 D1,
16 D2 = sizeof(enum nested_second { D2a }), /* { dg-error "nested redefinition of 'enum nested_second" } */
17 D3 = sizeof(enum nested_second { D3a }) /* { dg-error "redeclaration of 'enum nested_second'" "" } */
20 enum nested_repeat { E };
21 enum nested_repeat { /* { dg-error "redeclaration of 'enum nested_repeat'" "" } */
22 F = sizeof(enum nested_repeat { Fa }) /* { dg-error "nested redefinition of 'enum nested_repeat" } */
25 enum nested_empty {
26 G1 = sizeof(enum nested_empty {}), /* { dg-error "nested redefinition of 'enum nested_empty" } */
27 /* { dg-error "empty enum is invalid" "" { target *-*-* } .-1 } */
28 G2 = sizeof(enum nested_empty { G2a })