FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / loop1.C
blob3380dd4d74d305c44440a2cdeca56a9e2b412fe1
1 // Test for bad loop optimization of goto fixups.
2 // Special g++ Options: -O2
4 typedef bool (*ftype) ();
6 int c, d;
7 struct A {
8   A() { ++c; }
9   A(const A&) { ++c; }
10   ~A() { ++d; }
13 void f (ftype func)
15   A a;
16   do {
17     if ((*func)()) return;
18   } while (true);
21 bool test ()
23   return true;
26 main ()
28   f (test);
29   return (c != d);