aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/special/conpr-3.C
blob: 71fadcc64d3b56ce64862b64715837ee1a105dd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
}