xbyak/test/test_address.sh

46 lines
649 B
Bash
Raw Normal View History

2012-03-16 06:04:44 -07:00
#!/bin/sh
2022-11-28 07:52:58 -07:00
set -e
2015-08-17 23:38:59 -07:00
FILTER="grep -v warning"
2012-03-16 06:04:44 -07:00
sub()
{
2022-11-23 19:40:50 -07:00
CFLAGS="-Wall -I../ $OPT2"
2022-11-23 20:01:25 -07:00
CXX=${CXX:=g++}
2012-03-16 06:04:44 -07:00
echo "compile address.cpp"
2022-11-23 19:22:37 -07:00
$CXX $CFLAGS address.cpp -o address
2012-03-16 06:04:44 -07:00
./address $1 > a.asm
echo "asm"
$EXE -f$OPT3 a.asm -l a.lst
awk '{printf "%s", sub(/-$/, "", $3) ? $3 : $3 ORS}' a.lst | $FILTER > ok.lst
2012-03-16 06:04:44 -07:00
echo "xbyak"
./address $1 jit > nm.cpp
echo "compile nm_frame.cpp"
2022-11-23 19:22:37 -07:00
$CXX $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame
2012-03-16 06:04:44 -07:00
./nm_frame > x.lst
2023-07-26 20:20:24 -07:00
diff -bB ok.lst x.lst && echo "ok"
2012-03-16 06:04:44 -07:00
}
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