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-931102-1.c
blob
8aacb0d4fc0b577f579e1f45da088f65c6852173
1
/*
2
931102-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
typedef
union
12
{
13
struct
14
{
15
char
h
,
l
;
16
}
b
;
17
}
T
;
18
19
int
f
(
int
x
)
20
{
21
int
num
=
0
;
22
T reg
;
23
24
reg
.
b
.
l
=
x
;
25
while
((
reg
.
b
.
l
&
1
) ==
0
)
26
{
27
num
++;
28
reg
.
b
.
l
>>=
1
;
29
}
30
return
num
;
31
}
32
33
void
34
testTortureExecute
(
void
)
35
{
36
if
(
f
(
2
) !=
1
)
37
ASSERT
(
0
);
38
return
;
39
}
40