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