add .exe suffix to executables built by make test
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d87f74c..7d46ec9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml
@@ -46,5 +46,5 @@ make -C sample CXXFLAGS="-DXBYAK_NO_EXCEPTION" cd test make xed_test - rm -rf jmp64 - env CXX=""clang++ -std=c++20"" make jmp64 && ./jmp64 + rm -rf jmp64.exe + env CXX=""clang++ -std=c++20"" make jmp64.exe && ./jmp64.exe
diff --git a/.gitignore b/.gitignore index 507091e..3599d89 100644 --- a/.gitignore +++ b/.gitignore
@@ -1,2 +1,3 @@ /build* # cmake *CVS +*.exe
diff --git a/test/Makefile b/test/Makefile index bb4ce23..4948f3d 100644 --- a/test/Makefile +++ b/test/Makefile
@@ -2,10 +2,10 @@ # apt install g++-multilib CXX_32 = $(CXX) -m32 CXX_64 = $(CXX) -m64 -TARGET = make_nm normalize_prefix bad_address misc cvt_test cvt_test32 noexception misc32 detect_x32 avx10_test +TARGET = make_nm.exe normalize_prefix.exe bad_address.exe misc.exe cvt_test.exe cvt_test32.exe noexception.exe misc32.exe detect_x32.exe avx10_test.exe XBYAK_INC=../xbyak/xbyak.h ../xbyak/xbyak_mnemonic.h ../xbyak/xbyak_util.h UNAME_S=$(shell uname -s) -ifeq ($(shell ./detect_x32),x32) +ifeq ($(shell ./detect_x32.exe),x32) X32?=1 endif BIT=32 @@ -21,12 +21,12 @@ ONLY_64BIT=1 endif ifeq ($(ONLY_64BIT),0) - TARGET += jmp address + TARGET += jmp.exe address.exe endif ifeq ($(BIT),64) - TARGET += jmp64 address64 apx - TARGET += sf_test cpumask_test + TARGET += jmp64.exe address64.exe apx.exe + TARGET += sf_test.exe cpumask_test.exe endif all: $(TARGET) @@ -34,49 +34,49 @@ CFLAGS_WARN=$(shell cat CFLAGS_WARN.cfg) CFLAGS=-O2 -Wall -I.. -I. $(CFLAGS_WARN) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) #-std=c++0x -make_nm: +make_nm.exe: $(CXX) $(CFLAGS) make_nm.cpp -o $@ -normalize_prefix: normalize_prefix.cpp $(XBYAK_INC) +normalize_prefix.exe: normalize_prefix.cpp $(XBYAK_INC) $(CXX) $(CFLAGS) normalize_prefix.cpp -o $@ test_mmx: test_mmx.cpp $(XBYAK_INC) $(CXX) $(CFLAGS) test_mmx.cpp -o $@ -lpthread -jmp: jmp.cpp $(XBYAK_INC) +jmp.exe: jmp.cpp $(XBYAK_INC) $(CXX_32) $(CFLAGS) $< -o $@ -jmp64: jmp.cpp $(XBYAK_INC) +jmp64.exe: jmp.cpp $(XBYAK_INC) $(CXX_64) $(CFLAGS) $< -o $@ -address: address.cpp $(XBYAK_INC) +address.exe: address.cpp $(XBYAK_INC) $(CXX_32) $(CFLAGS) $< -o $@ -address64: address.cpp $(XBYAK_INC) +address64.exe: address.cpp $(XBYAK_INC) $(CXX_64) $(CFLAGS) $< -o $@ -bad_address: bad_address.cpp $(XBYAK_INC) +bad_address.exe: bad_address.cpp $(XBYAK_INC) $(CXX) $(CFLAGS) $< -o $@ -misc: misc.cpp $(XBYAK_INC) +misc.exe: misc.cpp $(XBYAK_INC) $(CXX) $(CFLAGS) $< -o $@ -misc32: misc.cpp $(XBYAK_INC) +misc32.exe: misc.cpp $(XBYAK_INC) $(CXX) $(CFLAGS) $< -o $@ -DXBYAK32 -cvt_test: cvt_test.cpp $(XBYAK_INC) +cvt_test.exe: cvt_test.cpp $(XBYAK_INC) $(CXX) $(CFLAGS) $< -o $@ -cvt_test32: cvt_test.cpp $(XBYAK_INC) +cvt_test32.exe: cvt_test.cpp $(XBYAK_INC) $(CXX) $(CFLAGS) $< -o $@ -DXBYAK32 -noexception: noexception.cpp $(XBYAK_INC) +noexception.exe: noexception.cpp $(XBYAK_INC) $(CXX) $(CFLAGS) $< -o $@ -fno-exceptions -apx: apx.cpp $(XBYAK_INC) +apx.exe: apx.cpp $(XBYAK_INC) $(CXX) $(CFLAGS) $< -o $@ -avx10_test: avx10_test.cpp $(XBYAK_INC) +avx10_test.exe: avx10_test.cpp $(XBYAK_INC) $(CXX) $(CFLAGS) $< -o $@ -DXBYAK64 -sf_test: sf_test.cpp $(XBYAK_INC) sf_test_win.h sf_test_gcc.h +sf_test.exe: sf_test.cpp $(XBYAK_INC) sf_test_win.h sf_test_gcc.h $(CXX) $(CFLAGS) $< -o $@ #-DXBYAK64 -cpumask_test: cpumask_test.cpp $(XBYAK_INC) +cpumask_test.exe: cpumask_test.cpp $(XBYAK_INC) $(CXX) $(CFLAGS) $< -o $@ TEST_FILES=old.txt bf16.txt comp.txt misc.txt convert.txt minmax.txt saturation.txt apx.txt amx.txt -xed_test: +xed_test: detect_x32.exe @set -e; \ for target in $(addprefix dataset/, $(TEST_FILES)); do \ ./test_by_xed.sh $$target || exit 1; \ done -test_nm: normalize_prefix $(TARGET) +test_nm: normalize_prefix.exe $(TARGET) $(MAKE) -C ../gen ifneq ($(ONLY_64BIT),1) CXX=$(CXX) ./test_nm.sh @@ -84,25 +84,25 @@ CXX=$(CXX) ./test_nm.sh Y CXX=$(CXX) ./test_nm.sh avx512 CXX=$(CXX) ./test_address.sh - ./jmp - ./cvt_test32 + ./jmp.exe + ./cvt_test32.exe endif - ./bad_address - ./misc - ./misc32 - ./cvt_test + ./bad_address.exe + ./misc.exe + ./misc32.exe + ./cvt_test.exe ifeq ($(BIT),64) CXX=$(CXX) ./test_address.sh 64 ifneq ($(X32),1) CXX=$(CXX) ./test_nm.sh 64 CXX=$(CXX) ./test_nm.sh Y64 endif - ./jmp64 - ./apx - ./avx10_test + ./jmp64.exe + ./apx.exe + ./avx10_test.exe endif -test_avx: normalize_prefix +test_avx: normalize_prefix.exe ifneq ($(ONLY_64BIT),0) CXX=$(CXX) ./test_avx.sh CXX=$(CXX) ./test_avx.sh Y @@ -114,7 +114,7 @@ endif endif -test_avx512: normalize_prefix +test_avx512: normalize_prefix.exe ifneq ($(ONLY_64BIT),0) CXX=$(CXX) ./test_avx512.sh endif @@ -122,26 +122,30 @@ CXX=$(CXX) ./test_avx512.sh 64 endif -test_avx10: avx10_test - ./avx10_test +test_avx10: avx10_test.exe + ./avx10_test.exe -detect_x32: detect_x32.c +detect_x32.exe: detect_x32.c $(CC) $< -o $@ -test: detect_x32 +test: detect_x32.exe $(MAKE) test_nm $(MAKE) test_avx $(MAKE) test_avx512 +test_all: + $(MAKE) test + $(MAKE) test_by_xed + update_sf_test: sf_test.cpp - $(CXX) $(CFLAGS) sf_test.cpp -DXBYAK64_WIN -DDUMP -o sf_test_dump && ./sf_test_dump > sf_test_win.h - $(CXX) $(CFLAGS) sf_test.cpp -DXBYAK64_GCC -DDUMP -o sf_test_dump && ./sf_test_dump > sf_test_gcc.h + $(CXX) $(CFLAGS) sf_test.cpp -DXBYAK64_WIN -DDUMP -o sf_test_dump.exe && ./sf_test_dump.exe > sf_test_win.h + $(CXX) $(CFLAGS) sf_test.cpp -DXBYAK64_GCC -DDUMP -o sf_test_dump.exe && ./sf_test_dump.exe > sf_test_gcc.h clean: - $(RM) a.asm *.lst *.obj *.o $(TARGET) lib_run nm.cpp nm_frame make_512 avx10_test detect_x32 sf_test sf_test_dump + $(RM) a.asm *.lst *.obj *.o *.exe $(TARGET) nm.cpp -lib_run: lib_test.cpp lib_run.cpp lib.h - $(CXX) $(CFLAGS) lib_run.cpp lib_test.cpp -o lib_run -make_nm: make_nm.cpp make.h $(XBYAK_INC) +lib_run.exe: lib_test.cpp lib_run.cpp lib.h detect_x32.exe + $(CXX) $(CFLAGS) lib_run.cpp lib_test.cpp -o lib_run.exe +make_nm.exe: make_nm.cpp make.h $(XBYAK_INC) .PHONY: test
diff --git a/test/test_address.sh b/test/test_address.sh index 43726b0..16d07c9 100755 --- a/test/test_address.sh +++ b/test/test_address.sh
@@ -11,19 +11,19 @@ { CFLAGS="$CFLAGS_USER $CFLAGS_WARN -I../ $OPT2" -echo $CXX $CFLAGS address.cpp -o address -$CXX $CFLAGS address.cpp -o address +echo $CXX $CFLAGS address.cpp -o address.exe +$CXX $CFLAGS address.cpp -o address.exe -./address $1 > a.asm +./address.exe $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 echo "xbyak" -./address $1 jit > nm.cpp +./address.exe $1 jit > nm.cpp echo "compile nm_frame.cpp" -$CXX $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame -./nm_frame > x.lst +$CXX $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame.exe +./nm_frame.exe > x.lst diff -bB ok.lst x.lst && echo "ok" }
diff --git a/test/test_avx.sh b/test/test_avx.sh index b528520..3ba9143 100755 --- a/test/test_avx.sh +++ b/test/test_avx.sh
@@ -19,14 +19,14 @@ EXE=nasm OPT2=-DXBYAK64 OPT3=win64 - FILTER=./normalize_prefix + FILTER=./normalize_prefix.exe ;; Y64) echo "yasm(64bit)" EXE=yasm OPT2="-DUSE_YASM -DXBYAK64" OPT3=win64 - FILTER=./normalize_prefix + FILTER=./normalize_prefix.exe ;; *) echo "nasm(32bit)" @@ -38,16 +38,16 @@ CFLAGS="$CFLAGS_USER $CFLAGS_WARN -g -I../ $OPT2 -DUSE_AVX" echo "compile make_nm.cpp" -$CXX $CFLAGS make_nm.cpp -o make_nm +$CXX $CFLAGS make_nm.cpp -o make_nm.exe -./make_nm > a.asm +./make_nm.exe > a.asm echo "asm" $EXE -f$OPT3 a.asm -l a.lst awk '$3 != "1+1" {printf "%s", sub(/-$/, "", $3) ? $3 : $3 ORS}' a.lst | $FILTER > ok.lst echo "xbyak" -./make_nm jit > nm.cpp +./make_nm.exe jit > nm.cpp echo "compile nm_frame.cpp" -$CXX $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame -./nm_frame | $FILTER > x.lst +$CXX $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame.exe +./nm_frame.exe | $FILTER > x.lst diff -bB ok.lst x.lst && echo "ok"
diff --git a/test/test_avx512.sh b/test/test_avx512.sh index 91526fd..b91c67b 100755 --- a/test/test_avx512.sh +++ b/test/test_avx512.sh
@@ -13,7 +13,7 @@ EXE=nasm OPT2=-DXBYAK64 OPT3=win64 - FILTER=./normalize_prefix + FILTER=./normalize_prefix.exe ;; *) echo "nasm(32bit)" @@ -25,16 +25,16 @@ CFLAGS="$CFLAGS_USER $CFLAGS_WARN -I../ $OPT2 -DUSE_AVX512" echo "compile make_512.cpp" -$CXX $CFLAGS make_512.cpp -o make_512 +$CXX $CFLAGS make_512.cpp -o make_512.exe -./make_512 > a.asm +./make_512.exe > 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 echo "xbyak" -./make_512 jit > nm.cpp +./make_512.exe jit > nm.cpp echo "compile nm_frame.cpp" -$CXX $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame -DXBYAK_AVX512 -./nm_frame | $FILTER > x.lst +$CXX $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame.exe -DXBYAK_AVX512 +./nm_frame.exe | $FILTER > x.lst diff -bB ok.lst x.lst && echo "ok"
diff --git a/test/test_by_xed.sh b/test/test_by_xed.sh index 23aa239..2f135c9 100755 --- a/test/test_by_xed.sh +++ b/test/test_by_xed.sh
@@ -21,8 +21,8 @@ echo "test:" $TARGET cp $TARGET tmp.cpp -$CXX $CFLAGS test_by_xed.cpp -o test_by_xed -./test_by_xed || (echo "ERR test_by_xed"; exit 1) +$CXX $CFLAGS test_by_xed.cpp -o test_by_xed.exe +./test_by_xed.exe || (echo "ERR test_by_xed"; exit 1) echo "$XED ${XED_OPT} -ir bin > out.txt" $XED ${XED_OPT} -ir bin > out.txt || (echo "ERR xed"; exit 1) $PYTHON test_by_xed.py $TARGET out.txt || (echo "ERR test_by_xed.py"; exit 1)
diff --git a/test/test_nm.sh b/test/test_nm.sh index 874c30f..9c2b9aa 100755 --- a/test/test_nm.sh +++ b/test/test_nm.sh
@@ -19,21 +19,21 @@ EXE=nasm OPT2=-DXBYAK64 OPT3=win64 - FILTER=./normalize_prefix + FILTER=./normalize_prefix.exe ;; Y64) echo "yasm(64bit)" EXE=yasm OPT2="-DUSE_YASM -DXBYAK64" OPT3=win64 - FILTER=./normalize_prefix + FILTER=./normalize_prefix.exe ;; avx512) echo "nasm(64bit) + avx512" EXE=nasm OPT2="-DXBYAK64 -DUSE_AVX512" OPT3=win64 - FILTER=./normalize_prefix + FILTER=./normalize_prefix.exe ;; noexcept) echo "nasm(32bit) without exception" @@ -51,16 +51,16 @@ CFLAGS="$CFLAGS_USER $CFLAGS_WARN -g -I../ -I./ $OPT2" echo "compile make_nm.cpp with $CFLAGS" -$CXX $CFLAGS make_nm.cpp -o make_nm +$CXX $CFLAGS make_nm.cpp -o make_nm.exe -./make_nm > a.asm +./make_nm.exe > a.asm echo "asm" $EXE -f$OPT3 a.asm -l a.lst awk '$3 != "1+1" {printf "%s", sub(/-$/, "", $3) ? $3 : $3 ORS}' a.lst | $FILTER > ok.lst echo "xbyak" -./make_nm jit > nm.cpp +./make_nm.exe jit > nm.cpp echo "compile nm_frame.cpp" -$CXX $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame -./nm_frame | $FILTER > x.lst +$CXX $CFLAGS -DXBYAK_TEST nm_frame.cpp -o nm_frame.exe +./nm_frame.exe | $FILTER > x.lst diff -bB ok.lst x.lst && echo "ok"