PR tree-optimization/86401
[official-gcc.git] / gcc / testsuite / c-c++-common / attributes-enum-1.c
blobcb5af5b9d05db6ecbb0c86ecf7544afaf231ae4a
1 /* Test enumerators with attributes. */
2 /* PR c/47043 */
3 /* { dg-do compile } */
5 enum E {
6 A __attribute__((deprecated)),
7 B __attribute__((deprecated ("foo"))),
8 C __attribute__((deprecated)) = 10,
9 D __attribute__((deprecated ("foo"))) = 15,
13 int
14 f (int i)
16 i += A; /* { dg-warning ".A. is deprecated" } */
17 i += B; /* { dg-warning ".B. is deprecated" } */
18 i += C; /* { dg-warning ".C. is deprecated" } */
19 i += D; /* { dg-warning ".D. is deprecated" } */
20 i += E;
21 return i;