diff options
-rw-r--r-- | testsuite/config/ghc | 4 | ||||
-rw-r--r-- | testsuite/mk/boilerplate.mk | 13 | ||||
-rw-r--r-- | testsuite/tests/annotations/should_compile/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/annotations/should_compile/th/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/annotations/should_run/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/plugins/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/simplCore/should_compile/all.T | 2 | ||||
-rw-r--r-- | testsuite/tests/th/all.T | 3 |
8 files changed, 24 insertions, 6 deletions
diff --git a/testsuite/config/ghc b/testsuite/config/ghc index 63488ddde1..31b644a2b4 100644 --- a/testsuite/config/ghc +++ b/testsuite/config/ghc @@ -203,18 +203,22 @@ def get_compiler_info(): # GHC < 7.7 doesn't have a "GHC Dynamic" field ghcDynamic = False + # See Note [WayFlags] if ghcDynamic: config.ghc_th_way_flags = "-dynamic" config.ghci_way_flags = "-dynamic" + config.plugin_way_flags = "-dynamic" config.ghc_th_way = "dyn" config.ghc_plugin_way = "dyn" elif config.compiler_profiled: config.ghc_th_way_flags = "-prof" config.ghci_way_flags = "-prof" + config.plugin_way_flags = "-prof" config.ghc_th_way = "prof" config.ghc_plugin_way = "prof" else: config.ghc_th_way_flags = "-static" config.ghci_way_flags = "-static" + config.plugin_way_flags = "-static" config.ghc_th_way = "normal" config.ghc_plugin_way = "normal" diff --git a/testsuite/mk/boilerplate.mk b/testsuite/mk/boilerplate.mk index b51cc89944..077d5031e1 100644 --- a/testsuite/mk/boilerplate.mk +++ b/testsuite/mk/boilerplate.mk @@ -247,6 +247,19 @@ ifeq "$(findstring clean,$(MAKECMDGOALS))" "" include $(ghc-config-mk) endif +# Note [WayFlags] +# +# Code that uses TemplateHaskell should either use -fexternal-interpreter, or +# be built in the same way as the compiler (-prof, -dynamic or -static). +# +# We therefore add those flags to ghcThWayFlags and ghc_th_way_flags here and +# in testsuite/config/ghc, and use them in all tests that use TemplateHaskell. +# +# The same applies to code loaded in regular GHCi, and code that uses the +# plugin system. +# +# See #11495 and TEST=TH_spliceE5_prof for a complication: trying to compile +# code that uses TemplateHaskell with -prof, while GhcDynamic=YES. ifeq "$(GhcDynamic)" "YES" ghcThWayFlags = -dynamic ghciWayFlags = -dynamic diff --git a/testsuite/tests/annotations/should_compile/all.T b/testsuite/tests/annotations/should_compile/all.T index 57efc2634c..d8d6ad876b 100644 --- a/testsuite/tests/annotations/should_compile/all.T +++ b/testsuite/tests/annotations/should_compile/all.T @@ -1,6 +1,6 @@ # Annotations, like Template Haskell, require runtime evaluation. In # order for this to work with profiling, we would have to build the -# program twice and use -osuf p_o (see the TH_splitE5_prof test). For +# program twice and use -osuf p_o (see the TH_spliceE5_prof test). For # now, just disable the profiling ways. test('ann01', [req_interp, omit_ways(['profasm','profthreaded'])], diff --git a/testsuite/tests/annotations/should_compile/th/all.T b/testsuite/tests/annotations/should_compile/th/all.T index a1681cfe0b..8684de2367 100644 --- a/testsuite/tests/annotations/should_compile/th/all.T +++ b/testsuite/tests/annotations/should_compile/th/all.T @@ -1,6 +1,6 @@ # Annotations and Template Haskell, require runtime evaluation. In # order for this to work with profiling, we would have to build the -# program twice and use -osuf p_o (see the TH_splitE5_prof test). For +# program twice and use -osuf p_o (see the TH_spliceE5_prof test). For # now, just disable the profiling ways. test('annth_make', diff --git a/testsuite/tests/annotations/should_run/all.T b/testsuite/tests/annotations/should_run/all.T index 183ff97bcc..17f16313a9 100644 --- a/testsuite/tests/annotations/should_run/all.T +++ b/testsuite/tests/annotations/should_run/all.T @@ -3,7 +3,7 @@ setTestOpts(when(fast(), skip)) # Annotations, like Template Haskell, require runtime evaluation. In # order for this to work with profiling, we would have to build the -# program twice and use -osuf p_o (see the TH_splitE5_prof test). For +# program twice and use -osuf p_o (see the TH_spliceE5_prof test). For # now, just disable the profiling and dynamic ways, and use # config.ghc_th_way_flags. test('annrun01', diff --git a/testsuite/tests/plugins/all.T b/testsuite/tests/plugins/all.T index 189e519fed..7cf412c260 100644 --- a/testsuite/tests/plugins/all.T +++ b/testsuite/tests/plugins/all.T @@ -13,7 +13,7 @@ test('plugins02', [pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins02'), clean_cmd('$MAKE -s --no-print-directory -C simple-plugin clean.plugins02')], compile_fail, - ['-package-db simple-plugin/pkg.plugins02/local.package.conf -fplugin Simple.BadlyTypedPlugin -package simple-plugin ' + config.ghci_way_flags]) + ['-package-db simple-plugin/pkg.plugins02/local.package.conf -fplugin Simple.BadlyTypedPlugin -package simple-plugin ' + config.plugin_way_flags]) test('plugins03', [pre_cmd('$MAKE -s --no-print-directory -C simple-plugin package.plugins03'), diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T index 803e34493e..6c0380fac0 100644 --- a/testsuite/tests/simplCore/should_compile/all.T +++ b/testsuite/tests/simplCore/should_compile/all.T @@ -179,7 +179,7 @@ test('T7702', [(wordsize(32), 18, 70), (wordsize(64), 18, 70)]) ], compile, - ['-v0 -package-db T7702plugin/pkg.T7702/local.package.conf -fplugin T7702Plugin -package T7702plugin ' + config.ghci_way_flags]) + ['-v0 -package-db T7702plugin/pkg.T7702/local.package.conf -fplugin T7702Plugin -package T7702plugin ' + config.plugin_way_flags]) test('T7995', # RULE doesn't seem to fire unless optimizations are turned on. diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T index 5b72ba0faa..c39136bc94 100644 --- a/testsuite/tests/th/all.T +++ b/testsuite/tests/th/all.T @@ -38,7 +38,8 @@ test('TH_NestedSplices', multimod_compile, ['TH_NestedSplices.hs', '-v0 ' + config.ghc_th_way_flags]) -# Testing profiling with TH is a bit tricky; we've already disabled +# Testing profiling with TH is a bit tricky (when not using +# -fexternal-interpreter); we've already disabled # the prof way above, and also we want to add options specifically for # profiling (-osuf p.o) because this is necessary when mixing # profiling w/ TH. Furthermore we must have built the program the |