annotate gcc/testsuite/c-c++-common/attributes-enum-1.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test enumerators with attributes. */
kono
parents:
diff changeset
2 /* PR c/47043 */
kono
parents:
diff changeset
3 /* { dg-do compile } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 enum E {
kono
parents:
diff changeset
6 A __attribute__((deprecated)),
kono
parents:
diff changeset
7 B __attribute__((deprecated ("foo"))),
kono
parents:
diff changeset
8 C __attribute__((deprecated)) = 10,
kono
parents:
diff changeset
9 D __attribute__((deprecated ("foo"))) = 15,
kono
parents:
diff changeset
10 E
kono
parents:
diff changeset
11 };
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 int
kono
parents:
diff changeset
14 f (int i)
kono
parents:
diff changeset
15 {
kono
parents:
diff changeset
16 i += A; /* { dg-warning ".A. is deprecated" } */
kono
parents:
diff changeset
17 i += B; /* { dg-warning ".B. is deprecated" } */
kono
parents:
diff changeset
18 i += C; /* { dg-warning ".C. is deprecated" } */
kono
parents:
diff changeset
19 i += D; /* { dg-warning ".D. is deprecated" } */
kono
parents:
diff changeset
20 i += E;
kono
parents:
diff changeset
21 return i;
kono
parents:
diff changeset
22 }