gcc/testsuite/g++.dg/special/conpr-1.C
raw| 1 | /* { dg-do run { target init_priority } } */ |
| 2 | |
| 3 | #include <stdlib.h> |
| 4 | |
| 5 | class foo_t { |
| 6 | int x; |
| 7 | public: |
| 8 | foo_t(void) { x=1; } |
| 9 | int get(void) { return x; } |
| 10 | }; |
| 11 | |
| 12 | static foo_t foo __attribute__((init_priority(5000))); |
| 13 | |
| 14 | int main(void) { |
| 15 | |
| 16 | if (foo.get()) |
| 17 | exit(0); |
| 18 | else |
| 19 | abort(); |
| 20 | } |