From 16d95527d91a28c5953a53d12a9889fbe36be9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Barto=C5=88?= Date: Wed, 8 Nov 2023 13:25:48 +0100 Subject: [PATCH] Allow building tests with different toolchain variants --- tests/build-tests.sh | 68 ++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/tests/build-tests.sh b/tests/build-tests.sh index e329cc720..dcd763752 100755 --- a/tests/build-tests.sh +++ b/tests/build-tests.sh @@ -1,43 +1,49 @@ rm *.s *.dump *.gkd *.exe *.dll *.log -~/cross/bin/aarch64-w64-mingw32-g++ -S test-bigdata.cpp -o test-bigdata.s -fdump-final-insns -~/cross/bin/aarch64-w64-mingw32-g++ -S test-throw.cpp -o test-throw.s -fdump-final-insns -~/cross/bin/aarch64-w64-mingw32-g++ -S test-iostream.cpp -o test-iostream.cpp.s -fdump-final-insns -~/cross/bin/aarch64-w64-mingw32-gcc -S test-math.c -o test-math.c.s -fdump-final-insns -~/cross/bin/aarch64-w64-mingw32-gcc -S test-pdata.c -o test-pdata.s -fdump-final-insns -~/cross/bin/aarch64-w64-mingw32-gcc -S test-struct.c -o test-struct.s -fdump-final-insns - -~/cross/bin/aarch64-w64-mingw32-g++ -g test-bigdata.cpp -o test-bigdata.exe >> test-bigdata.log -~/cross/bin/aarch64-w64-mingw32-g++ -g test-throw.cpp -o test-throw.exe >> test-throw.log -~/cross/bin/aarch64-w64-mingw32-g++ -g test-iostream.cpp -o test-iostream.exe >> test-iostream.log -~/cross/bin/aarch64-w64-mingw32-gcc -g test-math.c -o test-math.c.exe >> test-math.c.log -~/cross/bin/aarch64-w64-mingw32-gcc -g test-pdata.c -ldbghelp -o test-pdata.exe >> test-pdata.log -~/cross/bin/aarch64-w64-mingw32-gcc -g test-struct.c -o test-struct.exe >> test-struct.log -~/cross/bin/aarch64-w64-mingw32-gcc -g test-math.c -o test-math.exe >> test-math.log -~/cross/bin/aarch64-w64-mingw32-gcc -g test-varargs.c -o test-varargs.exe >> test-varargs.log -~/cross/bin/aarch64-w64-mingw32-gcc -g test-sjlj.c -o test-sjlj.exe >> test-sjlj.log -~/cross/bin/aarch64-w64-mingw32-gcc -g -fopenmp test-omp.c -o test-omp.exe >> test-omp.log +PREFIX=~/cross/bin +TARGET=aarch64-w64-mingw32 + +CC=$PREFIX/$TARGET-gcc +CXX=$PREFIX/$TARGET-g++ +DLTOOL=$PREFIX/$TARGET-dlltool +OBJDUMP=$PREFIX/$TARGET-objdump + +$CXX -S test-bigdata.cpp -o test-bigdata.s -fdump-final-insns +$CXX -S test-throw.cpp -o test-throw.s -fdump-final-insns +$CXX -S test-iostream.cpp -o test-iostream.cpp.s -fdump-final-insns +$CC -S test-math.c -o test-math.c.s -fdump-final-insns +$CC -S test-pdata.c -o test-pdata.s -fdump-final-insns +$CC -S test-struct.c -o test-struct.s -fdump-final-insns + +$CXX -g test-bigdata.cpp -o test-bigdata.exe >> test-bigdata.log +$CXX -g test-throw.cpp -o test-throw.exe >> test-throw.log +$CXX -g test-iostream.cpp -o test-iostream.exe >> test-iostream.log +$CC -g test-math.c -o test-math.c.exe >> test-math.c.log +$CC -g test-pdata.c -ldbghelp -o test-pdata.exe >> test-pdata.log +$CC -g test-struct.c -o test-struct.exe >> test-struct.log +$CC -g test-math.c -o test-math.exe >> test-math.log +$CC -g test-varargs.c -o test-varargs.exe >> test-varargs.log +$CC -g test-sjlj.c -o test-sjlj.exe >> test-sjlj.log +$CC -g -fopenmp test-omp.c -o test-omp.exe >> test-omp.log # -# DLL examples +# DLL examples # -~/cross/bin/aarch64-w64-mingw32-gcc -g -DEXPORT_API="__declspec(dllexport)" -o dll-export.dll -s -shared dll.c -Wl,--subsystem,windows -~/cross/bin/aarch64-w64-mingw32-gcc -g -DEXPORT_API= -o dll-auto.dll -s -shared dll.c -Wl,--subsystem,windows,--out-implib,libdll-exportlib.a -~/cross/bin/aarch64-w64-mingw32-dlltool -k --output-lib libdll-def.a --def dll.def +$CC -g -DEXPORT_API="__declspec(dllexport)" -o dll-export.dll -s -shared dll.c -Wl,--subsystem,windows +$CC -g -DEXPORT_API= -o dll-auto.dll -s -shared dll.c -Wl,--subsystem,windows,--out-implib,libdll-exportlib.a +$DLTOOL -k --output-lib libdll-def.a --def dll.def -~/cross/bin/aarch64-w64-mingw32-gcc -g -DIMPORT_API="__declspec(dllimport)" -o test-dll-export.exe -s test-dll.c -L. -ldll-export -fdump-final-insns > test-dll-export.log -~/cross/bin/aarch64-w64-mingw32-gcc -g -DIMPORT_API= -o test-dll-auto.exe -s test-dll.c -L. -ldll-auto -fdump-final-insns > test-dll-auto.log -~/cross/bin/aarch64-w64-mingw32-gcc -g -DIMPORT_API= -o test-dll-def.exe -s test-dll.c -L. -ldll-def -fdump-final-insns > test-dll-def.log +$CC -g -DIMPORT_API="__declspec(dllimport)" -o test-dll-export.exe -s test-dll.c -L. -ldll-export -fdump-final-insns > test-dll-export.log +$CC -g -DIMPORT_API= -o test-dll-auto.exe -s test-dll.c -L. -ldll-auto -fdump-final-insns > test-dll-auto.log +$CC -g -DIMPORT_API= -o test-dll-def.exe -s test-dll.c -L. -ldll-def -fdump-final-insns > test-dll-def.log # # Dump some EXE's for inspection # -~/cross/bin/aarch64-w64-mingw32-objdump -dr test-bigdata.exe >> test-bigdata.dump -~/cross/bin/aarch64-w64-mingw32-objdump -dr test-throw.exe >> test-throw.dump -~/cross/bin/aarch64-w64-mingw32-objdump -dr test-dll-auto.exe >> test-dll-auto.dump -~/cross/bin/aarch64-w64-mingw32-objdump -dr test-dll-export.exe >> test-dll-export.dump -~/cross/bin/aarch64-w64-mingw32-objdump -dr test-struct.exe >> test-struct.dump - - +$OBJDUMP -dr test-bigdata.exe >> test-bigdata.dump +$OBJDUMP -dr test-throw.exe >> test-throw.dump +$OBJDUMP -dr test-dll-auto.exe >> test-dll-auto.dump +$OBJDUMP -dr test-dll-export.exe >> test-dll-export.dump +$OBJDUMP -dr test-struct.exe >> test-struct.dump