Skip to content

Commit

Permalink
Allow building tests with different toolchain variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackhex committed Nov 16, 2023
1 parent 476664e commit 16d9552
Showing 1 changed file with 37 additions and 31 deletions.
68 changes: 37 additions & 31 deletions tests/build-tests.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 16d9552

Please sign in to comment.