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-20141107-1.c
blob
8118496145f5d46a6b76f31dcf26fbfc95ce63ee
1
/*
2
20141107-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
#include <string.h>
12
13
#define bool _Bool
14
15
bool
f
(
int
a
,
bool
c
);
16
bool
f
(
int
a
,
bool
c
)
17
{
18
if
(!
a
)
19
c
= !
c
;
20
return
c
;
21
}
22
23
void
checkf
(
int
a
,
bool
b
)
24
{
25
bool
c
=
f
(
a
,
b
);
26
char
d
;
27
memcpy
(&
d
, &
c
,
1
);
28
#if defined (__SDCC) || (defined(__GNUC__) && !defined(__POWERPC__))
29
if
(
d
!= (
a
==
0
)^
b
)
30
ASSERT
(
0
);
31
#endif
32
}
33
34
void
35
testTortureExecute
(
void
)
36
{
37
checkf
(
0
,
0
);
38
checkf
(
0
,
1
);
39
checkf
(
1
,
1
);
40
checkf
(
1
,
0
);
41
}
42