File: dotests.sh

package info (click to toggle)
faucc 20120707-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,424 kB
  • ctags: 2,909
  • sloc: ansic: 38,774; yacc: 1,600; xml: 519; lex: 378; sh: 178; makefile: 127
file content (78 lines) | stat: -rwxr-xr-x 1,510 bytes parent folder | download | duplicates (4)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/sh

TEST="test-bda test-conv test-expr test-if test-switch test-hello-world test-ext"
TEST2="test.c \
	test3.c \
	test4.c \
	test5.c \
	test6.c \
	test7.c \
	test8.c \
	test9.c \
	test10.c \
	test11.c \
	test12.c \
	test13.c \
	test14.c \
	test15.c \
	test16.c \
	test17.c \
	test18.c \
	test19.c \
	test20.c \
	test21.c \
	\
	chip_intel_80386_inline.c \
	test-hello-world.c \
	test-i386-add.c \
	test-i386.c \
	test-i386-noinline.c"

for test in ${TEST} ; do
	echo "${test}"

	# Check for warnings.
	gcc -Wall -c ${test}.c
	rm -f ${test}.o

	# Generate assembler code using gcc.
	gcc -S -m32 -falign-functions=15 ${test}.c
	mv ${test}.s ${test}.s.gcc

	# Generate assembler code using faucc with different args.
	(
		echo "-b i386 -falign-functions=15"
		echo "-b i286 -falign-functions=15"
		echo "-b i286 -falign-functions=15 -fsegment_enable"
	) \
	| while read args ; do
		echo "${test} (${args})..."

		# Generate assembler code using faucc.
		../faucc -S ${args} ${test}.c 2>&1 \
		| grep -v 'Fixing declaration of '

		# Call assembler to check syntax.
		gcc -c ${test}.s
		rm -f ${test}.o

		# Save generated file for later inspection.
		mv ${test}.s ${test}.s."${args}"
	done

	echo ""
done

cd bios
	for file in *.i ; do
		file=`basename ${file} .i`
		echo "${file}..."

		# Generate assembler code using faucc.
		../../faucc -S -b i286 -fsegment_enable ${file}.i 2>&1 \
		| grep -v 'Fixing declaration of '

		# Call assembler to check syntax.
		../../faucc -c -b i286 ${file}.s
	done
cd ..