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-pr69097-2.c
blob
f4a7cb712866b82aca1e781a206b59d9cfa7346c
1
/*
2
pr69097-2.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
#include <limits.h>
12
13
/* PR tree-optimization/69097 */
14
15
int
16
f1
(
int
x
,
int
y
)
17
{
18
return
x
%
y
;
19
}
20
21
int
22
f2
(
int
x
,
int
y
)
23
{
24
return
x
% -
y
;
25
}
26
27
int
28
f3
(
int
x
,
int
y
)
29
{
30
int
z
= -
y
;
31
return
x
%
z
;
32
}
33
34
void
35
testTortureExecute
(
void
)
36
{
37
if
(
f1
(-
INT_MAX
-
1
,
1
) !=
0
38
||
f2
(-
INT_MAX
-
1
, -
1
) !=
0
39
||
f3
(-
INT_MAX
-
1
, -
1
) !=
0
)
40
ASSERT
(
0
);
41
return
;
42
}