Commit 8e6e0222 authored by thomie's avatar thomie

Testsuite: Introduce config.plugin_way_flags.

Refactoring only.
parent 116528c8
......@@ -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"
......@@ -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
......
# 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'])],
......
# 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',
......
......@@ -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',
......
......@@ -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'),
......
......@@ -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.
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment