Clean up some minor white space issues in trans-decl.c and trans-expr.c
[official-gcc.git] / gcc / testsuite / g++.dg / eh / cond5.C
blob3f0c59964f117bf95b0cf0b05e89c284cca3b90c
1 // PR c++/49165
2 // { dg-do run }
4 extern "C" void abort ();
6 int
7 foo (bool x, int y)
9   if (y < 10 && (x ? true : throw 1))
10     y++;
11   if (y > 20 || (x ? true : throw 2))
12     y++;
13   return y;
16 int
17 main ()
19   if (foo (true, 0) != 2
20       || foo (true, 10) != 11
21       || foo (false, 30) != 31)
22     abort ();
23   try
24     {
25       foo (false, 0);
26       abort ();
27     }
28   catch (int i)
29     {
30       if (i != 1)
31         abort ();
32     }
33   try
34     {
35       foo (false, 10);
36       abort ();
37     }
38   catch (int i)
39     {
40       if (i != 2)
41         abort ();
42     }