OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [eh/] [cond5.C] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/49165
2
// { dg-do run }
3
 
4
extern "C" void abort ();
5
 
6
int
7
foo (bool x, int y)
8
{
9
  if (y < 10 && (x ? true : throw 1))
10
    y++;
11
  if (y > 20 || (x ? true : throw 2))
12
    y++;
13
  return y;
14
}
15
 
16
int
17
main ()
18
{
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
    }
43
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.