diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2011-07-18 09:12:43 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2011-07-18 09:12:43 +0100 |
commit | baf3b5124c34b0eeb1c9064cf6aea1ee1e255c36 (patch) | |
tree | 0ad9943853bf9464542b084cc3d917a2c9d9602b | |
parent | 3101c496c137648d610186c848a3c838064f3758 (diff) | |
parent | 2d0540a673737521fd5f322b8b9b616ecde6f129 (diff) | |
download | haskell-baf3b5124c34b0eeb1c9064cf6aea1ee1e255c36.tar.gz |
Merge branch 'master' of http://darcs.haskell.org/testsuite
4 files changed, 20 insertions, 3 deletions
diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/CheckB.hs b/testsuite/tests/ghc-regress/safeHaskell/check/CheckB.hs index f690aab368..7e649a1598 100644 --- a/testsuite/tests/ghc-regress/safeHaskell/check/CheckB.hs +++ b/testsuite/tests/ghc-regress/safeHaskell/check/CheckB.hs @@ -3,7 +3,7 @@ -- Since Safe we require base package be trusted to compile module CheckB where -import CheckA +import CheckB_Aux mainM :: Int -> Int mainM n = trace "Allowed Leak" $ n * 2 diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/CheckB.stderr b/testsuite/tests/ghc-regress/safeHaskell/check/CheckB.stderr index 64acb2418b..f8321b3704 100644 --- a/testsuite/tests/ghc-regress/safeHaskell/check/CheckB.stderr +++ b/testsuite/tests/ghc-regress/safeHaskell/check/CheckB.stderr @@ -1,2 +1,2 @@ -[1 of 2] Compiling CheckA ( CheckA.hs, CheckA.o ) +[1 of 2] Compiling CheckB_Aux ( CheckB_Aux.hs, CheckB_Aux.o ) [2 of 2] Compiling CheckB ( CheckB.hs, CheckB.o ) diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/CheckB_Aux.hs b/testsuite/tests/ghc-regress/safeHaskell/check/CheckB_Aux.hs new file mode 100644 index 0000000000..c04d5102d7 --- /dev/null +++ b/testsuite/tests/ghc-regress/safeHaskell/check/CheckB_Aux.hs @@ -0,0 +1,15 @@ +{-# LANGUAGE Trustworthy #-} +module CheckB_Aux ( + trace + ) where + +import qualified Debug.Trace as D +import qualified Data.ByteString.Lazy.Char8 as BS + +-- | Allowed declasification +trace :: String -> a -> a +trace s = D.trace $ s ++ show a3 + +a3 :: BS.ByteString +a3 = BS.take 3 $ BS.repeat 'a' + diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/all.T b/testsuite/tests/ghc-regress/safeHaskell/check/all.T index 2c705b1646..2e769ba1aa 100644 --- a/testsuite/tests/ghc-regress/safeHaskell/check/all.T +++ b/testsuite/tests/ghc-regress/safeHaskell/check/all.T @@ -5,7 +5,9 @@ def f( opts ): setTestOpts(f) test('CheckA', normal, compile, ['']) -test('CheckB', normal, multimod_compile, ['CheckB', '-trust base']) +test('CheckB', + extra_clean(['CheckB_Aux.hi', 'CheckB_Aux.o']), + multimod_compile, ['CheckB', '-trust base']) # fail as we don't trust base when compiling Check01 test('Check01', normal, multi_compile_fail, ['Check01', [ |