diff --git a/mk/test.mk b/mk/test.mk
index 1d89c775e62e97301dbe11e38bae8a686b3fa85c..5a83f8e94da674b19b3e58a35988f6b577336a1b 100644
--- a/mk/test.mk
+++ b/mk/test.mk
@@ -25,6 +25,10 @@ COMPILER     = ghc
 CONFIGDIR    = $(TOP)/config
 CONFIG       = $(CONFIGDIR)/$(COMPILER)
 
+# TEST_HC_OPTS is passed to every invocation of TEST_HC 
+# in nested Makefiles
+TEST_HC_OPTS = -dno-debug-output $(EXTRA_HC_OPTS)
+
 RUNTEST_OPTS =
 
 $(eval $(call get-ghc-rts-field,WORDSIZE,Word size))
diff --git a/tests/ghc-regress/cabal/Makefile b/tests/ghc-regress/cabal/Makefile
index 8cf7202c5da900ae874098e31afae8e1347dd164..322309ae42cc8904ec4c1577e7a94758d3f06b6f 100644
--- a/tests/ghc-regress/cabal/Makefile
+++ b/tests/ghc-regress/cabal/Makefile
@@ -75,7 +75,7 @@ ghcpkg04 :
 	$(LOCAL_GHC_PKG04) update --force test5.pkg >/dev/null 2>&1 
 	$(LOCAL_GHC_PKG04) expose testpkg-1.2.3.4  >/dev/null 2>&1
 	@: # testpkg-1.2.3.4 and newtestpkg-2.0 are both exposed now
-	'$(TEST_HC)' -package-conf $(PKGCONF04) -c ghcpkg04.hs || true
+	'$(TEST_HC)' $(TEST_HC_OPTS) -package-conf $(PKGCONF04) -c ghcpkg04.hs || true
 
 # Test stacking of package.confs (also #2441)
 PKGCONF05a=local05a.package.conf
@@ -121,7 +121,7 @@ LOCAL_GHC_PKG1750 = '$(GHC_PKG)' --no-user-package-conf -f $(PKGCONF1750)
 # the patch "Change the command-line semantics for query commands" to
 # ghc-pkg
 	echo "main = return ()" >1750.hs
-	'$(TEST_HC)' -package-conf $(PKGCONF1750) -package 1750A 1750.hs || true
+	'$(TEST_HC)' $(TEST_HC_OPTS) -package-conf $(PKGCONF1750) -package 1750A 1750.hs || true
 
 PKGCONFSHADOW1=localshadow1.package.conf
 PKGCONFSHADOW2=localshadow2.package.conf
@@ -150,18 +150,18 @@ shadow:
 # shadowdep-1-XXX to be unavailable:
 #
 	@echo "should FAIL:"
-	'$(TEST_HC)' -package-conf $(PKGCONFSHADOW1) -package-conf $(PKGCONFSHADOW2) -package shadowdep -c shadow.hs -fno-code || true
+	'$(TEST_HC)' $(TEST_HC_OPTS) -package-conf $(PKGCONFSHADOW1) -package-conf $(PKGCONFSHADOW2) -package shadowdep -c shadow.hs -fno-code || true
 # 
 # Reversing the order of the package.conf files should fix the problem:
 #
 	@echo "should SUCCEED:"
-	'$(TEST_HC)' -package-conf $(PKGCONFSHADOW2) -package-conf $(PKGCONFSHADOW1) -package shadowdep -c shadow.hs -fno-code || true
+	'$(TEST_HC)' $(TEST_HC_OPTS) -package-conf $(PKGCONFSHADOW2) -package-conf $(PKGCONFSHADOW1) -package shadowdep -c shadow.hs -fno-code || true
 #
 # We can also fix the problem by using an explicit -package-id flag to
 # specify a package we really want to use:
 #
 	@echo "should SUCCEED:"
-	'$(TEST_HC)' -package-conf $(PKGCONFSHADOW1) -package-conf $(PKGCONFSHADOW2) -package-id shadowdep-1-XXX -c shadow.hs -fno-code
+	'$(TEST_HC)' $(TEST_HC_OPTS) -package-conf $(PKGCONFSHADOW1) -package-conf $(PKGCONFSHADOW2) -package-id shadowdep-1-XXX -c shadow.hs -fno-code
 
 
 # -----------------------------------------------------------------------------
diff --git a/tests/ghc-regress/codeGen/should_compile/Makefile b/tests/ghc-regress/codeGen/should_compile/Makefile
index 2717fa668b2ca366a41b196826595601e0ab4fe6..416e9ed6f5c8be06b83b24850bb3b405c093d1a6 100644
--- a/tests/ghc-regress/codeGen/should_compile/Makefile
+++ b/tests/ghc-regress/codeGen/should_compile/Makefile
@@ -3,5 +3,5 @@ include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
 2578:
-	'$(TEST_HC)' --make 2578 -fforce-recomp -v0
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make 2578 -fforce-recomp -v0
 
diff --git a/tests/ghc-regress/concurrent/should_run/Makefile b/tests/ghc-regress/concurrent/should_run/Makefile
index dc17bdedf6a66324a8e8c426a5943830ffee715a..58a16cb0c654d707c34d21e6e77a8dba675d4f37 100644
--- a/tests/ghc-regress/concurrent/should_run/Makefile
+++ b/tests/ghc-regress/concurrent/should_run/Makefile
@@ -3,4 +3,4 @@ include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
 conc059_setup :
-	'$(TEST_HC)' -c conc059.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c conc059.hs
diff --git a/tests/ghc-regress/deriving/should_fail/Makefile b/tests/ghc-regress/deriving/should_fail/Makefile
index b9441b82ed31824288bb7a8093c1fecf60f5069b..e527b6115d5f0189a9080935ad02c00450c15761 100644
--- a/tests/ghc-regress/deriving/should_fail/Makefile
+++ b/tests/ghc-regress/deriving/should_fail/Makefile
@@ -4,5 +4,5 @@ include $(TOP)/mk/test.mk
 
 drvfail016:
 	$(RM) -f drvfail016.hi-boot drvfail016.o-boot
-	'$(TEST_HC)' -XGeneralizedNewtypeDeriving -c drvfail016.hs-boot; echo $$?
+	'$(TEST_HC)' $(TEST_HC_OPTS) -XGeneralizedNewtypeDeriving -c drvfail016.hs-boot; echo $$?
 
diff --git a/tests/ghc-regress/driver/1372/Makefile b/tests/ghc-regress/driver/1372/Makefile
index 63b07eff25413fe0b93de3b24bbd67ea2497f855..549c991b4a1a99db48d23d588523e107025b447f 100644
--- a/tests/ghc-regress/driver/1372/Makefile
+++ b/tests/ghc-regress/driver/1372/Makefile
@@ -30,7 +30,7 @@ prep:
 	cd p1 && ./setup build -v0
 
 prep.%:
-	cd $* && "$(TEST_HC)" -v0 --make -o setup Setup.hs
+	cd $* && "$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -o setup Setup.hs
 	cd $* && ./setup configure -v0 --with-compiler="$(TEST_HC)" --with-hc-pkg="$(GHC_PKG)" --package-db=../$(LOCAL_PKGCONF)
 	cd $* && ./setup build -v0
 	cd $* && ./setup register -v0 --inplace
diff --git a/tests/ghc-regress/driver/1959/Makefile b/tests/ghc-regress/driver/1959/Makefile
index 4f21b68c57e0debfc3ecf289a9a1dad57bcac620..766a606b2b2251c08926a06eda0f396ac42c0a0b 100644
--- a/tests/ghc-regress/driver/1959/Makefile
+++ b/tests/ghc-regress/driver/1959/Makefile
@@ -5,11 +5,11 @@ include $(TOP)/mk/test.mk
 # Test recompilation bug #1959, which failed in 6.8.1 (and earlier)
 
 compile ::
-	'$(TEST_HC)' -c -O E.hs
-	'$(TEST_HC)' -c -O D.hs
-	'$(TEST_HC)' -c -O -funfolding-use-threshold=0 C.hs
-	'$(TEST_HC)' -c -O B.hs
-	'$(TEST_HC)' E.o D.o C.o B.o -o prog
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O E.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O D.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O -funfolding-use-threshold=0 C.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O B.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) E.o D.o C.o B.o -o prog
 
 clean ::
 	rm -f *.o *.hi E.hs
diff --git a/tests/ghc-regress/driver/Makefile b/tests/ghc-regress/driver/Makefile
index a5f0a9cceb95437eb8a21240ad77d976e58e1f35..cb64ea675a0b36f38fb57b061fe3926c085ff418 100644
--- a/tests/ghc-regress/driver/Makefile
+++ b/tests/ghc-regress/driver/Makefile
@@ -20,7 +20,7 @@ OBJSUFFIX = .o
 test011:
 	$(RM) A011.hi
 	$(RM) A011$(OBJSUFFIX)
-	"$(TEST_HC)" -c A011.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) $(TEST_HC_OPTS) -c A011.hs
 	test -f A011.hi
 	test -f A011$(OBJSUFFIX)
 
@@ -28,14 +28,14 @@ test011:
 test012:
 	$(RM) A012.hi
 	$(RM) A012$(OBJSUFFIX)oo
-	"$(TEST_HC)" -c A012.hs -o A012$(OBJSUFFIX)oo
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c A012.hs -o A012$(OBJSUFFIX)oo
 	test -f A012$(OBJSUFFIX)oo
 
 # test -ohi
 test013:
 	$(RM) A013.xhi
 	$(RM) A013$(OBJSUFFIX)
-	"$(TEST_HC)" -c A013.hs -ohi A013.xhi
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c A013.hs -ohi A013.xhi
 	test -f A013.xhi
 
 # test -odir
@@ -43,7 +43,7 @@ test014:
 	$(RM) -f A014.hi
 	$(RM) -rf obj014
 	mkdir obj014
-	"$(TEST_HC)" -c A014.hs -odir obj014
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c A014.hs -odir obj014
 	test -f obj014/A014$(OBJSUFFIX)
 	test -f A014.hi
 
@@ -52,20 +52,20 @@ test015:
 	$(RM) -f A015$(OBJSUFFIX)
 	$(RM) -rf hi015
 	mkdir hi015
-	"$(TEST_HC)" -c A015.hs -hidir hi015
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c A015.hs -hidir hi015
 	test -f A015$(OBJSUFFIX)
 	test -f hi015/A015.hi
 
 # test stub generation
 test016:
 	$(RM) F016.hi F016$(OBJSUFFIX) F016_stub.h
-	"$(TEST_HC)" -c F016.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c F016.hs
 	test -f F016_stub.h
 
 # test -stubdir (filename differs from module name)
 test017:
 	$(RM) F017.hi F017$(OBJSUFFIX)
-	"$(TEST_HC)" -c F017.hs -stubdir stub017
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c F017.hs -stubdir stub017
 	test -f stub017/TestStub017_stub.h
 
 # test -odir with stubs (filename differs from module name)
@@ -73,18 +73,18 @@ test018:
 	$(RM) -f F018.hi F018$(OBJSUFFIX) F018_stub.h
 	$(RM) -rf obj018
 	mkdir obj018
-	"$(TEST_HC)" -c F018.hs -odir obj018
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c F018.hs -odir obj018
 
 # test for bug #3093
 test018a:
 	$(RM) -f F018a.hi F018a_stub.h *.obj.018
-	"$(TEST_HC)" -c F018a.hs -osuf obj.018
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c F018a.hs -osuf obj.018
 	test -f F018a.obj.018
 
 # test -outputdir
 test019:
 	$(RM) -rf out019
-	"$(TEST_HC)" -c F019.hs -outputdir out019
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c F019.hs -outputdir out019
 	test -f out019/TestStub019.hi
 	test -f out019/TestStub019_stub.h
 
@@ -94,7 +94,7 @@ test019:
 test021:
 	$(RM) B021/C.hi
 	$(RM) B021/C$(OBJSUFFIX)
-	"$(TEST_HC)" -c B021/C.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c B021/C.hs
 	test -f B021/C.hi
 	test -f B021/C$(OBJSUFFIX)
 
@@ -102,14 +102,14 @@ test021:
 test022:
 	$(RM) B022/C.hi
 	$(RM) B022/C$(OBJSUFFIX)oo
-	"$(TEST_HC)" -c B022/C.hs -o B022/C$(OBJSUFFIX)oo
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c B022/C.hs -o B022/C$(OBJSUFFIX)oo
 	test -f B022/C$(OBJSUFFIX)oo
 
 # test -ohi
 test023:
 	$(RM) B023/C.xhi
 	$(RM) B023/C$(OBJSUFFIX)
-	"$(TEST_HC)" -c B023/C.hs -ohi B023/C.xhi
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c B023/C.hs -ohi B023/C.xhi
 	test -f B023/C.xhi
 
 # test -odir
@@ -117,7 +117,7 @@ test024:
 	$(RM) -f B024/C.hi
 	$(RM) -rf obj024
 	mkdir obj024
-	"$(TEST_HC)" -c B024/C.hs -odir obj024
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c B024/C.hs -odir obj024
 	test -f obj024/B024/C$(OBJSUFFIX)
 
 # test -odir with non-Haskell compilation
@@ -127,7 +127,7 @@ test024a:
 	mkdir B024a
 	mkdir obj024a
 	echo >B024a/stub.c
-	"$(TEST_HC)" -c B024a/stub.c -odir obj024a
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c B024a/stub.c -odir obj024a
 	test -f obj024a/B024a/stub$(OBJSUFFIX)
 
 # test -hidir
@@ -135,14 +135,14 @@ test025:
 	$(RM) -rf hi025
 	mkdir hi025
 	$(RM) B025/C$(OBJSUFFIX)
-	"$(TEST_HC)" -c B025/C.hs -hidir hi025
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c B025/C.hs -hidir hi025
 	test -f hi025/B025/C.hi
 
 # This is a hierarchical module that lives in a subdirectory.
 test026:
 	$(RM) d026/P/Q.hi
 	$(RM) d026/P/Q$(OBJSUFFIX)
-	"$(TEST_HC)" -c d026/P/Q.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c d026/P/Q.hs
 	test -f d026/P/Q.hi
 	test -f d026/P/Q$(OBJSUFFIX)
 
@@ -150,7 +150,7 @@ test026:
 # -fvia-C, because we want to check that the .hc file can #include the stub.h
 test027:
 	$(RM) B027/F.hi B027/F$(OBJSUFFIX) B027/F_stub.h
-	"$(TEST_HC)" -c B027/F.hs -fno-warn-deprecated-flags -fvia-C
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c B027/F.hs -fno-warn-deprecated-flags -fvia-C
 	test -f B027/F_stub.h
 
 # test -stubdir
@@ -158,7 +158,7 @@ test027:
 test028:
 	$(RM) B028/F.hi B028/F$(OBJSUFFIX)
 	$(RM) stub028/B028/F_stub.h
-	"$(TEST_HC)" -c B028/F.hs -stubdir stub028 -fno-warn-deprecated-flags -fvia-C
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c B028/F.hs -stubdir stub028 -fno-warn-deprecated-flags -fvia-C
 	test -f stub028/B028/F_stub.h
 
 # -----------------------------------------------------------------------------
@@ -167,7 +167,7 @@ test028:
 test031:
 	$(RM) A031.hi
 	$(RM) A031$(OBJSUFFIX)
-	"$(TEST_HC)" -v0 --make A031.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make A031.hs
 	test -f A031.hi
 	test -f A031$(OBJSUFFIX)
 
@@ -176,7 +176,7 @@ test032:
 	$(RM) A032.hi
 	$(RM) -rf obj032
 	mkdir obj032
-	"$(TEST_HC)" -v0 --make A032.hs -odir obj032
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make A032.hs -odir obj032
 	test -f obj032/A032$(OBJSUFFIX)
 
 # test -hidir
@@ -184,19 +184,19 @@ test033:
 	$(RM) -rf hi033
 	$(RM) A033$(OBJSUFFIX)
 	mkdir hi033
-	"$(TEST_HC)" -v0 --make A033.hs -hidir hi033
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make A033.hs -hidir hi033
 	test -f hi033/A033.hi
 
 # test stub generation
 test034:
 	$(RM) F034.hi F034$(OBJSUFFIX) F034_stub.h
-	"$(TEST_HC)" -v0 --make F034.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make F034.hs
 	test -f F034_stub.h
 
 # test -stubdir (filename differs from module name)
 test035:
 	$(RM) F035.hi F$(OBJSUFFIX) stub035/Stubs_stub.h
-	"$(TEST_HC)" -v0 --make F035.hs -stubdir stub035
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make F035.hs -stubdir stub035
 	test -f stub035/TestStub035_stub.h
 
 # -----------------------------------------------------------------------------
@@ -205,7 +205,7 @@ test035:
 test041:
 	$(RM) B041/C.hi
 	$(RM) B041/C$(OBJSUFFIX)
-	"$(TEST_HC)" -v0 --make B041/C.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make B041/C.hs
 	test -f B041/C.hi
 	test -f B041/C$(OBJSUFFIX)
 
@@ -214,7 +214,7 @@ test042:
 	$(RM) -rf obj042
 	mkdir obj042
 	$(RM) B042/C.hi
-	"$(TEST_HC)" -v0 --make B042/C.hs -odir obj042
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make B042/C.hs -odir obj042
 	test -f obj042/B042/C$(OBJSUFFIX)
 
 # test -hidir
@@ -222,20 +222,20 @@ test043:
 	$(RM) -f B043/C$(OBJSUFFIX)
 	$(RM) -rf hi043
 	mkdir hi043
-	"$(TEST_HC)" -v0 --make B043/C.hs -hidir hi043
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make B043/C.hs -hidir hi043
 	test -f hi043/B043/C.hi
 
 # test stub generation
 test044:
 	$(RM) B044/F.hi B044/F$(OBJSUFFIX) B044/F_stub.h
-	"$(TEST_HC)" -v0 --make B044/F.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make B044/F.hs
 	test -f B044/F_stub.h
 
 # test -stubdir
 test045:
 	$(RM) B045/F.hi B045/F$(OBJSUFFIX)
 	$(RM) stub045/B045/F_stub.h
-	"$(TEST_HC)" -v0 --make B045/F.hs -stubdir stub045
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make B045/F.hs -stubdir stub045
 	test -f stub045/B045/F_stub.h
 
 # -----------------------------------------------------------------------------
@@ -246,7 +246,7 @@ test051:
 	$(RM) d051_2/R/S$(OBJSUFFIX)
 	$(RM) d051_1/P/Q.hi
 	$(RM) d051_1/P/Q$(OBJSUFFIX)
-	"$(TEST_HC)" -v0 --make -id051_1 -id051_2 R.S
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -id051_1 -id051_2 R.S
 	test -f d051_2/R/S.hi
 	test -f d051_2/R/S$(OBJSUFFIX)
 	test -f d051_1/P/Q.hi
@@ -258,7 +258,7 @@ test052:
 	$(RM) d052_1/P/Q.hi
 	$(RM) -rf obj052
 	mkdir obj052
-	"$(TEST_HC)" -v0 --make -id052_1 -id052_2 -odir obj052 R.S
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -id052_1 -id052_2 -odir obj052 R.S
 	test -f d052_2/R/S.hi
 	test -f obj052/R/S$(OBJSUFFIX)
 	test -f d052_1/P/Q.hi
@@ -270,7 +270,7 @@ test053:
 	$(RM) d053_2/R/S$(OBJSUFFIX)
 	$(RM) hi053/P/Q.hi
 	$(RM) d053_1/P/Q$(OBJSUFFIX)
-	"$(TEST_HC)" -v0 --make -id053_1 -id053_2 -hidir hi053 R.S
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -id053_1 -id053_2 -hidir hi053 R.S
 	test -f hi053/R/S.hi
 	test -f d053_2/R/S$(OBJSUFFIX)
 	test -f hi053/P/Q.hi
@@ -282,44 +282,44 @@ test053:
 # Test that -keep-s-files works with --make and -fvia-C
 test061a:
 	$(RM) A061a.hi A061a$(OBJSUFFIX) A061a.s
-	"$(TEST_HC)" -v0 --make -keep-s-files -fno-warn-deprecated-flags -fvia-C A061a.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -keep-s-files -fno-warn-deprecated-flags -fvia-C A061a.hs
 	test -f A061a.s
 
 # Test that -keep-s-files works without --make
 test061b:
 	$(RM) A061b.hi A061b$(OBJSUFFIX) A061b.s
-	"$(TEST_HC)" -c -keep-s-files -fno-warn-deprecated-flags -fvia-C A061b.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c -keep-s-files -fno-warn-deprecated-flags -fvia-C A061b.hs
 	test -f A061b.s
 
 # Test that -main-is works with --make
 test062a:
 	$(RM) Hello062a.hs Hello062a.hi Hello062a$(OBJSUFFIX) Hello062a.hc hello062a
 	echo "module Hello062a where { hello062a = putStrLn \"ok\" }" >Hello062a.hs
-	"$(TEST_HC)" -v0 --make -main-is Hello062a.hello062a Hello062a -o hello062a
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -main-is Hello062a.hello062a Hello062a -o hello062a
 	./hello062a
 test062b:
 	$(RM) Hello062b.hs Hello062b.hi Hello062b$(OBJSUFFIX) Hello062b.hc hello062b
 	echo "module Hello062b where { main = putStrLn \"ok\" }" >Hello062b.hs
-	"$(TEST_HC)" -v0 --make -main-is Hello062b Hello062b -o hello062b
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -main-is Hello062b Hello062b -o hello062b
 	./hello062b
 test062c:
 	$(RM) Hello062c.hs Hello062c.hi Hello062c$(OBJSUFFIX) Hello062c.hc hello062c
 	echo "module Main (hello062c) where { hello062c = putStrLn \"ok\" }" >Hello062c.hs
-	"$(TEST_HC)" -v0 --make -main-is hello062c Hello062c.hs -o hello062c
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -main-is hello062c Hello062c.hs -o hello062c
 	./hello062c
 test062d:
 	$(RM) -rf B062d
 	$(RM) hello062d
 	mkdir B062d
 	echo "module B062d.Hello062d (hello062d) where { hello062d = putStrLn \"ok\" }" >B062d/Hello062d.hs
-	"$(TEST_HC)" -v0 --make -main-is B062d.Hello062d.hello062d B062d/Hello062d.hs -o hello062d
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -main-is B062d.Hello062d.hello062d B062d/Hello062d.hs -o hello062d
 	./hello062d
 test062e:
 	$(RM) -rf B062e
 	$(RM) Hello062e.hc hello062e
 	mkdir B062e
 	echo "module B062e.Hello062e (main) where { main = putStrLn \"ok\" }" >B062e/Hello062e.hs
-	"$(TEST_HC)" -v0 --make -main-is B062e.Hello062e B062e/Hello062e.hs -o hello062e
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -main-is B062e.Hello062e B062e/Hello062e.hs -o hello062e
 	./hello062e
 
 # Test that -i deletes the list of search paths.
@@ -327,42 +327,42 @@ test062e:
 # compare the output, because make might give us a different exit code.
 test063:
 	$(RM) A063.hi A063$(OBJSUFFIX) A063.hc D063.hi D063$(OBJSUFFIX) D063.hc
-	-"$(TEST_HC)" --make -i -v0 D063.hs
+	-"$(TEST_HC)" $(TEST_HC_OPTS) --make -i -v0 D063.hs
 
 # Test -E
 test064:
 	$(RM) A064.hi A064.hspp
-	"$(TEST_HC)" -E A064.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -E A064.hs
 	test -f A064.hspp
 
 # Test -E/-cpp
 test065:
 	$(RM) A065.hi A065.hspp
-	"$(TEST_HC)" -E -cpp A065.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -E -cpp A065.hs
 	test -f A065.hspp
 
 # Test -E/-o
 test066:
 	$(RM) A066.hi A066.tmp
-	"$(TEST_HC)" -E A066.hs -o A066.tmp
+	"$(TEST_HC)" $(TEST_HC_OPTS) -E A066.hs -o A066.tmp
 	test -f A066.tmp
 
 # Test -E/-cpp/-o
 test067:
 	$(RM) A067.hi A067.tmp
-	"$(TEST_HC)" -cpp -E A067.hs -o A067.tmp
+	"$(TEST_HC)" $(TEST_HC_OPTS) -cpp -E A067.hs -o A067.tmp
 	test -f A067.tmp
 
 # Test -S
 test070:
 	$(RM) A070.hi A070.s
-	"$(TEST_HC)" -S A070.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -S A070.hs
 	test -f A070.s
 
 # Test -S/-o
 test071:
 	$(RM) A071.hi A071.tmp
-	"$(TEST_HC)" -S A071.hs -o A071.tmp
+	"$(TEST_HC)" $(TEST_HC_OPTS) -S A071.hs -o A071.tmp
 	test -f A071.tmp
 
 
@@ -371,7 +371,7 @@ test071:
 define test081
 $(RM) $(1).hs $(1).hi $(1)$(OBJSUFFIX) $(1).hc $(1)$(exeext)
 echo "module Main where { main = putStrLn \"ok\" }" >$(1).hs
-"$(TEST_HC)" --make -v0 $(1).hs
+"$(TEST_HC)" $(TEST_HC_OPTS) --make -v0 $(1).hs
 test -f $(1)$(exeext)
 endef
 
@@ -387,7 +387,7 @@ test081b:
 test100:
 	$(RM) overlap/List.hi overlap/List.o
 	$(RM) overlap/Overlap.hi overlap/Overlap.o
-	"$(TEST_HC)" -v0 --make -ioverlap Overlap
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make -ioverlap Overlap
 
 # -----------------------------------------------------------------------------
 # dependency-generation tests
@@ -398,17 +398,17 @@ DEPFILE200 = depend200
 # modify an existing dependency file.
 test200:
 	$(RM) $(DEPFILE200)
-	"$(TEST_HC)" -M -dep-makefile $(DEPFILE200) D200
+	"$(TEST_HC)" $(TEST_HC_OPTS) -M -dep-makefile $(DEPFILE200) D200
 	test -f $(DEPFILE200)
-	"$(TEST_HC)" -M -dep-makefile $(DEPFILE200) D200 B200.C A200
+	"$(TEST_HC)" $(TEST_HC_OPTS) -M -dep-makefile $(DEPFILE200) D200 B200.C A200
 	test -f $(DEPFILE200)
-	"$(TEST_HC)" -M -dep-makefile $(DEPFILE200) D200.hs B200/C.hs A200.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -M -dep-makefile $(DEPFILE200) D200.hs B200/C.hs A200.hs
 	test -f $(DEPFILE200)
 
 # -----------------------------------------------------------------------------
 
 2566::
-	if "$(TEST_HC)" -c foo2566.bar; then false else true; fi
+	if "$(TEST_HC)" $(TEST_HC_OPTS) -c foo2566.bar; then false else true; fi
 
 .PHONY: mode001
 # We use
@@ -419,42 +419,42 @@ test200:
 #     ghc: <stdout>: hFlush: resource vanished (Broken pipe)
 # on OS X
 mode001:
-	"$(TEST_HC)" --make --help        | sed '2,$$d'
-	"$(TEST_HC)" --help --make        | sed '2,$$d'
-	"$(TEST_HC)" --interactive --help | sed '2,$$d'
-	"$(TEST_HC)" --help --interactive | sed '2,$$d'
-	"$(TEST_HC)" --version --help     | sed "s/, version.*//"
-	"$(TEST_HC)" --help --version        | sed '2,$$d'
-	"$(TEST_HC)" --interactive --version | sed "s/, version.*//"
-	"$(TEST_HC)" --version --interactive | sed "s/, version.*//"
+	"$(TEST_HC)" $(TEST_HC_OPTS) --make --help        | sed '2,$$d'
+	"$(TEST_HC)" $(TEST_HC_OPTS) --help --make        | sed '2,$$d'
+	"$(TEST_HC)" $(TEST_HC_OPTS) --interactive --help | sed '2,$$d'
+	"$(TEST_HC)" $(TEST_HC_OPTS) --help --interactive | sed '2,$$d'
+	"$(TEST_HC)" $(TEST_HC_OPTS) --version --help     | sed "s/, version.*//"
+	"$(TEST_HC)" $(TEST_HC_OPTS) --help --version        | sed '2,$$d'
+	"$(TEST_HC)" $(TEST_HC_OPTS) --interactive --version | sed "s/, version.*//"
+	"$(TEST_HC)" $(TEST_HC_OPTS) --version --interactive | sed "s/, version.*//"
 
 # Test for building DLLs with ghc -shared, see #2745
 shared001:
 	$(RM) Shared001.hi Shared001.o HSdll.dll.a HSdll.dll Shared001_stub.*
-	"$(TEST_HC)" -v0 -shared Shared001.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 -shared Shared001.hs
 
 # -----------------------------------------------------------------------------
 
 3674:
 	$(RM) 3674*.o 3674*.hi 3674_pre
-	"$(TEST_HC)" --make 3674_pre.hs
-	"$(TEST_HC)" --make 3674.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) --make 3674_pre.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) --make 3674.hs
 
 .PHONY: rtsopts001
 rtsopts001:
 	$(RM) rtsOpts$(exeext) rtsOpts.hi rtsOpts.o
-	"$(TEST_HC)" -v0 --make rtsOpts -rtsopts
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make rtsOpts -rtsopts
 	echo "Normal"
 	-./rtsOpts +RTS -C0 2>&1
 	$(RM) rtsOpts$(exeext) rtsOpts.hi rtsOpts.o
-	"$(TEST_HC)" -v0 --make rtsOpts
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make rtsOpts
 	echo "No RTS opts"
 	-./rtsOpts +RTS -C0 2>&1
 
 .PHONY: rtsopts002
 rtsopts002:
 	$(RM) rtsopts002$(exeext) rtsopts002.hi rtsopts002.o
-	"$(TEST_HC)" -v0 --make rtsopts002 -rtsopts=some
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make rtsopts002 -rtsopts=some
 	./rtsopts002
 	./rtsopts002 +RTS --info >/dev/null
 	if ./rtsopts002 +RTS -C0; then exit 1; else exit 0; fi
@@ -465,23 +465,23 @@ rtsopts002:
 .PHONY: withRtsOpts
 withRtsOpts:
 	$(RM) withRtsOpts$(exeext) withRtsOpts.hi withRtsOpts.o withRtsOpts.out
-	"$(TEST_HC)" -v0 --make withRtsOpts -with-rtsopts=--info
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make withRtsOpts -with-rtsopts=--info
 	./withRtsOpts | head -1
 	# Also test for non-safe RTS opts, these should be allowed too,
 	# since the author has explicitly requested them. (#5114)
 	$(RM) withRtsOpts$(exeext) withRtsOpts.hi withRtsOpts.o withRtsOpts.out
-	"$(TEST_HC)" -v0 --make withRtsOpts -with-rtsopts=-twithRtsOpts.out
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 --make withRtsOpts -with-rtsopts=-twithRtsOpts.out
 	./withRtsOpts | head -1
 	test -f withRtsOpts.out
 
 .PHONY: T3364
 T3364:
-	-"$(TEST_HC)" -H
+	-"$(TEST_HC)" $(TEST_HC_OPTS) -H
 
 .PHONY: T706
 T706:
 	cp T706a.hs T706.hs
-	"$(TEST_HC)" -c T706.hs
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c T706.hs
 	cp T706b.hs T706.hs
-	"$(TEST_HC)" -c T706.hs
-	echo "test" | "$(TEST_HC)" --interactive -ignore-dot-ghci -v0 T706
+	"$(TEST_HC)" $(TEST_HC_OPTS) -c T706.hs
+	echo "test" | "$(TEST_HC)" $(TEST_HC_OPTS) --interactive -ignore-dot-ghci -v0 T706
diff --git a/tests/ghc-regress/driver/bug1677/Makefile b/tests/ghc-regress/driver/bug1677/Makefile
index 696941a9c4a88ecd9fe902e2230822f4a26137c6..482562fa43f208f67d518403be551bb793dc1a21 100644
--- a/tests/ghc-regress/driver/bug1677/Makefile
+++ b/tests/ghc-regress/driver/bug1677/Makefile
@@ -3,5 +3,5 @@ include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
 bug1677 :
-	'$(TEST_HC)' -M Foo.hs Bar.hs || true
+	'$(TEST_HC)' $(TEST_HC_OPTS) -M Foo.hs Bar.hs || true
 
diff --git a/tests/ghc-regress/driver/conflicting_flags/Makefile b/tests/ghc-regress/driver/conflicting_flags/Makefile
index 0f06a795be9ba004223f2d1e9f2da16c5ad2c6b0..ec2a7c768e5056c26c20ad00404b786cda506778 100644
--- a/tests/ghc-regress/driver/conflicting_flags/Makefile
+++ b/tests/ghc-regress/driver/conflicting_flags/Makefile
@@ -3,5 +3,5 @@ include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
 conflicting_flags:
-	'$(TEST_HC)' -V --print-libdir 2>&1 | sed "s/, version.*//"
+	'$(TEST_HC)' $(TEST_HC_OPTS) -V --print-libdir 2>&1 | sed "s/, version.*//"
 
diff --git a/tests/ghc-regress/driver/dynamic_flags_001/Makefile b/tests/ghc-regress/driver/dynamic_flags_001/Makefile
index e24b7c439b5b46f3256f7e957246863af1d3194e..414f2b45b8ad324e0da6071e39dc45d1e7429aae 100644
--- a/tests/ghc-regress/driver/dynamic_flags_001/Makefile
+++ b/tests/ghc-regress/driver/dynamic_flags_001/Makefile
@@ -11,4 +11,4 @@ clean:
 #      be on in when compiling other modules
 
 dynamic_flags_001: clean
-	'$(TEST_HC)' --make -Werror -v0 C.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make -Werror -v0 C.hs
diff --git a/tests/ghc-regress/driver/recomp001/Makefile b/tests/ghc-regress/driver/recomp001/Makefile
index 262f88962fe066f5e12a7977eeefc7e4fee309dc..f089f71ab79e6b1724697b6c1dcc1e073674d084 100644
--- a/tests/ghc-regress/driver/recomp001/Makefile
+++ b/tests/ghc-regress/driver/recomp001/Makefile
@@ -13,7 +13,7 @@ clean:
 
 recomp001: clean
 	cp B1.hs B.hs
-	'$(TEST_HC)' --make -v0 C.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 C.hs
 	sleep 1
 	cp B2.hs B.hs
-	-'$(TEST_HC)' --make -v0 C.hs
+	-'$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 C.hs
diff --git a/tests/ghc-regress/driver/recomp002/Makefile b/tests/ghc-regress/driver/recomp002/Makefile
index af2c1d80195ee851aeae57c59ff13e89cbe321a8..d2375961d24aec5855a2fc0bf6f3289df772154b 100644
--- a/tests/ghc-regress/driver/recomp002/Makefile
+++ b/tests/ghc-regress/driver/recomp002/Makefile
@@ -11,6 +11,6 @@ clean:
 # Only the first invocation should print any "Compiling" messages
 
 recomp002: clean
-	'$(TEST_HC)' --make Q.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make Q.hs
 	echo Middle >&2
-	'$(TEST_HC)' --make Q.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make Q.hs
diff --git a/tests/ghc-regress/driver/recomp003/Makefile b/tests/ghc-regress/driver/recomp003/Makefile
index 8420cdf99332bfcf59a5d0a85183c6747798e04c..45ae0cbbdf033bd4eefbbe5edc7b9b977ec7f197 100644
--- a/tests/ghc-regress/driver/recomp003/Makefile
+++ b/tests/ghc-regress/driver/recomp003/Makefile
@@ -10,9 +10,9 @@ recomp003:
 	$(RM) A.hi A$(OBJSUFFIX) out
 	$(RM) -rf Data
 	mkdir Data
-	'$(TEST_HC)' -c A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c A.hs
 	echo "module Data.Char where" > Data/Char.hs
-	'$(TEST_HC)' -c Data/Char.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c Data/Char.hs
 	# Should now recompile A.hs, because Char is now a home module:
-	'$(TEST_HC)' -c A.hs 2>err
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c A.hs 2>err
 	@if grep NOT err; then false; fi
diff --git a/tests/ghc-regress/driver/recomp004/Makefile b/tests/ghc-regress/driver/recomp004/Makefile
index 08ef506ae7714ebaa3c9bf3579ebb452aed6aa66..120556827ca50497db52d7e1edaf9e320a3a7a9e 100644
--- a/tests/ghc-regress/driver/recomp004/Makefile
+++ b/tests/ghc-regress/driver/recomp004/Makefile
@@ -12,13 +12,13 @@ clean:
 recomp004:
 	$(RM) $(CLEAN_FILES)
 	$(CP) c1.c c.c
-	'$(TEST_HC)' -v0 -c c.c -o c.o
-	'$(TEST_HC)' -v0 --make Main.hs c.o -o $(EXECUTABLE)
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -c c.c -o c.o
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make Main.hs c.o -o $(EXECUTABLE)
 	./$(EXECUTABLE)
 	$(CP) c2.c c.c
-	'$(TEST_HC)' -v0 -c c.c -o c.o
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -c c.c -o c.o
 	# Hack to make sure c.o is really newer
 	touch -t 01010000 Main.hs Main.hi Main.o c.c $(EXECUTABLE)
-	'$(TEST_HC)' -v0 --make Main.hs c.o -o $(EXECUTABLE)
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make Main.hs c.o -o $(EXECUTABLE)
 	./$(EXECUTABLE)
 
diff --git a/tests/ghc-regress/driver/recomp005/Makefile b/tests/ghc-regress/driver/recomp005/Makefile
index ec1a074c2e58b4872db4057c450847cc2ca251bb..a588cff176a111111ce64ddb557d632e1d2e77df 100644
--- a/tests/ghc-regress/driver/recomp005/Makefile
+++ b/tests/ghc-regress/driver/recomp005/Makefile
@@ -9,8 +9,8 @@ clean:
 
 recomp005: clean
 	cp C1.hs C.hs
-	'$(TEST_HC)' --make E.hs -O
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make E.hs -O
 	sleep 1
 	cp C2.hs C.hs
 	# Should recompile E, because C is now an orphan
-	'$(TEST_HC)' --make E.hs -O
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make E.hs -O
diff --git a/tests/ghc-regress/driver/recomp006/Makefile b/tests/ghc-regress/driver/recomp006/Makefile
index 21e53a2ee893990cd44a477eee0603978e8a880f..c71f5ec4052001d2a3427bffe889db3b0440ce51 100644
--- a/tests/ghc-regress/driver/recomp006/Makefile
+++ b/tests/ghc-regress/driver/recomp006/Makefile
@@ -9,8 +9,8 @@ OBJSUFFIX = .o
 recomp006:
 	$(RM) A.hi A$(OBJSUFFIX)
 	cp B1.hs B.hs
-	'$(TEST_HC)' --make A.hs 1>out 2>err
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make A.hs 1>out 2>err
 	sleep 1
 	cp B2.hs B.hs
 	# This should fail
-	if '$(TEST_HC)' --make A.hs; then false; fi
+	if '$(TEST_HC)' $(TEST_HC_OPTS) --make A.hs; then false; fi
diff --git a/tests/ghc-regress/driver/recomp008/Makefile b/tests/ghc-regress/driver/recomp008/Makefile
index 6f27234ed3bcb70605f0a5d1b88249a7eb1129f4..16392f5dd01f8d673dd2f4a0b66ca84bec583ca2 100644
--- a/tests/ghc-regress/driver/recomp008/Makefile
+++ b/tests/ghc-regress/driver/recomp008/Makefile
@@ -6,13 +6,13 @@ Main.o : B.hi
 B.o : A.hi
 
 %.o : %.hs
-	'$(TEST_HC)' -O -c $< -o $@
+	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c $< -o $@
 
 # magic .hi rule: see rules/hi-rule.mk in the GHC source tree
 %.hi : %.o ;
 
 prog : A.o B.o Main.o
-	'$(TEST_HC)' -o prog A.o B.o Main.o
+	'$(TEST_HC)' $(TEST_HC_OPTS) -o prog A.o B.o Main.o
 
 clean :
 	$(RM) *.hi *.o prog
diff --git a/tests/ghc-regress/dynlibs/Makefile b/tests/ghc-regress/dynlibs/Makefile
index 44a5a60aa4426a0cd6fdf28c902f484591fb4537..439b0e626d126396545ed078595464b5b66a535c 100644
--- a/tests/ghc-regress/dynlibs/Makefile
+++ b/tests/ghc-regress/dynlibs/Makefile
@@ -9,8 +9,8 @@ T3807:
 	$(RM) T3807-export.o T3807-load.o
 	$(RM) T3807test.so
 	$(RM) T3807-load
-	'$(TEST_HC)' -v0 --make -dynamic -fPIC -shared T3807Export.hs T3807-export.c -o T3807test.so -lHSrts-ghc`'$(TEST_HC)' --numeric-version`
-	'$(TEST_HC)' T3807-load.c -o T3807-load -ldl
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make -dynamic -fPIC -shared T3807Export.hs T3807-export.c -o T3807test.so -lHSrts-ghc`'$(TEST_HC)' $(TEST_HC_OPTS) --numeric-version`
+	'$(TEST_HC)' $(TEST_HC_OPTS) T3807-load.c -o T3807-load -ldl
 	./T3807-load
 
 .PHONY: T4464
@@ -18,15 +18,15 @@ T4464:
 	$(RM) T4464B.o T4464C.o T4464H.hi T4464H.o
 	$(RM) T4464H_stub.c T4464H_stub.h T4464H_stub.o
 	$(RM) HS4464.dll HS4464.dll.a t4464.exe
-	'$(TEST_HC)' -v0 -shared T4464H.hs T4464B.c -o HS4464.dll
-	'$(TEST_HC)' -v0 T4464C.c HS4464.dll.a -o t4464.exe
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -shared T4464H.hs T4464B.c -o HS4464.dll
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 T4464C.c HS4464.dll.a -o t4464.exe
 	-./t4464.exe
 	echo "====="
 	echo "=====" >&2
 	$(RM) T4464B.o T4464C.o T4464H.hi T4464H.o
 	$(RM) T4464H_stub.c T4464H_stub.h T4464H_stub.o
 	$(RM) HS4464.dll HS4464.dll.a t4464.exe
-	'$(TEST_HC)' -v0 -shared T4464H.hs T4464B.c -o HS4464.dll -rtsopts
-	'$(TEST_HC)' -v0 T4464C.c HS4464.dll.a -o t4464.exe
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -shared T4464H.hs T4464B.c -o HS4464.dll -rtsopts
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 T4464C.c HS4464.dll.a -o t4464.exe
 	./t4464.exe
 
diff --git a/tests/ghc-regress/ffi/should_run/Makefile b/tests/ghc-regress/ffi/should_run/Makefile
index e3970571f18880601d2e7bbb76aee15be179e3c3..238e751be68a9db8261df807777165a395cfffa3 100644
--- a/tests/ghc-regress/ffi/should_run/Makefile
+++ b/tests/ghc-regress/ffi/should_run/Makefile
@@ -3,13 +3,13 @@ include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
 ffi018_ghci_setup :
-	'$(TEST_HC)' -c ffi018_ghci_c.c
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c ffi018_ghci_c.c
 
 1288_ghci_setup :
-	'$(TEST_HC)' -c 1288_ghci_c.c
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c 1288_ghci_c.c
 
 2276_ghci_setup :
-	'$(TEST_HC)' -c 2276_ghci_c.c
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c 2276_ghci_c.c
 
 ffi002_setup :
-	'$(TEST_HC)' -c ffi002.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c ffi002.hs
diff --git a/tests/ghc-regress/gadt/Makefile b/tests/ghc-regress/gadt/Makefile
index 984d0984451a775ccaea86c4fd31695cd64e3b88..c2dff37de1026fb0139327f1cc31b3b863450681 100644
--- a/tests/ghc-regress/gadt/Makefile
+++ b/tests/ghc-regress/gadt/Makefile
@@ -8,15 +8,15 @@ include $(TOP)/mk/test.mk
 gadt17:
 	@$(RM) gadt17.hi Gadt17_help.hi
 	@$(RM) A$(OBJSUFFIX)
-	'$(TEST_HC)' -c Gadt17_help.hs
-	'$(TEST_HC)' -c gadt17.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c Gadt17_help.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c gadt17.hs
 
 gadt23:
 	$(RM) gadt23 gadt23.hi gadt23.o Gadt23_AST.hi Gadt23_AST.o
-	'$(TEST_HC)' -v0 --make gadt23.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make gadt23.hs
 	# We want to "touch gadt23.hs" really, but we then have issues with
 	# everything happening in the same second so the touch having no
 	# effect. Thus make gadt23.hi/o older instead.
 	touch -t 01010000 gadt23.hi gadt23.o
-	'$(TEST_HC)' -v0 --make gadt23.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make gadt23.hs
 
diff --git a/tests/ghc-regress/ghc-api/T4891/Makefile b/tests/ghc-regress/ghc-api/T4891/Makefile
index 592bde0b37090d0e76f4bec299155f6aaf467d3f..179109b49ee09c2e52c9555fbf786b81bea4eaaa 100644
--- a/tests/ghc-regress/ghc-api/T4891/Makefile
+++ b/tests/ghc-regress/ghc-api/T4891/Makefile
@@ -6,8 +6,8 @@ clean:
 	rm -f *.o *.hi
 
 T4891: clean
-	'$(TEST_HC)' --make -v0 -package ghc T4891
-	./T4891 "`'$(TEST_HC)' --print-libdir | tr -d '\r'`"
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 -package ghc T4891
+	./T4891 "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
 
 .PHONY: clean T4891
 
diff --git a/tests/ghc-regress/ghc-api/apirecomp001/Makefile b/tests/ghc-regress/ghc-api/apirecomp001/Makefile
index 9e017f8b289343119078d4dc917afbf52411b15e..c6a2dc70d8b9997dedddb38852ca611fee446714 100644
--- a/tests/ghc-regress/ghc-api/apirecomp001/Makefile
+++ b/tests/ghc-regress/ghc-api/apirecomp001/Makefile
@@ -6,6 +6,6 @@ clean:
 	rm -f *.o *.hi
 
 apirecomp001: clean
-	'$(TEST_HC)' --make -v0 -package ghc myghc.hs
-	./myghc "`'$(TEST_HC)' --print-libdir | tr -d '\r'`"
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make -v0 -package ghc myghc.hs
+	./myghc "`'$(TEST_HC)' $(TEST_HC_OPTS) --print-libdir | tr -d '\r'`"
 
diff --git a/tests/ghc-regress/ghc-e/should_run/Makefile b/tests/ghc-regress/ghc-e/should_run/Makefile
index 69162da4c50c769fdd371435bc472c27582730b0..844363959bcd4d41ba6df5bf02ecc83f46e82282 100644
--- a/tests/ghc-regress/ghc-e/should_run/Makefile
+++ b/tests/ghc-regress/ghc-e/should_run/Makefile
@@ -3,27 +3,27 @@ include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
 ghc-e001:
-	'$(TEST_HC)' -ignore-dot-ghci -e "return ()"
+	'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "return ()"
 
 ghc-e002:
-	'$(TEST_HC)' -ignore-dot-ghci -e ":main" ghc-e002.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":main" ghc-e002.hs
 
 ghc-e003:
-	'$(TEST_HC)' -ignore-dot-ghci -e 'putStrLn "Foo"' -e 'putStrLn "Bar"'
+	'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e 'putStrLn "Foo"' -e 'putStrLn "Bar"'
 
 ghc-e004:
-	'$(TEST_HC)' -ignore-dot-ghci -e ":m + System.Exit" -e "exitWith (ExitFailure 6)"; echo $$?
+	'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":m + System.Exit" -e "exitWith (ExitFailure 6)"; echo $$?
 
 # This is what runghc does:
 ghc-e005:
-	'$(TEST_HC)' -ignore-dot-ghci -main-is foo ghc-e005.hs -e ":set prog ghc-e005-prog" -e ":main [\"the\",\"args\"]"; echo $$?
+	'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -main-is foo ghc-e005.hs -e ":set prog ghc-e005-prog" -e ":main [\"the\",\"args\"]"; echo $$?
 
 2228:
-	'$(TEST_HC)' -ignore-dot-ghci -e ":main" 2228.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":main" 2228.hs
 
 2636:
-	'$(TEST_HC)' -ignore-dot-ghci -e ":main" 2636.hs; if [ "$?" != 0 ]; then true; else false; fi
+	'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":main" 2636.hs; if [ "$?" != 0 ]; then true; else false; fi
 
 3890:
-	'$(TEST_HC)' -ignore-dot-ghci -e ":main" 3890.hs | cat
+	'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":main" 3890.hs | cat
 
diff --git a/tests/ghc-regress/ghci/prog004/Makefile b/tests/ghc-regress/ghci/prog004/Makefile
index 509ed6c1166a1f4de2878da065eb9eadb4436f02..9ee437437a539cb9af1240bc6a7087d997a7f8db 100644
--- a/tests/ghc-regress/ghci/prog004/Makefile
+++ b/tests/ghc-regress/ghci/prog004/Makefile
@@ -7,5 +7,5 @@ include $(TOP)/mk/test.mk
 ghciprog004:
 	rm -f ctest.o
 	echo "int foo(){}" >ctest.c
-	'$(TEST_HC)' -optc-g -c ctest.c
-	echo ":q" | '$(TEST_HC)' -v0 --interactive -ignore-dot-ghci ctest.o
+	'$(TEST_HC)' $(TEST_HC_OPTS) -optc-g -c ctest.c
+	echo ":q" | '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --interactive -ignore-dot-ghci ctest.o
diff --git a/tests/ghc-regress/ghci/scripts/Makefile b/tests/ghc-regress/ghci/scripts/Makefile
index bf9d5b3715d2a78a15c3145ab2d4731942d12f21..4d012898e0f5d184dc7d6557f15026a1af827aab 100644
--- a/tests/ghc-regress/ghci/scripts/Makefile
+++ b/tests/ghc-regress/ghci/scripts/Makefile
@@ -5,29 +5,29 @@ include $(TOP)/mk/test.mk
 ghci024:
 	@echo "~~~~~~~~~~ Testing :set"
 	printf ":set\n" \
-	    | '$(TEST_HC)' --interactive -v0 -ignore-dot-ghci \
+	    | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci \
 	    | grep -E "^([^ ]|  -fno-print-explicit-foralls|  -fno-warn-implicit-prelude)"
 	@echo "~~~~~~~~~~ Testing :show languages"
 	printf ":show languages\n" \
-	    | '$(TEST_HC)' --interactive -v0 -ignore-dot-ghci \
+	    | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci \
 	    | grep -E "^([^ ]|  -XImplicitPrelude|  -XMagicHash)"
 	@echo "~~~~~~~~~~ Testing :show languages, with -XMagicHash"
 	printf ":set -XMagicHash\n:show languages\n" \
-	    | '$(TEST_HC)' --interactive -v0 -ignore-dot-ghci \
+	    | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci \
 	    | grep -E "^([^ ]|  -XImplicitPrelude|  -XMagicHash)"
 	@echo "~~~~~~~~~~ Testing :show packages"
 	printf ":show packages\n" \
-	    | '$(TEST_HC)' --interactive -v0 -ignore-dot-ghci \
+	    | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci \
 	    | grep -E "^([^ ]|  -package|base|ghc-prim|integer|rts|Cabal)" \
 	    | sed "s/Cabal-[0-9.]*/Cabal-VERSION/"
 	@echo "~~~~~~~~~~ Testing :show packages, including the ghc package"
 	printf ":set -package ghc\n:show packages\n" \
-	    | '$(TEST_HC)' --interactive -v0 -ignore-dot-ghci \
+	    | '$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci \
 	    | grep -E "^([^ ]|  -package|base|ghc-prim|integer|rts|Cabal)" \
 	    | sed "s/Cabal-[0-9.]*/Cabal-VERSION/"
 
 .PHONY: ghci037
 ghci037:
-	'$(TEST_HC)' --interactive -v0 -ignore-dot-ghci                   < ghci037.script
-	'$(TEST_HC)' --interactive -v0 -ignore-dot-ghci -fno-ghci-sandbox < ghci037.script
+	'$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci                   < ghci037.script
+	'$(TEST_HC)' $(TEST_HC_OPTS) --interactive -v0 -ignore-dot-ghci -fno-ghci-sandbox < ghci037.script
 
diff --git a/tests/ghc-regress/ghci/should_run/Makefile b/tests/ghc-regress/ghci/should_run/Makefile
index 123af3427222a3ba08cdd7492c8b5b3b4c69a4d5..f2d6ad70705392903bb1d69597fd7ed0a081469e 100644
--- a/tests/ghc-regress/ghci/should_run/Makefile
+++ b/tests/ghc-regress/ghci/should_run/Makefile
@@ -5,5 +5,5 @@ include $(TOP)/mk/test.mk
 # Test that threadDelay can be interrupted by ^C.
 3171:
 	echo "do Control.Concurrent.threadDelay 3000000; putStrLn \"threadDelay was not interrupted\"" | \
-	"$(TEST_HC)" -ignore-dot-ghci -v0 --interactive 2>3171.err & \
+	"$(TEST_HC)" $(TEST_HC_OPTS) -ignore-dot-ghci -v0 --interactive 2>3171.err & \
 	sleep 2; kill -INT $$!; wait
diff --git a/tests/ghc-regress/hsc2hs/Makefile b/tests/ghc-regress/hsc2hs/Makefile
index ed0061b3119b683e24faeaeabb5136b0f8d2d06b..7b2dcdef1248a88a7cb2f29f2f20be222cb5bed1 100644
--- a/tests/ghc-regress/hsc2hs/Makefile
+++ b/tests/ghc-regress/hsc2hs/Makefile
@@ -8,9 +8,9 @@ ALL_TESTS = hsc2hs001 hsc2hs002
 
 $(ALL_TESTS):
 	'$(HSC2HS)' $@.hsc
-	'$(TEST_HC)' -c $@.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c $@.hs
 
 .PHONY: 3837
 3837:
 	LANG=C '$(HSC2HS)' $@.hsc
-	'$(TEST_HC)' -c $@.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c $@.hs
diff --git a/tests/ghc-regress/indexed-types/should_compile/Makefile b/tests/ghc-regress/indexed-types/should_compile/Makefile
index 03724682996c40cf0e5918c9c0835b63727ca100..b91348f154afb6ad81d67828caf7e77c594570bc 100644
--- a/tests/ghc-regress/indexed-types/should_compile/Makefile
+++ b/tests/ghc-regress/indexed-types/should_compile/Makefile
@@ -4,12 +4,12 @@ include $(TOP)/mk/test.mk
 
 NewTyCo:
 	$(RM) NewTyCo1.o NewTyCo1.hi NewTyCo2.o NewTyCo2.hi
-	'$(TEST_HC)' -c NewTyCo1.hs
-	'$(TEST_HC)' -c NewTyCo2.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c NewTyCo1.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c NewTyCo2.hs
 
 .PHONY: IndTypesPerf
 IndTypesPerf:
 	$(RM) IndTypesPerf.o IndTypesPerf.hi
 	$(RM) IndTypesPerfMerge.o IndTypesPerfMerge.hi
-	'$(TEST_HC)' -O -c IndTypesPerfMerge.hs +RTS -M20M
-	'$(TEST_HC)' -O -c IndTypesPerf.hs      +RTS -M20M
+	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c IndTypesPerfMerge.hs +RTS -M20M
+	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c IndTypesPerf.hs      +RTS -M20M
diff --git a/tests/ghc-regress/layout/Makefile b/tests/ghc-regress/layout/Makefile
index 16f94f9f7cdeb237e0183cad9c23b5fd66154e4a..87e467fd8591e192112038f6e115f725e23174d0 100644
--- a/tests/ghc-regress/layout/Makefile
+++ b/tests/ghc-regress/layout/Makefile
@@ -5,11 +5,11 @@ include $(TOP)/mk/test.mk
 layout001 layout002 layout003 layout004 layout005 layout006 layout007 layout008 layout009: %:
 	$(RM) $*.hi $*.o
 	echo Running with -XNoAlternativeLayoutRule
-	-"$(TEST_HC)" -v0 -XNoAlternativeLayoutRule -c $*.hs 2>&1
+	-"$(TEST_HC)" $(TEST_HC_OPTS) -v0 -XNoAlternativeLayoutRule -c $*.hs 2>&1
 	$(RM) $*.hi $*.o
 	echo Running with -XAlternativeLayoutRule
-	-"$(TEST_HC)" -v0 -XAlternativeLayoutRule -c $*.hs 2>&1
+	-"$(TEST_HC)" $(TEST_HC_OPTS) -v0 -XAlternativeLayoutRule -c $*.hs 2>&1
 	$(RM) $*.hi $*.o
 	echo Running with -XAlternativeLayoutRule -XAlternativeLayoutRuleTransitional
-	-"$(TEST_HC)" -v0 -XAlternativeLayoutRule -XAlternativeLayoutRuleTransitional -c $*.hs 2>&1
+	-"$(TEST_HC)" $(TEST_HC_OPTS) -v0 -XAlternativeLayoutRule -XAlternativeLayoutRuleTransitional -c $*.hs 2>&1
 
diff --git a/tests/ghc-regress/lib/IO/Makefile b/tests/ghc-regress/lib/IO/Makefile
index e56738236fcc2048bef249364ebf5c3fddd8275f..0ad81226e1d03164a9297a0ee793447958999444 100644
--- a/tests/ghc-regress/lib/IO/Makefile
+++ b/tests/ghc-regress/lib/IO/Makefile
@@ -3,11 +3,11 @@ include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
 test.concio001:
-	@$(TEST_HC) --make -fforce-recomp -v0 concio001 -o concio001 
+	@$(TEST_HC) $(TEST_HC_OPTS) --make -fforce-recomp -v0 concio001 -o concio001 
 	@(sleep 1; echo x) | ./concio001
 
 test.concio001.thr:
-	@$(TEST_HC) --make -fforce-recomp -v0 -threaded concio001 -o concio001 
+	@$(TEST_HC) $(TEST_HC_OPTS) --make -fforce-recomp -v0 -threaded concio001 -o concio001 
 	@(sleep 1; echo x) | ./concio001
 
 # NB. utf8-test should *not* have a final newline.  The last char should be 'X'.
diff --git a/tests/ghc-regress/module/Makefile b/tests/ghc-regress/module/Makefile
index 34568480b5c51c2a1ceb69b62a4e52d725fbe4d8..1b85f61c6287633938a7a981bced8f913fca5498 100644
--- a/tests/ghc-regress/module/Makefile
+++ b/tests/ghc-regress/module/Makefile
@@ -10,8 +10,8 @@ include $(TOP)/mk/test.mk
 
 mod144::
 	rm -f Mod144_A.o Mod144_A.hi mod144.o mod144.hi mod144
-	'$(TEST_HC)' -c Mod144_A.hs
-	'$(TEST_HC)' -c mod144.hs || echo "exit($$?)" 1>&2
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c Mod144_A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c mod144.hs || echo "exit($$?)" 1>&2
 
 # These tests share some source files, so to avoid clashing when
 # using multiple threads we direct the outputs to different files
@@ -22,49 +22,49 @@ AUX_OPTS = -osuf $(AUX_O) -hisuf $(AUX_HI)
 
 mod146::
 	rm -f Mod145_A.$(AUX_O) Mod145_A.$(AUX_HI) mod146.$(AUX_O) mod146.$(AUX_HI) mod146
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod145_A.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c mod146.hs || echo "exit($$?)" 1>&2
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod145_A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c mod146.hs || echo "exit($$?)" 1>&2
 
 mod158::
 	rm -f Mod157_*.$(AUX_O) Mod157_*.$(AUX_HI)
 	rm -f mod158.$(AUX_O) mod158.$(AUX_HI) mod158
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod157_A.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod157_B.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod157_C.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod157_D.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c mod158.hs || echo "exit($$?)" 1>&2
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod157_A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod157_B.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod157_C.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod157_D.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c mod158.hs || echo "exit($$?)" 1>&2
 
 mod160::
 	rm -f Mod159_*.$(AUX_O)
 	rm -f Mod159_*.$(AUX_HI)
 	rm -f mod160.$(AUX_O) mod160.$(AUX_HI) mod160
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod159_A.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod159_B.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod159_C.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod159_D.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c mod160.hs || echo "exit($$?)" 1>&2
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod159_A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod159_B.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod159_C.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod159_D.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c mod160.hs || echo "exit($$?)" 1>&2
 
 mod165::
 	rm -f Mod164_*.$(AUX_O)
 	rm -f Mod164_*.$(AUX_HI)
 	rm -f mod165.$(AUX_O) mod165.$(AUX_HI) mod165
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod164_A.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod164_B.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c mod165.hs || echo "exit($$?)" 1>&2
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod164_A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod164_B.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c mod165.hs || echo "exit($$?)" 1>&2
 
 mod166::
 	rm -f Mod164_*.$(AUX_O)
 	rm -f Mod164_*.$(AUX_HI)
 	rm -f mod166.$(AUX_O) mod166.$(AUX_HI) mod166
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod164_A.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod164_B.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c mod166.hs || echo "exit($$?)" 1>&2
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod164_A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod164_B.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c mod166.hs || echo "exit($$?)" 1>&2
 
 mod167::
 	rm -f Mod164_*.$(AUX_O)
 	rm -f Mod164_*.$(AUX_HI)
 	rm -f mod167.$(AUX_O) mod167.$(AUX_HI) mod167
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod164_A.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c Mod164_B.hs
-	'$(TEST_HC)' $(AUX_OPTS) -c mod167.hs || echo "exit($$?)" 1>&2
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod164_A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c Mod164_B.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(AUX_OPTS) -c mod167.hs || echo "exit($$?)" 1>&2
 
diff --git a/tests/ghc-regress/module/base01/Makefile b/tests/ghc-regress/module/base01/Makefile
index 205805a73388aa0d20c2c26d8777793716017230..1f6273c33059d11d7bc1f215424d2cb02570ed04 100644
--- a/tests/ghc-regress/module/base01/Makefile
+++ b/tests/ghc-regress/module/base01/Makefile
@@ -9,6 +9,6 @@ clean:
 base01:
 	rm -f GHC/*.o
 	rm -f GHC/*.hi
-	'$(TEST_HC)' -XNoImplicitPrelude -package-name base -c GHC/Base.hs
-	'$(TEST_HC)' -XNoImplicitPrelude -package-name base --make GHC.Foo
+	'$(TEST_HC)' $(TEST_HC_OPTS) -XNoImplicitPrelude -package-name base -c GHC/Base.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -XNoImplicitPrelude -package-name base --make GHC.Foo
 
diff --git a/tests/ghc-regress/module/mod175/Makefile b/tests/ghc-regress/module/mod175/Makefile
index 92f1ccbc49aaad5669b7394f57af09e1aa15d1f6..7bba7d202653430d1bc14b8bf2f3e18eec908edf 100644
--- a/tests/ghc-regress/module/mod175/Makefile
+++ b/tests/ghc-regress/module/mod175/Makefile
@@ -12,8 +12,8 @@ clean:
 
 mod175:
 	$(MAKE) clean
-	'$(TEST_HC)' -v0 --make -main-is Test.main  Test.hs  -o test
-	'$(TEST_HC)' -v0 --make -main-is Test2.main Test2.hs -o test2
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make -main-is Test.main  Test.hs  -o test
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make -main-is Test2.main Test2.hs -o test2
 	./test
 	./test2
 
diff --git a/tests/ghc-regress/perf/compiler/Makefile b/tests/ghc-regress/perf/compiler/Makefile
index 969164f3fcd05694271ced4a5e5db31d75fbc883..b0c937b23024bf5b88e5df645c6563c4514470bb 100644
--- a/tests/ghc-regress/perf/compiler/Makefile
+++ b/tests/ghc-regress/perf/compiler/Makefile
@@ -5,5 +5,5 @@ include $(TOP)/mk/test.mk
 .PHONY: T4007
 T4007:
 	$(RM) -f T4007.hi T4007.o
-	'$(TEST_HC)' -c -O -ddump-rule-firings T4007.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O -ddump-rule-firings T4007.hs
 
diff --git a/tests/ghc-regress/perf/should_run/Makefile b/tests/ghc-regress/perf/should_run/Makefile
index 3e0bdb1f7a4b6f2f4a39df20846bf526475a7dec..67a9432a529f38b5623a1ab759d7d8af8589bee7 100644
--- a/tests/ghc-regress/perf/should_run/Makefile
+++ b/tests/ghc-regress/perf/should_run/Makefile
@@ -8,7 +8,7 @@ endef
 .PHONY: T3736
 T3736:
 	$(RM) -f T3736.hi T3736.o T3736
-	'$(TEST_HC)' -v0 -O --make T3736 -rtsopts
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -O --make T3736 -rtsopts
 # Check ALLOC1 is > 100 just to check with have sane results, and if so,
 # the test passes if the two numbers are equal. We could check that the
 # actual numbers are in the range we expect too (on the various
@@ -22,15 +22,15 @@ T2902:
 	$(RM) -f T2902_A.o  T2902_B.o
 	$(RM) -f T2902_A_PairingSum.hi T2902_B_PairingSum.hi T2902_Sum.hi
 	$(RM) -f T2902_A_PairingSum.o  T2902_B_PairingSum.o  T2902_Sum.o
-	'$(TEST_HC)' -v0 -O --make T2902_A -rtsopts
-	'$(TEST_HC)' -v0 -O --make T2902_B -rtsopts
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -O --make T2902_A -rtsopts
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -O --make T2902_B -rtsopts
 	BAA=`./T2902_A +RTS -t --machine-readable 2>&1 | grep '"bytes allocated"' | sed -e 's/.*, "//' -e 's/")//'`; BAB=`./T2902_B +RTS -t --machine-readable 2>&1 | grep '"bytes allocated"' | sed -e 's/.*, "//' -e 's/")//'`; [ "$$BAA" = "" ] && echo 'T2902_A: No "bytes allocated"'; [ "$$BAA" = "$$BAB" ] || echo "T2902: Mismatch in \"bytes allocated\": $$BAA $$BAB"
 
 .PHONY: T149
 T149:
 	$(RM) -f T149_A T149_A.hi T149_A.o
 	$(RM) -f T149_B T149_B.hi T149_B.o
-	'$(TEST_HC)' -v0 -O --make T149_A -rtsopts
-	'$(TEST_HC)' -v0 -O --make T149_B -rtsopts
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -O --make T149_A -rtsopts
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -O --make T149_B -rtsopts
 	BAA=`./T149_A +RTS -t --machine-readable 2>&1 | grep '"bytes allocated"' | sed -e 's/.*, "//' -e 's/")//'`; BAB=`./T149_B +RTS -t --machine-readable 2>&1 | grep '"bytes allocated"' | sed -e 's/.*, "//' -e 's/")//'`; [ "$$BAA" = "" ] && echo 'T149_A: No "bytes allocated"'; [ "$$BAA" = "$$BAB" ] || echo "T149: Mismatch in \"bytes allocated\": $$BAA $$BAB"
 
diff --git a/tests/ghc-regress/profiling/should_run/Makefile b/tests/ghc-regress/profiling/should_run/Makefile
index f4ce9353d3f7d229c98aec2881a943cf18d2f3f6..8e1f611bda392c6fa9cd5fe259d60a94139653a1 100644
--- a/tests/ghc-regress/profiling/should_run/Makefile
+++ b/tests/ghc-regress/profiling/should_run/Makefile
@@ -11,7 +11,7 @@ endef
 define scc001Rule
 	rm -f scc001.hi scc001.o scc001
 	@echo Compiling with $1
-	'$(TEST_HC)' -v0 --make scc001 -prof -auto-all -rtsopts $1
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make scc001 -prof -auto-all -rtsopts $1
 	./scc001 +RTS -p
 	$(call scc001Test,f)
 	$(call scc001Test,g)
diff --git a/tests/ghc-regress/quasiquotation/Makefile b/tests/ghc-regress/quasiquotation/Makefile
index 636ea4e581792d2314ab2e74f7bea3254b8af499..96a01ba5bcf14891fd8cb82c0945b9922c0dee35 100644
--- a/tests/ghc-regress/quasiquotation/Makefile
+++ b/tests/ghc-regress/quasiquotation/Makefile
@@ -6,6 +6,6 @@ include $(TOP)/mk/test.mk
 
 T4150:
 	$(RM) T4150A.hi T4150A.o T4150.hi T4150.o
-	'$(TEST_HC)' -v0 -c T4150A.hs
-	-'$(TEST_HC)' -v0 -c T4150.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -c T4150A.hs
+	-'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -c T4150.hs
 
diff --git a/tests/ghc-regress/rename/prog006/Makefile b/tests/ghc-regress/rename/prog006/Makefile
index 9ceaa39737a84e99c6819e3027b0f2b38b8a10c5..765779b1eb5cb6bde8f8b13eba32557baedf2352 100644
--- a/tests/ghc-regress/rename/prog006/Makefile
+++ b/tests/ghc-regress/rename/prog006/Makefile
@@ -19,8 +19,8 @@ LOCAL_PKGCONF=local.package.conf
 LOCAL_GHC_PKG = '$(GHC_PKG)' --no-user-package-conf -f $(LOCAL_PKGCONF)
 
 rn.prog006:
-	'$(TEST_HC)' --make pwd -v0
-	'$(TEST_HC)' --make -package-name test-1.0 B.C -fforce-recomp -v0
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make pwd -v0
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make -package-name test-1.0 B.C -fforce-recomp -v0
 	rm -f pkg.conf
 	echo "name: test" >>pkg.conf
 	echo "version: 1.0" >>pkg.conf
@@ -29,9 +29,9 @@ rn.prog006:
 	echo "exposed-modules: B.C" >>pkg.conf
 	echo "[]" >$(LOCAL_PKGCONF)
 	$(LOCAL_GHC_PKG) register pkg.conf -v0
-	'$(TEST_HC)' -c -package-conf $(LOCAL_PKGCONF) -package test -fforce-recomp A.hs -i
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -package-conf $(LOCAL_PKGCONF) -package test -fforce-recomp A.hs -i
 # The -i clears the search path, so A.hs will find B.C from package test
-	-'$(TEST_HC)' -c -package-conf $(LOCAL_PKGCONF) -package test -fforce-recomp Main.hs
+	-'$(TEST_HC)' $(TEST_HC_OPTS) -c -package-conf $(LOCAL_PKGCONF) -package test -fforce-recomp Main.hs
 # No -i when compiling Main, so a from-scratch search would find a home-pkg module B.C
 # However, A.hi remembers that B.C came from package test, so all is ok.
 
diff --git a/tests/ghc-regress/rename/should_compile/Makefile b/tests/ghc-regress/rename/should_compile/Makefile
index 1a20ea1c0fd3c30c0047f790115e9703a6cfc0ff..36fc785f7f3a7ec275096a5d1e7e77f8436fa2e8 100644
--- a/tests/ghc-regress/rename/should_compile/Makefile
+++ b/tests/ghc-regress/rename/should_compile/Makefile
@@ -4,41 +4,41 @@ include $(TOP)/mk/test.mk
 
 T1792_imports:
 	$(RM) T1792_imports.hi T1792_imports.o T1792_imports.imports
-	'$(TEST_HC)' -ddump-minimal-imports -c T1792_imports.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -ddump-minimal-imports -c T1792_imports.hs
 	cat T1792_imports.imports
 
 T3823:
 	$(RM) T3823A.hi-boot T3823A.hi T3823B.hi
 	$(RM) T3823A.o-boot  T3823A.o  T3823B.o
-	-'$(TEST_HC)' -v0 --make T3823A.hs
+	-'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make T3823A.hs
 
 T4003:
 	$(RM) T4003A.hi-boot T4003A.hi T4003B.hi
 	$(RM) T4003A.o-boot  T4003A.o  T4003B.o
-	'$(TEST_HC)' -O -c T4003A.hs-boot
-	'$(TEST_HC)' -O -c T4003B.hs
-	'$(TEST_HC)' -O -c T4003A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T4003A.hs-boot
+	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T4003B.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T4003A.hs
 
 T3449:
 	$(RM) T3449.hi-boot T3449.hi T3449A.hi
 	$(RM) T3449.o-boot  T3449.o  T3449A.o
-	'$(TEST_HC)' -Wall -c T3449.hs-boot
-	'$(TEST_HC)' -Wall -c T3449A.hs
-	'$(TEST_HC)' -Wall -c T3449.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -Wall -c T3449.hs-boot
+	'$(TEST_HC)' $(TEST_HC_OPTS) -Wall -c T3449A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -Wall -c T3449.hs
 
 T4239:
 	$(RM) T4239A.hi T4239A.o
 	$(RM) T4239.hi  T4239.o T4239.imports
-	'$(TEST_HC)' -c T4239A.hs
-	'$(TEST_HC)' -c T4239.hs -ddump-minimal-imports
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c T4239A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c T4239.hs -ddump-minimal-imports
 	cat T4239.imports
 
 T4240:
 	$(RM) T4240A.hi T4240A.o
 	$(RM) T4240B.hi T4240B.o
 	$(RM) T4240.hi  T4240.o T4240.imports
-	'$(TEST_HC)' -c T4240A.hs
-	'$(TEST_HC)' -c T4240B.hs
-	'$(TEST_HC)' -c T4240.hs -ddump-minimal-imports
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c T4240A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c T4240B.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c T4240.hs -ddump-minimal-imports
 	cat T4240.imports
 
diff --git a/tests/ghc-regress/rts/Makefile b/tests/ghc-regress/rts/Makefile
index 5899cd3495fd2145ce09a28a7f2bcf54a1f80454..72b0658b4cf420931085fdfe85e5e4a26fd03179 100644
--- a/tests/ghc-regress/rts/Makefile
+++ b/tests/ghc-regress/rts/Makefile
@@ -3,14 +3,14 @@ include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
 outofmem-prep::
-	'$(TEST_HC)' --make -fforce-recomp outofmem.hs -o outofmem
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make -fforce-recomp outofmem.hs -o outofmem
 
 outofmem::
 	@$(MAKE) outofmem-prep >prep.out 2>prep.out
 	@ulimit -v 10000000 2>/dev/null; ./outofmem || echo "exit($$?)"
 
 outofmem2-prep::
-	'$(TEST_HC)' -rtsopts --make -fforce-recomp outofmem2.hs -o outofmem2
+	'$(TEST_HC)' $(TEST_HC_OPTS) -rtsopts --make -fforce-recomp outofmem2.hs -o outofmem2
 
 outofmem2::
 	@$(MAKE) outofmem2-prep >prep.out 2>prep.out
@@ -18,13 +18,13 @@ outofmem2::
 
 T2615-prep:
 	$(RM) libfoo_T2615.so
-	'$(TEST_HC)' -fPIC -c libfoo_T2615.c -o libfoo_T2615.o
-	'$(TEST_HC)' -shared -no-auto-link-packages libfoo_T2615.o -o libfoo_T2615.so
+	'$(TEST_HC)' $(TEST_HC_OPTS) -fPIC -c libfoo_T2615.c -o libfoo_T2615.o
+	'$(TEST_HC)' $(TEST_HC_OPTS) -shared -no-auto-link-packages libfoo_T2615.o -o libfoo_T2615.so
 
 .PHONY: T4059
 T4059:
 	$(RM) 4059_c.o 4059.o 4059.hi
-	'$(TEST_HC)' -v0 --make 4059 4059_c.c
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make 4059 4059_c.c
 	./4059
 
 exec_signals-prep:
@@ -34,5 +34,5 @@ exec_signals-prep:
 .PHONY: 4850
 4850:
 	$(RM) 4850.o 4850.hi 4850$(exeext)
-	"$(TEST_HC)" -v0 -rtsopts -debug -threaded --make 4850
+	"$(TEST_HC)" $(TEST_HC_OPTS) -v0 -rtsopts -debug -threaded --make 4850
 	./4850 +RTS -s 2>&1 | grep Task | wc -l | tr -d ' '
diff --git a/tests/ghc-regress/simplCore/should_compile/Makefile b/tests/ghc-regress/simplCore/should_compile/Makefile
index 606150707206e6fb6f5e67729cc6b06621f83db9..03d372f16b9429b7f6190e20cc36a556f85f9aa3 100644
--- a/tests/ghc-regress/simplCore/should_compile/Makefile
+++ b/tests/ghc-regress/simplCore/should_compile/Makefile
@@ -4,45 +4,45 @@ include $(TOP)/mk/test.mk
 
 T3055:
 	$(RM) -f T3055.o T3055.hi T3055.simpl
-	'$(TEST_HC)' -O -c T3055.hs -ddump-simpl > T3055.simpl
+	'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T3055.hs -ddump-simpl > T3055.simpl
 	grep 'I# (-28)' T3055.simpl | sed 's/.*\(I# (-28)\).*/\1/'
 
 T3772:
 	$(RM) -f T3772*.hi T3772*.o
-	'$(TEST_HC)' -c -O T3772_A.hs 
-	'$(TEST_HC)' -c -O T3772.hs -dsuppress-uniques -ddump-simpl
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T3772_A.hs 
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T3772.hs -dsuppress-uniques -ddump-simpl
 
 T4306:
 	$(RM) -f T4306.hi T4306.o
-	'$(TEST_HC)' -c -O T4306.hs 
-	'$(TEST_HC)' --show-iface T4306.hi | grep 'wupd ::'
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4306.hs 
+	'$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4306.hi | grep 'wupd ::'
 
 T4201:
 	$(RM) -f T4201.hi T4201.o
-	'$(TEST_HC)' -c -O T4201.hs 
-	'$(TEST_HC)' --show-iface T4201.hi | grep 'Unfolding.*sym'
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4201.hs 
+	'$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4201.hi | grep 'Unfolding.*sym'
 
 # This one looped as a result of bogus specialisation
 T4903:
 	$(RM) -f T4903a.o T4903.o
-	'$(TEST_HC)' -c -O T4903a.hs -dcore-lint
-	'$(TEST_HC)' -c -O T4903.hs -dcore-lint
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4903a.hs -dcore-lint
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4903.hs -dcore-lint
 
 T4918:
 	$(RM) -f T4918.hi T4918.o T4918a.hi T4918a.o
-	'$(TEST_HC)' -c -O T4918a.hs 
-	'$(TEST_HC)' -c -O T4918.hs 
-	'$(TEST_HC)' --show-iface T4918.hi | grep 'C#'
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4918a.hs 
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4918.hs 
+	'$(TEST_HC)' $(TEST_HC_OPTS) --show-iface T4918.hi | grep 'C#'
 
 EvalTest:
-	'$(TEST_HC)' -c -O EvalTest.hs -ddump-simpl -dsuppress-uniques | grep 'rght.*Dmd'
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -O EvalTest.hs -ddump-simpl -dsuppress-uniques | grep 'rght.*Dmd'
 
 # When SpecConstr works there are no STUArrays at all
 # The "-(...)" ignores the (expected) non-zero exit code from grep
 # when there are (as expected) no matches
 T4945:
-	-('$(TEST_HC)' -c -O2 -fno-liberate-case T4945.hs -ddump-simpl -dsuppress-uniques | grep 'STUArray')
+	-('$(TEST_HC)' $(TEST_HC_OPTS) -c -O2 -fno-liberate-case T4945.hs -ddump-simpl -dsuppress-uniques | grep 'STUArray')
 
 # When this one works there are no 'lets' at all
 T4957:
-	-('$(TEST_HC)' -c -O T4957.hs -ddump-simpl -dsuppress-uniques | grep 'let')
+	-('$(TEST_HC)' $(TEST_HC_OPTS) -c -O T4957.hs -ddump-simpl -dsuppress-uniques | grep 'let')
diff --git a/tests/ghc-regress/th/2014/Makefile b/tests/ghc-regress/th/2014/Makefile
index a0ddccd5f059a52a85db743ce45eb50d894abb08..862ea725d60ceb68df872ab7c758c3ec51bc2411 100644
--- a/tests/ghc-regress/th/2014/Makefile
+++ b/tests/ghc-regress/th/2014/Makefile
@@ -3,7 +3,7 @@ include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/test.mk
 
 2014 :
-	'$(TEST_HC)' -fforce-recomp -c A.hs-boot
-	'$(TEST_HC)' -fforce-recomp -c A.hs
-	'$(TEST_HC)' -fforce-recomp -c B.hs
-	'$(TEST_HC)' -fforce-recomp -c C.hs -v0
+	'$(TEST_HC)' $(TEST_HC_OPTS) -fforce-recomp -c A.hs-boot
+	'$(TEST_HC)' $(TEST_HC_OPTS) -fforce-recomp -c A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -fforce-recomp -c B.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -fforce-recomp -c C.hs -v0
diff --git a/tests/ghc-regress/th/Makefile b/tests/ghc-regress/th/Makefile
index 7fd310e7179c11e28a25d6d2b2619a441a106cf2..e8b4c2d177809876750e12d13a640fc342790fd3 100644
--- a/tests/ghc-regress/th/Makefile
+++ b/tests/ghc-regress/th/Makefile
@@ -5,15 +5,15 @@ include $(TOP)/mk/test.mk
 # Trac 2386 requires batch-compile not --make
 # Very important: without -O 
 T2386:
-	'$(TEST_HC)' -v0 -c T2386_Lib.hs -fforce-recomp
-	'$(TEST_HC)' -v0 -c T2386.hs -fforce-recomp
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -c T2386_Lib.hs -fforce-recomp
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -c T2386.hs -fforce-recomp
 
 
 HC_OPTS = -XTemplateHaskell -package template-haskell
 
 TH_spliceE5_prof::
 	$(RM) TH_spliceE5_prof*.o TH_spliceE5_prof*.hi TH_spliceE5_prof*.p_o 
-	'$(TEST_HC)' $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -c
-	'$(TEST_HC)' $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -prof -auto-all -osuf p_o -o $@
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -c
+	'$(TEST_HC)' $(TEST_HC_OPTS) $(HC_OPTS) --make -v0 TH_spliceE5_prof.hs -prof -auto-all -osuf p_o -o $@
 	./$@
 
diff --git a/tests/ghc-regress/th/TH_recompile/Makefile b/tests/ghc-regress/th/TH_recompile/Makefile
index 29e96ad1632b823c4f073ed2b0681e5c17543e71..9e717bd223cfbbe40747493bd5fcd2a884879446 100644
--- a/tests/ghc-regress/th/TH_recompile/Makefile
+++ b/tests/ghc-regress/th/TH_recompile/Makefile
@@ -14,9 +14,9 @@ clean:
 TH_recompile:
 	$(MAKE) clean
 	cp Sub1.hs Sub.hs
-	'$(TEST_HC)' -v0 --make -XTemplateHaskell Main.hs -o test
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make -XTemplateHaskell Main.hs -o test
 	cp Sub2.hs Sub.hs
-	'$(TEST_HC)' -v0 --make -XTemplateHaskell Main.hs -o test2
+	'$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make -XTemplateHaskell Main.hs -o test2
 	./test
 	./test2
 
diff --git a/tests/ghc-regress/typecheck/bug1465/Makefile b/tests/ghc-regress/typecheck/bug1465/Makefile
index 77c2a7bdd8dc25fec335da5b33fe2ae0e8522512..a5b535d453b11227ea8df59def71044e3cf6f726 100644
--- a/tests/ghc-regress/typecheck/bug1465/Makefile
+++ b/tests/ghc-regress/typecheck/bug1465/Makefile
@@ -16,15 +16,15 @@ clean:
 bug1465:
 	$(MAKE) clean
 	$(MAKE) prep
-	'$(TEST_HC)' -package-conf $(LOCAL_PKGCONF) -c C.hs || exit 0
+	'$(TEST_HC)' $(TEST_HC_OPTS) -package-conf $(LOCAL_PKGCONF) -c C.hs || exit 0
 	$(MAKE) clean
 
 prep:
 	echo "[]" >$(LOCAL_PKGCONF)
 	$(MAKE) prep.v1
 	$(MAKE) prep.v2
-	'$(TEST_HC)' -package-conf $(LOCAL_PKGCONF) -c -package $(PKG)-1.0 B1.hs
-	'$(TEST_HC)' -package-conf $(LOCAL_PKGCONF) -c -package $(PKG)-2.0 B2.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -package-conf $(LOCAL_PKGCONF) -c -package $(PKG)-1.0 B1.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -package-conf $(LOCAL_PKGCONF) -c -package $(PKG)-2.0 B2.hs
 
 prep.%:
 	cd $* && '$(TEST_HC)' -v0 --make -o setup Setup.hs
diff --git a/tests/ghc-regress/typecheck/should_compile/Makefile b/tests/ghc-regress/typecheck/should_compile/Makefile
index 7a67ad57c1f270595b68978f5f61f6bb1cd90936..81ab165c9c461d3a96e3c234a4aefcc2ca737ed0 100644
--- a/tests/ghc-regress/typecheck/should_compile/Makefile
+++ b/tests/ghc-regress/typecheck/should_compile/Makefile
@@ -4,23 +4,23 @@ include $(TOP)/mk/test.mk
 
 tc170:
 	$(RM) Tc170_Aux.hi Tc170_Aux.o tc170.hi tc170.o
-	'$(TEST_HC)' -c Tc170_Aux.hs
-	'$(TEST_HC)' -c tc170.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c Tc170_Aux.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c tc170.hs
 
 tc173:
 	$(RM) Tc173a.o Tc173a.hi Tc173b.o Tc173b.hi
-	'$(TEST_HC)' -c -XFlexibleInstances -XTypeSynonymInstances -XUndecidableInstances -XOverlappingInstances Tc173a.hs
-	'$(TEST_HC)' -c -XUndecidableInstances -XOverlappingInstances Tc173b.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -XFlexibleInstances -XTypeSynonymInstances -XUndecidableInstances -XOverlappingInstances Tc173a.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c -XUndecidableInstances -XOverlappingInstances Tc173b.hs
 
 T2412:
 	$(RM) -f T2412.hi-boot T2412.o-boot T2412A.hi T2412A.o T2412.hi T2412.o
-	'$(TEST_HC)' -c T2412.hs-boot
-	'$(TEST_HC)' -c T2412A.hs
-	'$(TEST_HC)' -c T2412.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c T2412.hs-boot
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c T2412A.hs
+	'$(TEST_HC)' $(TEST_HC_OPTS) -c T2412.hs
 
 tc245:
 	$(RM) -f Tc245_A.hi Tc245_A.o tc245.hi tc245.o
-	'$(TEST_HC)' --make tc245
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make tc245
 	$(RM) -f tc245.hi tc245.o
-	'$(TEST_HC)' --make tc245
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make tc245