Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / eh / cond1.C
blob4f494267e4b72fd259d10eaa4cdf441e840ad664
1 // PR c++/7050
2 // { dg-do run }
4 extern "C" void abort(void);
6 #define CI(stmt) try { stmt; abort(); } catch (int) { }
8 struct has_destructor
10     ~has_destructor() { }
13 struct no_destructor
17 int PI(int& i) { return i++; }
19 int main(int argc, char *argv[])
21     (argc+1 ? has_destructor() : throw 0);
22     CI((argc+1 ? throw 0 : has_destructor()));
23     CI((0 ? has_destructor() : throw 0));
24     CI((1 ? throw 0 : has_destructor()));
25     (0 ? throw 0 : has_destructor());
26     (1 ? has_destructor() : throw 0);
28     (argc+1 ? no_destructor() : throw 0);
29     CI((argc+1 ? throw 0 : no_destructor()));
30     CI((0 ? no_destructor() : throw 0));
31     CI((1 ? throw 0 : no_destructor()));
32     (0 ? throw 0 : no_destructor());
33     (1 ? no_destructor() : throw 0);
35     int i = 1;
36     CI(throw PI(i));
37     if (i != 2) abort();
39     (1 ? 0 : throw PI(i));
40     if (i != 2) abort();
42     CI(0 ? 0 : throw PI(i));
43     if (i != 3) abort();
45     CI(0 ? has_destructor() : throw PI(i));
46     if (i != 4) abort();
47     (argc+1 ? has_destructor() : throw PI(i));
48     if (i != 4) abort();
50     i = 1;
51     CI(throw i++);
52     if (i != 2) abort();
54     (1 ? 0 : throw i++);
55     if (i != 2) abort();
57     CI(0 ? 0 : throw i++);
58     if (i != 3) abort();
60     CI(0 ? has_destructor() : throw i++);
61     if (i != 4) abort();
62     (argc+1 ? has_destructor() : throw i++);
63     if (i != 4) abort();