1 /* { dg-do compile { target init_priority } } */
3 /* Priorities must be in the range [0, 65535]. */
5 __attribute__((constructor (-1))); /* { dg-error "priorities" } */
7 __attribute__((constructor (65536))); /* { dg-error "priorities" } */
9 __attribute__((destructor (-1))); /* { dg-error "priorities" } */
11 __attribute__((destructor (65536))); /* { dg-error "priorities" } */
13 /* Priorities 0-100 are reserved for system libraries. */
15 __attribute__((constructor (50))); /* { dg-warning "reserved" } */
17 __attribute__((constructor (50))); /* { dg-warning "reserved" } */
19 /* Priorities must be integral constants. */
21 /* Pointers, even with constant values, are not allowed. */
23 __attribute__((constructor ((void*) 500))); /* { dg-error "priorities" } */
25 __attribute__((destructor ((void*) 500))); /* { dg-error "priorities" } */
27 /* Integer variables are not allowed. */
30 __attribute__((constructor ((i
)))); /* { dg-error "priorities" } */
32 __attribute__((destructor ((i
)))); /* { dg-error "priorities" } */
34 /* Enumeration constants are allowed. */
37 __attribute__((constructor ((e
))));
39 __attribute__((destructor ((e
))));