repo.or.cz
/
sdcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
struct / union in initializer, RFE #901.
[sdcc.git]
/
sdcc
/
support
/
regression
/
tests
/
gcc-torture-execute-pr49161.c
blob
f6b152899f39e5a568cce382d43e72a27e08e018
1
/*
2
pr49161.c from the execute part of the gcc torture tests.
3
*/
4
5
#include <testfwk.h>
6
7
#ifdef __SDCC
8
#pragma std_c99
9
#endif
10
11
/* PR tree-optimization/49161 */
12
13
int
c
;
14
15
void
16
bar
(
int
x
)
17
{
18
if
(
x
!=
c
++)
19
ASSERT
(
0
);
20
}
21
22
void
23
foo
(
int
x
)
24
{
25
switch
(
x
)
26
{
27
case
3
:
goto
l1
;
28
case
4
:
goto
l2
;
29
case
6
:
goto
l3
;
30
default
:
return
;
31
}
32
l1
:
33
goto
l4
;
34
l2
:
35
goto
l4
;
36
l3
:
37
bar
(-
1
);
38
l4
:
39
bar
(
0
);
40
if
(
x
!=
4
)
41
bar
(
1
);
42
if
(
x
!=
3
)
43
bar
(-
1
);
44
bar
(
2
);
45
}
46
47
void
48
testTortureExecute
(
void
)
49
{
50
#if !(defined (__GNUC__) && defined (__GNUC_MINOR__) && (__GNUC__ < 5))
51
foo
(
3
);
52
if
(
c
!=
3
)
53
ASSERT
(
0
);
54
return
;
55
#endif
56
}
57