diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/special/conpr-3.C')
-rw-r--r-- | gcc/testsuite/g++.dg/special/conpr-3.C | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/special/conpr-3.C b/gcc/testsuite/g++.dg/special/conpr-3.C new file mode 100644 index 000000000..71fadcc64 --- /dev/null +++ b/gcc/testsuite/g++.dg/special/conpr-3.C @@ -0,0 +1,23 @@ +/* { dg-do run { target init_priority } } */ +/* { dg-additional-sources "conpr-3a.cc conpr-3b.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); +} |