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-20001228-1.c
blob
ffa748d9a2d24f52ae551b4343f054256d782f41
1
/*
2
20001228-1.c from the execute part of the gcc torture tests.
3
*/
4
5
#include <testfwk.h>
6
7
#ifdef __SDCC
8
#pragma std_c99
9
#endif
10
11
int
foo1
(
void
)
12
{
13
union
{
14
char
a
[
sizeof
(
unsigned
)];
15
unsigned
b
;
16
}
u
;
17
18
u
.
b
=
0x01
;
19
return
u
.
a
[
0
];
20
}
21
22
int
foo2
(
void
)
23
{
24
volatile
union
{
25
char
a
[
sizeof
(
unsigned
)];
26
unsigned
b
;
27
}
u
;
28
29
u
.
b
=
0x01
;
30
return
u
.
a
[
0
];
31
}
32
33
void
34
testTortureExecute
(
void
)
35
{
36
if
(
foo1
() !=
foo2
())
37
ASSERT
(
0
);
38
return
;
39
}
40