repo.or.cz
/
valgrind.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Add 469782 to NEWS
[valgrind.git]
/
none
/
tests
/
x86
/
bug135421-x86.c
blob
48a245e53a4b3f9f443327a5a0ac9f60b0c95235
1
2
/* Test for long-form encodings of push %reg */
3
4
#include <stdio.h>
5
6
int
foo
(
int
x
)
7
{
8
int
block
[
2
];
9
block
[
0
] =
x
;
10
block
[
1
] =
0
;
11
__asm__
__volatile__
(
12
"movl $0,%%edi
\n\t
"
13
"movl $0,%%esi
\n\t
"
14
"movl %0,%%edi
\n\t
"
15
".byte 0xFF,0xF7
\n\t
"
/*pushl %edi */
16
"popl %%esi
\n\t
"
17
"movl %%esi, %1"
18
: :
/*in*/
"m"
(
block
[
0
]),
"m"
(
block
[
1
]) :
"esi"
,
"edi"
,
"memory"
19
);
20
return
block
[
1
];
21
}
22
23
int
main
(
void
)
24
{
25
int
i
;
26
for
(
i
=
0
;
i
<
100000000
;
i
+=
11111111
)
27
printf
(
"%d %d
\n
"
,
i
,
foo
(
i
));
28
return
0
;
29
}