mirror of
https://github.com/herumi/xbyak
synced 2024-11-20 16:06:14 -07:00
add test script
This commit is contained in:
parent
7056b38d36
commit
9d9f985fff
5 changed files with 143 additions and 0 deletions
6
test/readme.txt
Normal file
6
test/readme.txt
Normal file
|
@ -0,0 +1,6 @@
|
|||
|
||||
test script on Windows
|
||||
|
||||
this test requires nasm.exe, yasm.exe, cl.exe, awk, diff
|
||||
|
||||
test_all ; for all tests
|
42
test/test_address.sh
Executable file
42
test/test_address.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh
|
||||
|
||||
FILTER=cat
|
||||
|
||||
sub()
|
||||
{
|
||||
|
||||
CFLAGS="-Wall -fno-operator-names -I../ $OPT2"
|
||||
echo "compile address.cpp"
|
||||
g++ $CFLAGS address.cpp -o address
|
||||
|
||||
./address $1 > a.asm
|
||||
echo "asm"
|
||||
$EXE -f$OPT3 a.asm -l a.lst
|
||||
awk '{print $3}' < a.lst > ok.lst
|
||||
|
||||
echo "xbyak"
|
||||
./address $1 jit > nm.cpp
|
||||
echo "compile nm_frame.cpp"
|
||||
g++ $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame
|
||||
./nm_frame > x.lst
|
||||
diff ok.lst x.lst && echo "ok"
|
||||
wc x.lst
|
||||
|
||||
}
|
||||
|
||||
if [ "$1" = "64" ]; then
|
||||
echo "nasm(64bit)"
|
||||
EXE=nasm
|
||||
OPT2=-DXBYAK64
|
||||
OPT3=win64
|
||||
|
||||
sub 1
|
||||
sub 2
|
||||
else
|
||||
echo "nasm(32bit)"
|
||||
EXE=nasm
|
||||
OPT2=-DXBYAK32
|
||||
OPT3=win32
|
||||
sub 1
|
||||
fi
|
||||
|
42
test/test_avx.bat
Executable file
42
test/test_avx.bat
Executable file
|
@ -0,0 +1,42 @@
|
|||
@echo off
|
||||
set FILTER=cat
|
||||
set Y=0
|
||||
if /i "%1"=="Y" (
|
||||
set Y=1
|
||||
set EXE=yasm.exe
|
||||
set OPT2=-DUSE_YASM -DXBYAK32
|
||||
set OPT3=win32
|
||||
) else if /i "%1"=="64" (
|
||||
set EXE=nasm.exe
|
||||
set OPT2=-DXBYAK64
|
||||
set OPT3=win64
|
||||
set FILTER=normalize_prefix
|
||||
) else if /i "%1"=="Y64" (
|
||||
set Y=1
|
||||
set EXE=yasm.exe
|
||||
set OPT2=-DUSE_YASM -DXBYAK64
|
||||
set OPT3=win64
|
||||
set FILTER=normalize_prefix
|
||||
) else (
|
||||
set EXE=nasm.exe
|
||||
set OPT2=-DXBYAK32
|
||||
set OPT3=win32
|
||||
)
|
||||
pushd ..\gen
|
||||
call update
|
||||
popd
|
||||
echo cl -I../ make_nm.cpp %OPT% %OPT2% /EHs /DUSE_AVX
|
||||
cl -I../ make_nm.cpp %OPT% %OPT2% /EHs /DUSE_AVX
|
||||
make_nm > a.asm
|
||||
%EXE% -f %OPT3% -l a.lst a.asm
|
||||
rem connect "?????-" and "??"
|
||||
if /i "%Y%"=="1" (
|
||||
awk "NR > 1 {if (index($3, ""-"")) { conti=substr($3, 0, length($3) - 1) } else { conti = conti $3; print conti; conti = """" }} " < a.lst |%FILTER% > ok.lst
|
||||
) else (
|
||||
awk "{if (index($3, ""-"")) { conti=substr($3, 0, length($3) - 1) } else { conti = conti $3; print conti; conti = """" }} " < a.lst |%FILTER% > ok.lst
|
||||
)
|
||||
make_nm jit > nm.cpp
|
||||
cl -I../ -DXBYAK_TEST nm_frame.cpp %OPT% %OPT2%
|
||||
nm_frame |%FILTER% > x.lst
|
||||
diff x.lst ok.lst
|
||||
wc x.lst
|
44
test/test_avx.sh
Executable file
44
test/test_avx.sh
Executable file
|
@ -0,0 +1,44 @@
|
|||
#!/bin/tcsh
|
||||
|
||||
set FILTER=cat
|
||||
|
||||
if ($1 == "Y") then
|
||||
echo "yasm(32bit)"
|
||||
set EXE=yasm
|
||||
set OPT2="-DUSE_YASM -DXBYAK32"
|
||||
set OPT3=win32
|
||||
else if ($1 == "64") then
|
||||
echo "nasm(64bit)"
|
||||
set EXE=nasm
|
||||
set OPT2=-DXBYAK64
|
||||
set OPT3=win64
|
||||
set FILTER=./normalize_prefix
|
||||
else if ($1 == "Y64") then
|
||||
echo "yasm(64bit)"
|
||||
set EXE=yasm
|
||||
set OPT2="-DUSE_YASM -DXBYAK64"
|
||||
set OPT3=win64
|
||||
set FILTER=./normalize_prefix
|
||||
else
|
||||
echo "nasm(32bit)"
|
||||
set EXE=nasm
|
||||
set OPT2=-DXBYAK32
|
||||
set OPT3=win32
|
||||
endif
|
||||
|
||||
set CFLAGS="-Wall -fno-operator-names -I../ $OPT2 -DUSE_AVX"
|
||||
echo "compile make_nm.cpp"
|
||||
g++ $CFLAGS make_nm.cpp -o make_nm
|
||||
|
||||
./make_nm > a.asm
|
||||
echo "asm"
|
||||
$EXE -f$OPT3 a.asm -l a.lst
|
||||
awk '{if (index($3, "-")) { conti=substr($3, 0, length($3) - 1) } else { conti = conti $3; print conti; conti = "" }} ' < a.lst | $FILTER > ok.lst
|
||||
|
||||
echo "xbyak"
|
||||
./make_nm jit > nm.cpp
|
||||
echo "compile nm_frame.cpp"
|
||||
g++ $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame
|
||||
./nm_frame | $FILTER > x.lst
|
||||
diff ok.lst x.lst && echo "ok"
|
||||
exit 0
|
9
test/test_avx_all.bat
Executable file
9
test/test_avx_all.bat
Executable file
|
@ -0,0 +1,9 @@
|
|||
@echo off
|
||||
echo ** nasm-avx(32bit) ***
|
||||
call test_avx
|
||||
echo ** nasm-avx(64bit) ***
|
||||
call test_avx 64
|
||||
echo ** yasm-avx(32bit) ***
|
||||
call test_avx Y
|
||||
echo ** yasm-avx(64bit) ***
|
||||
call test_avx Y64
|
Loading…
Reference in a new issue