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
Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git]
/
sdcc
/
support
/
regression
/
tests
/
gcc-torture-execute-20071216-1.c
blob
24210e24c151d8d8c2d32abf405b1c4ee070c328
1
/*
2
20071216-1.c from the execute part of the gcc torture suite.
3
*/
4
5
#include <testfwk.h>
6
7
#ifdef __SDCC
8
#pragma std_c99
9
#endif
10
11
/* PR rtl-optimization/34490 */
12
13
static int
x
;
14
15
int
16
bar
(
void
)
17
{
18
return
x
;
19
}
20
21
int
22
foo
(
void
)
23
{
24
long int
b
=
bar
();
25
if
((
unsigned long
)
b
< -
4095L
)
26
return
b
;
27
if
(-
b
!=
38
)
28
b
= -
2
;
29
return
b
+
1
;
30
}
31
32
void
33
testTortureExecute
(
void
)
34
{
35
x
=
26
;
36
if
(
foo
() !=
26
)
37
ASSERT
(
0
);
38
x
= -
39
;
39
if
(
foo
() != -
1
)
40
ASSERT
(
0
);
41
x
= -
38
;
42
if
(
foo
() != -
37
)
43
ASSERT
(
0
);
44
return
;
45
}