summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver/recomp015/Makefile
blob: a8fbcd38c6f3b9cf2130f668bd2a14f9e9ec5306 (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
29
30
31
32
33
34
35
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk

# Recompilation tests

clean:
	rm -f *.o *.hi
	rm -f ManySections.s Main.hs
	rm -f Main$(exeext)
	rm -f Generate$(exeext)

recomp015: clean
	# Generate a file with more than 0xff00 sections to force different ELF
	# fields to be used (ELF header fields are limited to 16-bit).
	#
	# You can confirm that fields of section 0 entry are used to store the
	# number of section (size field of section 0) and the index of the .shstrtab
	# section (link field of section 0) with:
	#    readelf -t ManySections.o | less
	#  and/or
	#    readelf -t Main | less
	#
	# This test checks that GHC can read these fields correctly and avoids
	# recompilation (just like recomp011 which does the same thing for a smaller
	# number of sections)
	'$(TEST_HC)' $(TEST_HC_OPTS) Generate.hs
	./Generate > ManySections.s
	echo 'main = putStrLn "Running main..."' > Main.hs
	'$(TEST_HC)' $(TEST_HC_OPTS) -c ManySections.s
	'$(TEST_HC)' $(TEST_HC_OPTS) --make -O Main.hs ManySections.o
	./Main
	sleep 1
	'$(TEST_HC)' $(TEST_HC_OPTS) --make -O Main.hs ManySections.o
	./Main