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-20050124-1.c
blob
ba305c48ae02cd8428f95dfff7c480e541908551
1
/*
2
20050124-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/19579 */
12
13
int
14
foo
(
int
i
,
int
j
)
15
{
16
int
k
=
i
+
1
;
17
18
if
(
j
)
19
{
20
if
(
k
>
0
)
21
k
++;
22
else if
(
k
<
0
)
23
k
--;
24
}
25
26
return
k
;
27
}
28
29
void
30
testTortureExecute
(
void
)
31
{
32
if
(
foo
(-
2
,
0
) != -
1
)
33
ASSERT
(
0
);
34
if
(
foo
(-
1
,
0
) !=
0
)
35
ASSERT
(
0
);
36
if
(
foo
(
0
,
0
) !=
1
)
37
ASSERT
(
0
);
38
if
(
foo
(
1
,
0
) !=
2
)
39
ASSERT
(
0
);
40
if
(
foo
(-
2
,
1
) != -
2
)
41
ASSERT
(
0
);
42
if
(
foo
(-
1
,
1
) !=
0
)
43
ASSERT
(
0
);
44
if
(
foo
(
0
,
1
) !=
2
)
45
ASSERT
(
0
);
46
if
(
foo
(
1
,
1
) !=
3
)
47
ASSERT
(
0
);
48
return
;
49
}