[commit: ghc] master: Testsuite: Introduce config.plugin_way_flags. (8e6e022)
git at git.haskell.org
git at git.haskell.org
Thu Feb 25 22:24:53 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/8e6e022216b19b10841a896ee1a0b08e019a9481/ghc
>---------------------------------------------------------------
commit 8e6e022216b19b10841a896ee1a0b08e019a9481
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date: Thu Feb 25 01:00:48 2016 +0100
Testsuite: Introduce config.plugin_way_flags.
Refactoring only.
>---------------------------------------------------------------
8e6e022216b19b10841a896ee1a0b08e019a9481
testsuite/config/ghc | 4 ++++
testsuite/mk/boilerplate.mk | 13 +++++++++++++
testsuite/tests/annotations/should_compile/all.T | 2 +-
testsuite/tests/annotations/should_compile/th/all.T | 2 +-
testsuite/tests/annotations/should_run/all.T | 2 +-
testsuite/tests/plugins/all.T | 2 +-
testsuite/tests/simplCore/should_compile/all.T | 2 +-
testsuite/tests/th/all.T | 3 ++-
8 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/testsuite/config/ghc b/testsuite/config/ghc
index 63488dd..31b644a 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 b51cc89..077d503 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 57efc26..d8d6ad8 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 a1681cf..8684de2 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 183ff97..17f1631 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 189e519..7cf412c 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 803e344..6c0380f 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 5b72ba0..c39136b 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
More information about the ghc-commits
mailing list