summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/special/conpr-2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/special/conpr-2.C')
-rw-r--r--gcc/testsuite/g++.dg/special/conpr-2.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/special/conpr-2.C b/gcc/testsuite/g++.dg/special/conpr-2.C
new file mode 100644
index 000000000..ac826942a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/special/conpr-2.C
@@ -0,0 +1,23 @@
+/* { dg-do run { target init_priority } } */
+/* { dg-additional-sources "conpr-2a.cc" } */
+
+#include <stdlib.h>
+
+class foo_t {
+ int x;
+ static int count;
+public:
+ foo_t(void) { x=++count; }
+ int get(void) { return x; }
+};
+
+int foo_t::count;
+
+extern foo_t foo1, foo2;
+
+int main(void) {
+
+ if ( (foo1.get() != 2) || (foo2.get() != 1) )
+ abort();
+ exit(0);
+}