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-960311-3.c
blob
a1ad6024797c0ee5d8c536d0a0eb6b4191a01f20
1
/*
2
960311-3.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
#include <stdio.h>
12
13
int
count
;
14
15
void
a1
() { ++
count
; }
16
17
void
18
b
(
unsigned long
data
)
19
{
20
if
(
data
&
0x80000000
)
a1
();
21
data
<<=
1
;
22
23
if
(
data
&
0x80000000
)
a1
();
24
data
<<=
1
;
25
26
if
(
data
&
0x80000000
)
a1
();
27
}
28
29
void
30
testTortureExecute
(
void
)
31
{
32
count
=
0
;
33
b
(
0
);
34
if
(
count
!=
0
)
35
ASSERT
(
0
);
36
37
count
=
0
;
38
b
(
0x80000000
);
39
if
(
count
!=
1
)
40
ASSERT
(
0
);
41
42
count
=
0
;
43
b
(
0x40000000
);
44
if
(
count
!=
1
)
45
ASSERT
(
0
);
46
47
count
=
0
;
48
b
(
0x20000000
);
49
if
(
count
!=
1
)
50
ASSERT
(
0
);
51
52
count
=
0
;
53
b
(
0xc0000000
);
54
if
(
count
!=
2
)
55
ASSERT
(
0
);
56
57
count
=
0
;
58
b
(
0xa0000000
);
59
if
(
count
!=
2
)
60
ASSERT
(
0
);
61
62
count
=
0
;
63
b
(
0x60000000
);
64
if
(
count
!=
2
)
65
ASSERT
(
0
);
66
67
count
=
0
;
68
b
(
0xe0000000
);
69
if
(
count
!=
3
)
70
ASSERT
(
0
);
71
72
return
;
73
}
74