mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 10:21:20 +00:00
Regression test for clc/stc/cmc on amd64.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5893
This commit is contained in:
parent
4950ba1806
commit
931b079b96
@ -5,6 +5,7 @@ CLEANFILES = $(addsuffix .c,$(INSN_TESTS))
|
||||
INSN_TESTS = insn_basic insn_mmx insn_sse insn_sse2 insn_fpu
|
||||
|
||||
EXTRA_DIST = $(noinst_SCRIPTS) \
|
||||
clc.vgtest clc.stdout.exp clc.stderr.exp \
|
||||
faultstatus.vgtest faultstatus.stderr.exp \
|
||||
fcmovnu.vgtest fcmovnu.stderr.exp fcmovnu.stdout.exp \
|
||||
fxtract.vgtest fxtract.stderr.exp fxtract.stdout.exp \
|
||||
@ -18,6 +19,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
|
||||
|
||||
|
||||
check_PROGRAMS = \
|
||||
clc \
|
||||
faultstatus fcmovnu fxtract $(INSN_TESTS) looper jrcxz smc1 shrld
|
||||
|
||||
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g -I$(top_srcdir)/include
|
||||
|
||||
61
none/tests/amd64/clc.c
Normal file
61
none/tests/amd64/clc.c
Normal file
@ -0,0 +1,61 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef unsigned long long int ULong;
|
||||
|
||||
ULong do_clc ( void )
|
||||
{
|
||||
ULong res;
|
||||
__asm__ __volatile__(
|
||||
"pushq $0x8d5\n\t" /* OSZACP */
|
||||
"popfq\n\t"
|
||||
"clc\n\t"
|
||||
"pushfq\n\t"
|
||||
"popq %0"
|
||||
: "=r"(res)
|
||||
:
|
||||
: "memory", "cc"
|
||||
);
|
||||
return res;
|
||||
}
|
||||
|
||||
ULong do_stc ( void )
|
||||
{
|
||||
ULong res;
|
||||
__asm__ __volatile__(
|
||||
"pushq $0x0\n\t"
|
||||
"popfq\n\t"
|
||||
"stc\n\t"
|
||||
"pushfq\n\t"
|
||||
"popq %0"
|
||||
: "=r"(res)
|
||||
:
|
||||
: "memory", "cc"
|
||||
);
|
||||
return res;
|
||||
}
|
||||
|
||||
ULong do_cmc ( void )
|
||||
{
|
||||
ULong res;
|
||||
__asm__ __volatile__(
|
||||
"pushq $0x0\n\t"
|
||||
"popfq\n\t"
|
||||
"stc\n\t"
|
||||
"cmc\n\t"
|
||||
"pushfq\n\t"
|
||||
"popq %0"
|
||||
: "=r"(res)
|
||||
:
|
||||
: "memory", "cc"
|
||||
);
|
||||
return res;
|
||||
}
|
||||
|
||||
int main ( void )
|
||||
{
|
||||
printf("clc: 0x%016llx\n", 0x8d5 & do_clc());
|
||||
printf("stc: 0x%016llx\n", 0x8d5 & do_stc());
|
||||
printf("cmc: 0x%016llx\n", 0x8d5 & do_cmc());
|
||||
return 0;
|
||||
}
|
||||
2
none/tests/amd64/clc.stderr.exp
Normal file
2
none/tests/amd64/clc.stderr.exp
Normal file
@ -0,0 +1,2 @@
|
||||
|
||||
|
||||
3
none/tests/amd64/clc.stdout.exp
Normal file
3
none/tests/amd64/clc.stdout.exp
Normal file
@ -0,0 +1,3 @@
|
||||
clc: 0x00000000000008d4
|
||||
stc: 0x0000000000000001
|
||||
cmc: 0x0000000000000000
|
||||
1
none/tests/amd64/clc.vgtest
Normal file
1
none/tests/amd64/clc.vgtest
Normal file
@ -0,0 +1 @@
|
||||
prog: clc
|
||||
Loading…
x
Reference in New Issue
Block a user