2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / opt / cfg2.C
blob229f4bc3a527d0dfa23d6a1ba073468c172d5ab2
1 // PR optimization/12215
2 // Origin: <nick@ilm.com>
3 // Reduced testcase by Wolfgang Bangerth <bangerth@ticam.utexas.edu>
5 // This used to fail because the CSE pass destroyed the CFG in presence
6 // of trapping loads, which led to the deletion of basic blocks.
8 // { dg-do compile }
9 // { dg-options "-O2 -fno-gcse -fnon-call-exceptions" }
12 struct B {
13   ~B() throw() {}
16 struct X {
17   X(const char*, const B&);
18   ~X() {}
21 bool m();
22 void f(int &i, float &arg0);
24 void g (const char **argv) {
25   float val;
26   int i = 1;
28   try {
29     while ( i < 1 )
30       {
31         X arg(argv[i], B());
32         if (m())
33           throw(0);
35         f(i, val);
36       }
37   } catch (...) {}