repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR inline-asm/84742
[official-gcc.git]
/
gcc
/
testsuite
/
gcc.c-torture
/
execute
/
pr40668.c
blob
b860dd7c9ecced2f000db2408f7d50e39c4f358b
1
#if (__SIZEOF_INT__ == 2)
2
#define TESTVALUE 0x1234
3
#else
4
#define TESTVALUE 0x12345678
5
#endif
6
static void
7
foo
(
unsigned int
x
,
void
*
p
)
8
{
9
__builtin_memcpy
(
p
, &
x
,
sizeof
x
);
10
}
11
12
void
13
bar
(
int
type
,
void
*
number
)
14
{
15
switch
(
type
)
16
{
17
case
1
:
18
foo
(
TESTVALUE
,
number
);
19
break
;
20
case
7
:
21
foo
(
0
,
number
);
22
break
;
23
case
8
:
24
foo
(
0
,
number
);
25
break
;
26
case
9
:
27
foo
(
0
,
number
);
28
break
;
29
}
30
}
31
32
int
33
main
(
void
)
34
{
35
unsigned int
x
;
36
bar
(
1
, &
x
);
37
if
(
x
!=
TESTVALUE
)
38
__builtin_abort
();
39
return
0
;
40
}