diff options
author | Ian Lynagh <igloo@earth.li> | 2008-08-25 14:15:17 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2008-08-25 14:15:17 +0000 |
commit | 2c5e45682e3838e26a91de8f6b0371ca95b8f23f (patch) | |
tree | 1ada0429ee9a0b1b3bafaee5d7cd9c44561cd6be /testsuite/tests/ghc-regress/th | |
parent | 18cb779568bdfd0cbab267fdcb9720040d2e5990 (diff) | |
download | haskell-2c5e45682e3838e26a91de8f6b0371ca95b8f23f.tar.gz |
Fix TH_spliceE5 in the parallel testsuite
Diffstat (limited to 'testsuite/tests/ghc-regress/th')
-rw-r--r-- | testsuite/tests/ghc-regress/th/TH_spliceE5_prof.hs | 16 | ||||
-rw-r--r-- | testsuite/tests/ghc-regress/th/TH_spliceE5_prof_Lib.hs | 11 | ||||
-rw-r--r-- | testsuite/tests/ghc-regress/th/all.T | 12 |
3 files changed, 34 insertions, 5 deletions
diff --git a/testsuite/tests/ghc-regress/th/TH_spliceE5_prof.hs b/testsuite/tests/ghc-regress/th/TH_spliceE5_prof.hs new file mode 100644 index 0000000000..d56c3ab681 --- /dev/null +++ b/testsuite/tests/ghc-regress/th/TH_spliceE5_prof.hs @@ -0,0 +1,16 @@ +{-# OPTIONS -fglasgow-exts #-} + +module Main where + +import TH_spliceE5_prof_Lib + +v1 = "foo" + +main = putStrLn $(expandVars ["v1","v2"]) +-- The splice expands to refer to both v1 and v2, +-- and the test checks that we don't dependency-analyse +-- the program so that one or the other isn't in scope +-- to the type checker + + +v2 = "bar" diff --git a/testsuite/tests/ghc-regress/th/TH_spliceE5_prof_Lib.hs b/testsuite/tests/ghc-regress/th/TH_spliceE5_prof_Lib.hs new file mode 100644 index 0000000000..627f117876 --- /dev/null +++ b/testsuite/tests/ghc-regress/th/TH_spliceE5_prof_Lib.hs @@ -0,0 +1,11 @@ +{-# OPTIONS -fglasgow-exts #-} + +module TH_spliceE5_prof_Lib where + +import Language.Haskell.TH + +expandVars :: [String] -> Q Exp +expandVars s = [| concat $(return (ListE (map f s))) |] + where + f x = VarE (mkName x) + diff --git a/testsuite/tests/ghc-regress/th/all.T b/testsuite/tests/ghc-regress/th/all.T index af4a73786f..9b1a62d0e6 100644 --- a/testsuite/tests/ghc-regress/th/all.T +++ b/testsuite/tests/ghc-regress/th/all.T @@ -20,7 +20,10 @@ test('TH_repGuard', normal, compile, ['-v0']) test('TH_repGuardOutput', normal, compile_and_run, ['']) test('TH_repPatSig', normal, compile_fail, ['']) -test('TH_spliceE5', normal, multimod_compile_and_run, ['TH_spliceE5.hs', '-v0']) +test('TH_spliceE5', + extra_clean(['TH_spliceE5_Lib.hi', 'TH_spliceE5_Lib.o']), + multimod_compile_and_run, + ['TH_spliceE5.hs', '-v0']) # Testing profiling with TH is a bit tricky; 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 @@ -29,11 +32,10 @@ test('TH_spliceE5', normal, multimod_compile_and_run, ['TH_spliceE5.hs', '-v0']) test('TH_spliceE5_prof', [req_profiling, omit_ways(['ghci']), - extra_clean(['TH_spliceE5_Lib.p_o', 'TH_spliceE5_Lib.hi', - 'TH_spliceE5_Lib.o', - 'TH_spliceE5.hi', 'TH_spliceE5.p_o'])], + extra_clean(['TH_spliceE5_prof_Lib.p_o', 'TH_spliceE5_prof_Lib.hi', + 'TH_spliceE5_prof_Lib.o'])], multimod_compile_and_run, - ['TH_spliceE5.hs', '-v0 -prof -auto-all -osuf p_o']) + ['TH_spliceE5_prof.hs', '-v0 -prof -auto-all -osuf p_o']) test('TH_spliceD1', extra_clean(['TH_spliceD1_Lib.hi', 'TH_spliceD1_Lib.o']), |