annotate gcc/testsuite/gcc.dg/initpri2.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile { target init_priority } } */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 /* Priorities must be in the range [0, 65535]. */
kono
parents:
diff changeset
4 void c1()
kono
parents:
diff changeset
5 __attribute__((constructor (-1))); /* { dg-error "priorities" } */
kono
parents:
diff changeset
6 void c2()
kono
parents:
diff changeset
7 __attribute__((constructor (65536))); /* { dg-error "priorities" } */
kono
parents:
diff changeset
8 void d1()
kono
parents:
diff changeset
9 __attribute__((destructor (-1))); /* { dg-error "priorities" } */
kono
parents:
diff changeset
10 void d2()
kono
parents:
diff changeset
11 __attribute__((destructor (65536))); /* { dg-error "priorities" } */
kono
parents:
diff changeset
12
kono
parents:
diff changeset
13 /* Priorities 0-100 are reserved for system libraries. */
kono
parents:
diff changeset
14 void c3()
kono
parents:
diff changeset
15 __attribute__((constructor (50))); /* { dg-warning "reserved" } */
kono
parents:
diff changeset
16 void d3()
kono
parents:
diff changeset
17 __attribute__((constructor (50))); /* { dg-warning "reserved" } */
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 /* Priorities must be integral constants. */
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 /* Pointers, even with constant values, are not allowed. */
kono
parents:
diff changeset
22 void c4()
kono
parents:
diff changeset
23 __attribute__((constructor ((void*) 500))); /* { dg-error "priorities" } */
kono
parents:
diff changeset
24 void d4()
kono
parents:
diff changeset
25 __attribute__((destructor ((void*) 500))); /* { dg-error "priorities" } */
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 /* Integer variables are not allowed. */
kono
parents:
diff changeset
28 int i;
kono
parents:
diff changeset
29 void c5()
kono
parents:
diff changeset
30 __attribute__((constructor ((i)))); /* { dg-error "priorities" } */
kono
parents:
diff changeset
31 void d5()
kono
parents:
diff changeset
32 __attribute__((destructor ((i)))); /* { dg-error "priorities" } */
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 /* Enumeration constants are allowed. */
kono
parents:
diff changeset
35 enum E { e = 500 };
kono
parents:
diff changeset
36 void c6()
kono
parents:
diff changeset
37 __attribute__((constructor ((e))));
kono
parents:
diff changeset
38 void d6()
kono
parents:
diff changeset
39 __attribute__((destructor ((e))));