repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[PATCH v2 2/3] RISC-V: setmem for RISCV with V extension
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
960311-1.c
blob
89cc6bf903f026778e21628ed3fb40ca0fa2e4d9
1
#include <stdio.h>
2
3
void
abort
(
void
);
4
void
exit
(
int
);
5
6
#ifdef DEBUG
7
#define abort() printf (
"error, line %d
\n
"
, __LINE__)
8
#endif
9
10
int
count
;
11
12
void
a1
() { ++
count
; }
13
14
void
15
b
(
unsigned char
data
)
16
{
17
if
(
data
&
0x80
)
a1
();
18
data
<<=
1
;
19
20
if
(
data
&
0x80
)
a1
();
21
data
<<=
1
;
22
23
if
(
data
&
0x80
)
a1
();
24
}
25
26
int
27
main
(
void
)
28
{
29
count
=
0
;
30
b
(
0
);
31
if
(
count
!=
0
)
32
abort
();
33
34
count
=
0
;
35
b
(
0x80
);
36
if
(
count
!=
1
)
37
abort
();
38
39
count
=
0
;
40
b
(
0x40
);
41
if
(
count
!=
1
)
42
abort
();
43
44
count
=
0
;
45
b
(
0x20
);
46
if
(
count
!=
1
)
47
abort
();
48
49
count
=
0
;
50
b
(
0xc0
);
51
if
(
count
!=
2
)
52
abort
();
53
54
count
=
0
;
55
b
(
0xa0
);
56
if
(
count
!=
2
)
57
abort
();
58
59
count
=
0
;
60
b
(
0x60
);
61
if
(
count
!=
2
)
62
abort
();
63
64
count
=
0
;
65
b
(
0xe0
);
66
if
(
count
!=
3
)
67
abort
();
68
69
#ifdef DEBUG
70
printf
(
"Done.
\n
"
);
71
#endif
72
exit
(
0
);
73
}