summaryrefslogtreecommitdiff
path: root/miniany/torture.sh
blob: c3d2db79d37fbee37a77355731695c472b837fda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

for COMPILER in gcc clang pcc tcc; do
	for MODE in freestanding hosted; do
		for LEVEL in d s 0 1 2 3; do
			echo "## $COMPILER $MODE $LEVEL ##"
# pcc and hosted c4 fail, use another compiler for this case for now
#			./build.sh c4 $COMPILER $MODE $LEVEL
			if test "$COMPILER" = "pcc"; then
				./build.sh c4 tcc $MODE $LEVEL
			else 
				./build.sh c4 $COMPILER $MODE $LEVEL
			fi
			./build.sh cc $COMPILER $MODE $LEVEL
			./cc < test1.c > test1.asm
			cat cc.c EOF test1.c | ./c4 > test1-c4.asm
			cat c4.c EOF cc.c EOF test1.c | ./c4 > test1-c4-c4.asm
			diff test1.asm test1-c4.asm
			diff test1.asm test1-c4-c4.asm
			fasm test1.asm test1.bin
			hexdump -C test1.bin > test1.hex
			diff test1.hex test1.hexmust
			ndisasm -b32 -o1000000h -a test1.bin > test1.dis
			diff test1.dis test1.disasmust
		done
	done
done