summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/special/conpr-1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/special/conpr-1.C')
-rw-r--r--gcc/testsuite/g++.dg/special/conpr-1.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/special/conpr-1.C b/gcc/testsuite/g++.dg/special/conpr-1.C
new file mode 100644
index 000000000..ef694dbe6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/special/conpr-1.C
@@ -0,0 +1,20 @@
+/* { dg-do run { target init_priority } } */
+
+#include <stdlib.h>
+
+class foo_t {
+ int x;
+public:
+ foo_t(void) { x=1; }
+ int get(void) { return x; }
+};
+
+static foo_t foo __attribute__((init_priority(5000)));
+
+int main(void) {
+
+ if (foo.get())
+ exit(0);
+ else
+ abort();
+}