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-930603-3.c
blob
3d52864df7e2a6216008f5223513ab6f4cccb938
1
/*
2
930603-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
int
f
(
unsigned char
*
b
,
int
c
)
12
{
13
unsigned long
v
=
0
;
14
switch
(
c
)
15
{
16
case
'd'
:
17
v
= ((
unsigned long
)
b
[
0
] <<
8
) +
b
[
1
];
18
v
>>=
9
;
19
break
;
20
21
case
'k'
:
22
v
=
b
[
3
] >>
4
;
23
break
;
24
25
default
:
26
ASSERT
(
0
);
27
}
28
29
return
v
;
30
}
31
void
32
testTortureExecute
(
void
)
33
{
34
char
buf
[
4
];
35
buf
[
0
] =
170
;
buf
[
1
] =
5
;
36
if
(
f
(
buf
,
'd'
) !=
85
)
37
ASSERT
(
0
);
38
return
;
39
}
40