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-960311-1.c
blob
6e299d4e114a3715d1d8744ae175159dac575a51
1
/*
2
960311-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
#include <stdio.h>
12
13
int
count
;
14
15
void
a1
() { ++
count
; }
16
17
void
18
b
(
unsigned char
data
)
19
{
20
if
(
data
&
0x80
)
a1
();
21
data
<<=
1
;
22
23
if
(
data
&
0x80
)
a1
();
24
data
<<=
1
;
25
26
if
(
data
&
0x80
)
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
(
0x80
);
39
if
(
count
!=
1
)
40
ASSERT
(
0
);
41
42
count
=
0
;
43
b
(
0x40
);
44
if
(
count
!=
1
)
45
ASSERT
(
0
);
46
47
count
=
0
;
48
b
(
0x20
);
49
if
(
count
!=
1
)
50
ASSERT
(
0
);
51
52
count
=
0
;
53
b
(
0xc0
);
54
if
(
count
!=
2
)
55
ASSERT
(
0
);
56
57
count
=
0
;
58
b
(
0xa0
);
59
if
(
count
!=
2
)
60
ASSERT
(
0
);
61
62
count
=
0
;
63
b
(
0x60
);
64
if
(
count
!=
2
)
65
ASSERT
(
0
);
66
67
count
=
0
;
68
b
(
0xe0
);
69
if
(
count
!=
3
)
70
ASSERT
(
0
);
71
72
return
;
73
}
74