repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
eh
/
cond6.C
blob
1eed63ec84f5b0afed1fdaf88f10cfa04fbbfdf5
1
// 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 ? 1 : throw 1))
10
y++;
11
if (y > 20 || (x ? 1 : 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
}