OSDN Git Service

* g++.dg/cpp/_Pragma1.C: Disable on AIX.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / ext / label3.C
1 // Bug: we were removing the p = q assignment in dce, and then reinserting
2 // it *after* the try/catch in out-of-ssa.  Oops.
3
4 // testcase reduced from libjava/interpret.cc.
5
6 // { dg-do run }
7 // { dg-options "-O2" }
8
9 extern "C" int printf (const char *, ...);
10
11 bool b;
12
13 int main()
14 {
15   __label__ one, two, done;
16   void *labs[] = { &&one, &&two, &&done };
17   const void **q = (const void **)labs;
18   const void **p = q;
19
20   try
21     {
22     one:
23       printf ("one!\n");
24       if (b)
25         throw 42;
26       goto **p++;
27
28     two:
29       printf ("two!\n");
30       goto **p++;
31
32     done:
33       printf ("done!\n");
34     }
35   catch (int)
36     {
37       printf ("caught!\n");
38     }
39 }