diff options
Diffstat (limited to 'testsuite/tests/ghc-regress/safeHaskell')
126 files changed, 0 insertions, 1307 deletions
diff --git a/testsuite/tests/ghc-regress/safeHaskell/Makefile b/testsuite/tests/ghc-regress/safeHaskell/Makefile deleted file mode 100644 index 9101fbd40a..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check01.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check01.hs deleted file mode 100644 index bd018acb50..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check01.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE SafeImports #-} -module Check01 ( main' ) where - -import safe Check01_B - -main' = do - let n = mainM 1 - print $ n - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check01.stderr b/testsuite/tests/ghc-regress/safeHaskell/check/Check01.stderr deleted file mode 100644 index 70722f32b8..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check01.stderr +++ /dev/null @@ -1,4 +0,0 @@ -[3 of 3] Compiling Check01 ( Check01.hs, Check01.o ) - -<no location info>: - The package (base) is required to be trusted but it isn't! diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check01_A.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check01_A.hs deleted file mode 100644 index 8b318a5124..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check01_A.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# LANGUAGE Trustworthy #-} -module Check01_A ( - 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/Check01_B.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check01_B.hs deleted file mode 100644 index b584e51b97..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check01_B.hs +++ /dev/null @@ -1,10 +0,0 @@ -{-# LANGUAGE Safe #-} - --- Since Safe we require base package be trusted to compile -module Check01_B where - -import Check01_A - -mainM :: Int -> Int -mainM n = trace "Allowed Leak" $ n * 2 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check02.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check02.hs deleted file mode 100644 index 3f15cb4ba9..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check02.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE SafeImports #-} -module Check02 ( main' ) where - -import safe Check02_B - -main' = do - let n = mainM 1 - print $ n - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check02.stderr b/testsuite/tests/ghc-regress/safeHaskell/check/Check02.stderr deleted file mode 100644 index 708541b8ed..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check02.stderr +++ /dev/null @@ -1 +0,0 @@ -[3 of 3] Compiling Check02 ( Check02.hs, Check02.o ) diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check02_A.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check02_A.hs deleted file mode 100644 index d43dab727a..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check02_A.hs +++ /dev/null @@ -1,16 +0,0 @@ -{-# LANGUAGE Trustworthy #-} -module Check02_A ( - 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/Check02_B.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check02_B.hs deleted file mode 100644 index 10d45ccfbb..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check02_B.hs +++ /dev/null @@ -1,10 +0,0 @@ -{-# LANGUAGE Safe #-} - --- Since Safe we require base package be trusted to compile -module Check02_B where - -import Check02_A - -mainM :: Int -> Int -mainM n = trace "Allowed Leak" $ n * 2 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check03.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check03.hs deleted file mode 100644 index e06b4f83fb..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check03.hs +++ /dev/null @@ -1,8 +0,0 @@ -module Check03 where - -import Check03_B - -mainN = do - let n = mainM 1 - print $ n - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check03.stderr b/testsuite/tests/ghc-regress/safeHaskell/check/Check03.stderr deleted file mode 100644 index 343803f6ff..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check03.stderr +++ /dev/null @@ -1 +0,0 @@ -[3 of 3] Compiling Check03 ( Check03.hs, Check03.o ) diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check03_A.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check03_A.hs deleted file mode 100644 index e7b8d75d03..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check03_A.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# LANGUAGE Trustworthy #-} -module Check03_A ( - 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/Check03_B.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check03_B.hs deleted file mode 100644 index bce45af4e5..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check03_B.hs +++ /dev/null @@ -1,10 +0,0 @@ -{-# LANGUAGE Safe #-} - --- Since Safe we require base package be trusted to compile -module Check03_B where - -import Check03_A - -mainM :: Int -> Int -mainM n = trace "Allowed Leak" $ n * 2 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check04.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check04.hs deleted file mode 100644 index 9891de36ee..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check04.hs +++ /dev/null @@ -1,7 +0,0 @@ -{-# LANGUAGE SafeImports #-} -module Main ( main ) where - -import Check04_1 - -main = main' - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check04.stderr b/testsuite/tests/ghc-regress/safeHaskell/check/Check04.stderr deleted file mode 100644 index ec3bdb1585..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check04.stderr +++ /dev/null @@ -1,2 +0,0 @@ -[4 of 4] Compiling Main ( Check04.hs, Check04.o ) -Linking Check04 ... diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check04_1.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check04_1.hs deleted file mode 100644 index e823c889d6..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check04_1.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE SafeImports #-} -module Check04_1 ( main' ) where - -import safe Check04_B - -main' = do - let n = mainM 1 - print $ n - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/Check04_A.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check04_A.hs deleted file mode 100644 index 3f6b5f00e9..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check04_A.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# LANGUAGE Trustworthy #-} -module Check04_A ( - 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/Check04_B.hs b/testsuite/tests/ghc-regress/safeHaskell/check/Check04_B.hs deleted file mode 100644 index 5280c51fad..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Check04_B.hs +++ /dev/null @@ -1,10 +0,0 @@ -{-# LANGUAGE Safe #-} - --- Since Safe we require base package be trusted to compile -module Check04_B where - -import Check04_A - -mainM :: Int -> Int -mainM n = trace "Allowed Leak" $ n * 2 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/CheckA.hs b/testsuite/tests/ghc-regress/safeHaskell/check/CheckA.hs deleted file mode 100644 index 80f9ae4ee0..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/CheckA.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# LANGUAGE Trustworthy #-} -module CheckA ( - 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/CheckB.hs b/testsuite/tests/ghc-regress/safeHaskell/check/CheckB.hs deleted file mode 100644 index 7e649a1598..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/CheckB.hs +++ /dev/null @@ -1,10 +0,0 @@ -{-# LANGUAGE Safe #-} - --- Since Safe we require base package be trusted to compile -module CheckB where - -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 deleted file mode 100644 index f8321b3704..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/CheckB.stderr +++ /dev/null @@ -1,2 +0,0 @@ -[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 deleted file mode 100644 index c04d5102d7..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/CheckB_Aux.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# 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/Makefile b/testsuite/tests/ghc-regress/safeHaskell/check/Makefile deleted file mode 100644 index 9ce1411567..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk
\ No newline at end of file diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/all.T b/testsuite/tests/ghc-regress/safeHaskell/check/all.T deleted file mode 100644 index 2e769ba1aa..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/all.T +++ /dev/null @@ -1,38 +0,0 @@ -# Just do the normal way, SafeHaskell is all in the frontend -def f( opts ): - opts.only_ways = ['normal'] - -setTestOpts(f) - -test('CheckA', normal, compile, ['']) -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', [ - ('Check01_A.hs', ''), - ('Check01_B.hs', '-trust base') - ], '']) - -# suceed this time since we trust base when we compile AND use CheckB -test('Check02', normal, multi_compile, ['Check02', [ - ('Check02_A.hs', ''), - ('Check02_B.hs', '') - ], '-trust base']) - -# suceed as while like Check01_fail we don't import CheckB as a safe -# import this time, so don't require base trusted when used. -test('Check03', normal, multi_compile, ['Check03', [ - ('Check03_A.hs', ''), - ('Check03_B.hs', '-trust base') - ], '']) - -# Check a slightly larger transitive program. Check01 isn't imported -# safely by Check03 so we don't require base trused at end. -test('Check04', normal, multi_compile, ['Check04', [ - ('Check04_A.hs', ''), - ('Check04_B.hs', '-trust base'), - ('Check04_1.hs', '-trust base') - ], '']) - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafe01.hs b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafe01.hs deleted file mode 100644 index deb0d57f8d..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafe01.hs +++ /dev/null @@ -1,12 +0,0 @@ -{-# LANGUAGE Safe #-} -{-# LANGUAGE NoImplicitPrelude #-} -module ImpSafe ( MyWord ) where - --- While Data.Word is safe it imports trustworthy --- modules in base, hence base needs to be trusted. --- Note: Worthwhile giving out better error messages for cases --- like this if I can. -import Data.Word - -type MyWord = Word - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafe01.stderr b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafe01.stderr deleted file mode 100644 index 9ca2bbe817..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafe01.stderr +++ /dev/null @@ -1,3 +0,0 @@ - -ImpSafe01.hs:9:1: - base:Data.Word can't be safely imported! The package (base) the module resides in isn't trusted. diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafeOnly01.hs b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafeOnly01.hs deleted file mode 100644 index 2143d3139b..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafeOnly01.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE Safe #-} -module Main where - -import M_SafePkg - -main = do - putStrLn $ show bigInt - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafeOnly02.hs b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafeOnly02.hs deleted file mode 100644 index 27281b9cce..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafeOnly02.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE Safe #-} -module Main where - -import M_SafePkg2 - -main = do - putStrLn $ show bigInt - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafeOnly03.hs b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafeOnly03.hs deleted file mode 100644 index d09e39937d..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafeOnly03.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE Safe #-} -module Main where - -import M_SafePkg3 - -main = do - putStrLn $ show bigInt - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafeOnly03.stderr b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafeOnly03.stderr deleted file mode 100644 index bc6eecffee..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/ImpSafeOnly03.stderr +++ /dev/null @@ -1,3 +0,0 @@ - -ImpSafeOnly03.hs:4:1: - safePkg01-1.0:M_SafePkg3 can't be safely imported! The package (safePkg01-1.0) the module resides in isn't trusted. diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/M_SafePkg.hs b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/M_SafePkg.hs deleted file mode 100644 index 14c21132e7..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/M_SafePkg.hs +++ /dev/null @@ -1,6 +0,0 @@ -{-# LANGUAGE Safe #-} -module M_SafePkg where - -bigInt :: Int -bigInt = 9 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/M_SafePkg2.hs b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/M_SafePkg2.hs deleted file mode 100644 index 74c263f61d..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/M_SafePkg2.hs +++ /dev/null @@ -1,6 +0,0 @@ -{-# LANGUAGE Trustworthy #-} -module M_SafePkg2 where - -bigInt :: Int -bigInt = 9 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/M_SafePkg3.hs b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/M_SafePkg3.hs deleted file mode 100644 index 67714c4731..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/M_SafePkg3.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE Safe #-} -module M_SafePkg3 where - -import qualified M_SafePkg2 as M2 - -bigInt :: Int -bigInt = M2.bigInt - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/M_SafePkg4.hs b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/M_SafePkg4.hs deleted file mode 100644 index 52367b113b..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/M_SafePkg4.hs +++ /dev/null @@ -1,11 +0,0 @@ -{-# LANGUAGE Safe #-} -module M_SafePkg4 where - -import qualified M_SafePkg3 as M3 -import Data.Word - -bigInt :: Int -bigInt = M3.bigInt - -type MyWord = Word - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/Makefile b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/Makefile deleted file mode 100644 index 1c979a14d5..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -TOP=../../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk - -clean: - rm -rf setup a.out - rm -rf dist - find . -name "*.o" | xargs rm -f - find . -name "*.hi" | xargs rm -f - rm -rf local.db - rm -rf install - -# We use the global package database as there's no easy way to tell -# ghc-pkg (via Cabal) to use one in ., and the global one at least -# won't affect the installed GHC and is more likely to work - -PREFIX := $(abspath install) -$(eval $(call canonicalise,PREFIX)) - -PKGCONF = local.db -LGHC_PKG = '$(GHC_PKG)' --no-user-package-conf -f '$(PKGCONF)' - -safePkg01: - '$(MAKE)' clean - '$(TEST_HC)' --make -o setup Setup.hs -v0 - - '$(GHC_PKG)' init local.db - ./setup configure -v0 --prefix='$(PREFIX)' --with-compiler='$(TEST_HC)' --ghc-options='$(TEST_HC_OPTS) -trust base' --with-hc-pkg='$(GHC_PKG)' --package-db='$(PKGCONF)' $(PROF) - ./setup build -v0 - ./setup copy -v0 - ./setup register --inplace -v0 - $(LGHC_PKG) list - $(LGHC_PKG) field safePkg01-1.0 trusted - echo - echo 'M_SafePkg' - '$(TEST_HC)' --show-iface dist/build/M_SafePkg.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:' - echo - echo 'M_SafePkg2' - '$(TEST_HC)' --show-iface dist/build/M_SafePkg2.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:' - echo - echo 'M_SafePkg3' - '$(TEST_HC)' --show-iface dist/build/M_SafePkg3.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:' - echo - echo 'M_SafePkg4' - '$(TEST_HC)' --show-iface dist/build/M_SafePkg4.hi | grep -E '^package dependencies:|^trusted:|^require own pkg trusted:' - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/Setup.hs b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/Setup.hs deleted file mode 100644 index 6479cb1c16..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/Setup.hs +++ /dev/null @@ -1,4 +0,0 @@ -import Distribution.Simple - -main = defaultMain - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/all.T b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/all.T deleted file mode 100644 index bdbdc4c56d..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/all.T +++ /dev/null @@ -1,24 +0,0 @@ -# Just do the normal way, SafeHaskell is all in the frontend -def f( opts ): - opts.only_ways = ['normal'] - -setTestOpts(f) - -if config.have_profiling: - prof = '--enable-library-profiling' -else: - prof = '' - -test('safePkg01', - [normal, alone], - run_command, - ['$MAKE -s --no-print-directory safePkg01 PROF=' + prof]) - -test('ImpSafe01', normal, compile_fail, ['']) - -test('ImpSafeOnly01', [normal, alone], compile, ['-package-conf local.db -trust base']) - -test('ImpSafeOnly02', [normal, alone], compile, ['-package-conf local.db -trust base -trust safePkg01']) - -test('ImpSafeOnly03', [normal, alone], compile_fail, ['-package-conf local.db -trust base']) - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/p.cabal b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/p.cabal deleted file mode 100644 index f6d84b5f8a..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/p.cabal +++ /dev/null @@ -1,15 +0,0 @@ -Name: safePkg01 -Version: 1.0 -Description: SafeHaskell Test Package -License: BSD3 -Build-Type: Simple - -Library { - Build-Depends: base >= 4 - Exposed-Modules: - M_SafePkg - M_SafePkg2 - M_SafePkg3 - M_SafePkg4 -} - diff --git a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/safePkg01.stdout b/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/safePkg01.stdout deleted file mode 100644 index c1a5642c17..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/check/pkg01/safePkg01.stdout +++ /dev/null @@ -1,24 +0,0 @@ -local.db: - safePkg01-1.0 - -trusted: False - -M_SafePkg -package dependencies: base* ghc-prim integer-gmp -trusted: safe -require own pkg trusted: False - -M_SafePkg2 -package dependencies: base ghc-prim integer-gmp -trusted: trustworthy -require own pkg trusted: False - -M_SafePkg3 -package dependencies: base* ghc-prim integer-gmp -trusted: safe -require own pkg trusted: True - -M_SafePkg4 -package dependencies: base* ghc-prim integer-gmp -trusted: safe -require own pkg trusted: True diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/Flags01.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/Flags01.hs deleted file mode 100644 index 0e1d120a81..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/Flags01.hs +++ /dev/null @@ -1,11 +0,0 @@ -{-# LANGUAGE CPP #-} - --- | CPP should still be allowed -module Main where - -#include "Flags01_A.cpp" - -#define mainn main=putStrLn str - -mainn - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/Flags01_A.cpp b/testsuite/tests/ghc-regress/safeHaskell/flags/Flags01_A.cpp deleted file mode 100644 index 9170664236..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/Flags01_A.cpp +++ /dev/null @@ -1,3 +0,0 @@ -str :: String -str = "Hello World" - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/Flags02.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/Flags02.hs deleted file mode 100644 index 525064dedf..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/Flags02.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# OPTIONS_GHC -pgmlc pgmlc, -pgmdll pgmdll, -I., -L., -Uggg, -Dggg, -with-rtsopts full #-} - --- | These are all flags that should be allowed -module Flags02 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/Makefile b/testsuite/tests/ghc-regress/safeHaskell/flags/Makefile deleted file mode 100644 index 9ce1411567..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk
\ No newline at end of file diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags01.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags01.hs deleted file mode 100644 index f5790eba64..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags01.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE Safe #-} - --- | Basic test to see if Safe flags compiles -module SafeFlags01 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags02.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags02.hs deleted file mode 100644 index 50a1101bd4..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags02.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE Trustworthy #-} - --- | Basic test to see if Safe flags compiles -module SafeFlags02 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags03.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags03.hs deleted file mode 100644 index ea83a06210..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags03.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE SafeImports #-} - --- | Basic test to see if Safe flags compiles -module SafeFlags03 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags04.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags04.hs deleted file mode 100644 index b966eba1a0..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags04.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE SafeLanguage #-} - --- | Basic test to see if Safe flags compiles -module SafeFlags04 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags04.stderr b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags04.stderr deleted file mode 100644 index 2a550f25a1..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags04.stderr +++ /dev/null @@ -1,2 +0,0 @@ - -SafeFlags04.hs:1:14: Unsupported extension: SafeLanguage diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags05.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags05.hs deleted file mode 100644 index 0f316d475b..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags05.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE Safe, SafeImports #-} - --- | Basic test to see if Safe flags compiles -module SafeFlags05 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags06.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags06.hs deleted file mode 100644 index 81fd3257ae..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags06.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE Trustworthy, SafeImports #-} - --- | Basic test to see if Safe flags compiles -module SafeFlags06 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags07.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags07.hs deleted file mode 100644 index 0339fe362f..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags07.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE SafeLanguage, SafeImports #-} - --- | Basic test to see if Safe flags compiles -module SafeFlags07 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags07.stderr b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags07.stderr deleted file mode 100644 index 3c3317f20c..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags07.stderr +++ /dev/null @@ -1,2 +0,0 @@ - -SafeFlags07.hs:1:14: Unsupported extension: SafeLanguage diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags08.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags08.hs deleted file mode 100644 index 445e591b1e..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags08.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE SafeLanguage, Trustworthy #-} - --- | Basic test to see if Safe flags compiles -module SafeFlags08 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags08.stderr b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags08.stderr deleted file mode 100644 index e72e6e459f..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags08.stderr +++ /dev/null @@ -1,2 +0,0 @@ - -SafeFlags08.hs:1:14: Unsupported extension: SafeLanguage diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags09.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags09.hs deleted file mode 100644 index d03b0dacbf..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags09.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE SafeLanguage, Safe #-} - --- | Basic test to see if Safe flags compiles -module SafeFlags09 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags09.stderr b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags09.stderr deleted file mode 100644 index 2bc5aed21c..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags09.stderr +++ /dev/null @@ -1,2 +0,0 @@ - -SafeFlags09.hs:1:14: Unsupported extension: SafeLanguage diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags10.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags10.hs deleted file mode 100644 index 43ba5c81cd..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags10.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE Safe, Trustworthy #-} - --- | Basic test to see if Safe flags compiles -module SafeFlags10 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags10.stderr b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags10.stderr deleted file mode 100644 index 86346b77fe..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags10.stderr +++ /dev/null @@ -1,2 +0,0 @@ -ghc-stage2: SafeFlags10.hs:1:20-30: Incompatible Safe Haskell flags! (Safe, Trustworthy) -Usage: For basic information, try the `--help' option. diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags11.hs b/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags11.hs deleted file mode 100644 index e90b105dde..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/SafeFlags11.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE Safe #-} -{-# LANGUAGE Safe #-} - --- | Basic test to see if Safe flags compiles -module SafeFlags11 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/flags/all.T b/testsuite/tests/ghc-regress/safeHaskell/flags/all.T deleted file mode 100644 index 7848b8328d..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/flags/all.T +++ /dev/null @@ -1,29 +0,0 @@ -# Just do the normal way, SafeHaskell is all in the frontend -def f( opts ): - opts.only_ways = ['normal'] - -setTestOpts(f) - -test('SafeFlags01', normal, compile, ['-trust base']) -test('SafeFlags02', normal, compile, ['']) -test('SafeFlags03', normal, compile, ['']) - -# no longer support a SafeLanguage flag, so expect fail for them. -test('SafeFlags04', normal, compile_fail, ['-trust base']) - -test('SafeFlags05', normal, compile, ['-trust base']) -test('SafeFlags06', normal, compile, ['']) - -# no longer support a SafeLanguage flag, so expect fail for them. -test('SafeFlags07', normal, compile_fail, ['-trust base']) - -# no longer support a SafeLanguage flag, so expect fail for them. -test('SafeFlags08', normal, compile_fail, ['-trust base']) -test('SafeFlags09', normal, compile_fail, ['']) - -test('SafeFlags10', normal, compile_fail, ['']) -test('SafeFlags11', normal, compile, ['-trust base']) - -test('Flags01', normal, compile, ['']) -test('Flags02', normal, compile, ['']) - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/Makefile b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/Makefile deleted file mode 100644 index 9ce1411567..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk
\ No newline at end of file diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang01.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang01.hs deleted file mode 100644 index 5920c03161..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang01.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE Safe, TemplateHaskell #-} - --- | Test SafeLanguage disables things -module SafeLang01 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang01.stderr b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang01.stderr deleted file mode 100644 index 18320eb727..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang01.stderr +++ /dev/null @@ -1,3 +0,0 @@ - -SafeLang01.hs:1:20: - Warning: XTemplateHaskell is not allowed in Safe Haskell; ignoring XTemplateHaskell diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang02.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang02.hs deleted file mode 100644 index 9bf1c82a09..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang02.hs +++ /dev/null @@ -1,8 +0,0 @@ -{-# LANGUAGE Safe, GeneralizedNewtypeDeriving #-} - --- | Test SafeLanguage disables things -module SafeLang02 where - -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang02.stderr b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang02.stderr deleted file mode 100644 index 6e3546968b..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang02.stderr +++ /dev/null @@ -1,3 +0,0 @@ - -<no location info>: - Warning: -XGeneralizedNewtypeDeriving is not allowed in Safe Haskell; ignoring -XGeneralizedNewtypeDeriving diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang03.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang03.hs deleted file mode 100644 index 4f3bce7e0a..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang03.hs +++ /dev/null @@ -1,10 +0,0 @@ -{-# LANGUAGE Safe #-} -{-# OPTIONS_GHC -fenable-rewrite-rules #-} - --- | Test SafeLanguage disables things -module SafeLang03 where - -{-# RULES "f" f = undefined #-} -f :: Int -f = 1 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang03.stderr b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang03.stderr deleted file mode 100644 index fdcc5997d5..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang03.stderr +++ /dev/null @@ -1,4 +0,0 @@ - -SafeLang03.hs:7:11: - Rule "f" ignored - User defined rules are disabled under Safe Haskell diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang04.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang04.hs deleted file mode 100644 index a9ac3619f3..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang04.hs +++ /dev/null @@ -1,32 +0,0 @@ -{-# OPTIONS_GHC -fenable-rewrite-rules #-} --- | Check rules work as normal without Safe -module Main where - -data T = T1 | T2 | T3 deriving ( Eq, Ord, Show ) - -lookupx :: Ord key => Show val => [(key,val)] -> key -> Maybe val -lookupx [] _ = Nothing -lookupx ((t,a):xs) t' | t == t' = Just a - | otherwise = lookupx xs t' - -{-# RULES "lookupx/T" lookupx = tLookup #-} -tLookup :: [(T,a)] -> T -> Maybe a -tLookup [] _ = Nothing -tLookup ((t,a):xs) t' | t /= t' = Just a - | otherwise = tLookup xs t' - -space = [(T1,"a"),(T2,"b"),(T3,"c")] -key = T3 - -main = do - putStrLn $ "looking for " ++ show key - putStrLn $ "in space " ++ show space - putStrLn $ "Found: " ++ show (fromMaybe "Not Found!" $ lookupx space key) - let b | Just "c" <- lookupx space key = "YES" - | otherwise = "NO" - putStrLn $ "Rules Disabled: " ++ b - -fromMaybe :: a -> Maybe a -> a -fromMaybe a Nothing = a -fromMaybe _ (Just a) = a - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang04.stdout b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang04.stdout deleted file mode 100644 index b80e6135bd..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang04.stdout +++ /dev/null @@ -1,4 +0,0 @@ -looking for T3 -in space [(T1,"a"),(T2,"b"),(T3,"c")] -Found: "a" -Rules Disabled: NO diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang05.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang05.hs deleted file mode 100644 index 1dd9016152..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang05.hs +++ /dev/null @@ -1,34 +0,0 @@ -{-# LANGUAGE Safe #-} -{-# OPTIONS_GHC -fenable-rewrite-rules #-} - --- | Check rules are disabled under Safe -module Main where - -data T = T1 | T2 | T3 deriving ( Eq, Ord, Show ) - -lookupx :: Ord key => Show val => [(key,val)] -> key -> Maybe val -lookupx [] _ = Nothing -lookupx ((t,a):xs) t' | t == t' = Just a - | otherwise = lookupx xs t' - -{-# RULES "lookupx/T" lookupx = tLookup #-} -tLookup :: [(T,a)] -> T -> Maybe a -tLookup [] _ = Nothing -tLookup ((t,a):xs) t' | t /= t' = Just a - | otherwise = tLookup xs t' - -space = [(T1,"a"),(T2,"b"),(T3,"c")] -key = T3 - -main = do - putStrLn $ "looking for " ++ show key - putStrLn $ "in space " ++ show space - putStrLn $ "Found: " ++ show (fromMaybe "Not Found!" $ lookupx space key) - let b | Just "c" <- lookupx space key = "YES" - | otherwise = "NO" - putStrLn $ "Rules Disabled: " ++ b - -fromMaybe :: a -> Maybe a -> a -fromMaybe a Nothing = a -fromMaybe _ (Just a) = a - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang05.stdout b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang05.stdout deleted file mode 100644 index 2334866860..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang05.stdout +++ /dev/null @@ -1,4 +0,0 @@ -looking for T3 -in space [(T1,"a"),(T2,"b"),(T3,"c")] -Found: "c" -Rules Disabled: YES diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06.hs deleted file mode 100644 index 685846f150..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06.hs +++ /dev/null @@ -1,40 +0,0 @@ -{-# LANGUAGE GeneralizedNewtypeDeriving #-} - --- Here we allow it to succeed (No SAFE) - --- | We use newtype to create an isomorphic type to Int --- with a reversed Ord dictionary. We now use the MinList --- API of Y1 to create a new MinList. Then we use newtype --- deriving to convert the newtype MinList to an Int --- MinList. This final result breaks the invariants of --- MinList which shouldn't be possible with the exposed --- API of Y1. -module Main where - -import SafeLang06_A - -class IntIso t where - intIso :: c t -> c Int - -instance IntIso Int where - intIso = id - -newtype Down a = Down a deriving (Eq, Show, IntIso) - -instance Ord a => Ord (Down a) where - compare (Down a) (Down b) = compare b a - -forceInt :: MinList Int -> MinList Int -forceInt = id - -a1, a2 :: MinList Int -a1 = foldl insertMinList (newMinList $ head nums) (tail nums) -a2 = forceInt $ intIso $ foldl (\x y -> insertMinList x $ Down y) (newMinList $ Down $ head nums) (tail nums) - -nums :: [Int] -nums = [1,4,0,1,-5,2,3,5,-1,2,0,0,-4,-3,9] - -main = do - printIntMinList a1 - printIntMinList a2 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06.stdout b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06.stdout deleted file mode 100644 index ed005737b7..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06.stdout +++ /dev/null @@ -1,2 +0,0 @@ -MinList Int :: MinList 1 [9,2,5,3,2,4] -MinList Int :: MinList 1 [-3,-4,0,0,-1,-5,0] diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06_A.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06_A.hs deleted file mode 100644 index d092ae7a1a..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang06_A.hs +++ /dev/null @@ -1,24 +0,0 @@ -{-# LANGUAGE Trustworthy #-} - --- | Here we expose a MinList API that only allows elements --- to be inserted into a list if they are at least greater --- than an initial element the list is created with. -module SafeLang06_A ( - MinList, - newMinList, - insertMinList, - printIntMinList - ) where - -data MinList a = MinList a [a] - -newMinList :: Ord a => a -> MinList a -newMinList n = MinList n [] - -insertMinList :: Ord a => MinList a -> a -> MinList a -insertMinList s@(MinList m xs) n | n > m = MinList m (n:xs) - | otherwise = s - -printIntMinList :: MinList Int -> IO () -printIntMinList (MinList min xs) = putStrLn $ "MinList Int :: MinList " ++ show min ++ " " ++ show xs - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.hs deleted file mode 100644 index 006cd0ea08..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.hs +++ /dev/null @@ -1,41 +0,0 @@ -{-# LANGUAGE Safe #-} -{-# LANGUAGE GeneralizedNewtypeDeriving #-} - --- Here we stop it succeeding (SAFE) - --- | We use newtype to create an isomorphic type to Int --- with a reversed Ord dictionary. We now use the MinList --- API of Y1 to create a new MinList. Then we use newtype --- deriving to convert the newtype MinList to an Int --- MinList. This final result breaks the invariants of --- MinList which shouldn't be possible with the exposed --- API of Y1. -module Main where - -import SafeLang07_A - -class IntIso t where - intIso :: c t -> c Int - -instance IntIso Int where - intIso = id - -newtype Down a = Down a deriving (Eq, Show, IntIso) - -instance Ord a => Ord (Down a) where - compare (Down a) (Down b) = compare b a - -forceInt :: MinList Int -> MinList Int -forceInt = id - -a1, a2 :: MinList Int -a1 = foldl insertMinList (newMinList $ head nums) (tail nums) -a2 = forceInt $ intIso $ foldl (\x y -> insertMinList x $ Down y) (newMinList $ Down $ head nums) (tail nums) - -nums :: [Int] -nums = [1,4,0,1,-5,2,3,5,-1,2,0,0,-4,-3,9] - -main = do - printIntMinList a1 - printIntMinList a2 - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.stderr b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.stderr deleted file mode 100644 index 1218b29a6d..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07.stderr +++ /dev/null @@ -1,7 +0,0 @@ - -<no location info>: - Warning: -XGeneralizedNewtypeDeriving is not allowed in Safe Haskell; ignoring -XGeneralizedNewtypeDeriving - -SafeLang07.hs:15:1: - Failed to load interface for `SafeLang07_A' - Use -v to see a list of the files searched for. diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07_A.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07_A.hs deleted file mode 100644 index 6ef49d5946..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang07_A.hs +++ /dev/null @@ -1,24 +0,0 @@ -{-# LANGUAGE Trustworthy #-} - --- | Here we expose a MinList API that only allows elements --- to be inserted into a list if they are at least greater --- than an initial element the list is created with. -module SafeLang07_A ( - MinList, - newMinList, - insertMinList, - printIntMinList - ) where - -data MinList a = MinList a [a] - -newMinList :: Ord a => a -> MinList a -newMinList n = MinList n [] - -insertMinList :: Ord a => MinList a -> a -> MinList a -insertMinList s@(MinList m xs) n | n > m = MinList m (n:xs) - | otherwise = s - -printIntMinList :: MinList Int -> IO () -printIntMinList (MinList min xs) = putStrLn $ "MinList Int :: MinList " ++ show min ++ " " ++ show xs - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang08.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang08.hs deleted file mode 100644 index 7249c8d0ec..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang08.hs +++ /dev/null @@ -1,21 +0,0 @@ -{-# LANGUAGE Safe #-} -{-# LANGUAGE ForeignFunctionInterface #-} - --- | Make sure FFI must be IO type -module Main where - -import Foreign.C - -foreign import ccall "SafeLang08_A" c_sin :: CDouble -> CDouble - -sinx :: Double -> Double -sinx d = realToFrac $ c_sin $ realToFrac d - -x :: Double -x = 0.8932 - -main :: IO () -main = do - putStrLn "Hello World" - putStrLn $ "Sin of " ++ (show x) ++ " is " ++ (show $ sinx x) - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang08.stderr b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang08.stderr deleted file mode 100644 index fc7c7fa00d..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang08.stderr +++ /dev/null @@ -1,7 +0,0 @@ - -SafeLang08.hs:9:1: - Unacceptable result type in foreign declaration: CDouble - Safe Haskell is on, all FFI imports must be in the IO monad - When checking declaration: - foreign import ccall safe "static SafeLang08_A" c_sin - :: CDouble -> CDouble diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang08_A.c b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang08_A.c deleted file mode 100644 index d77ebad560..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang08_A.c +++ /dev/null @@ -1,6 +0,0 @@ -double sinyy (double d) { - double (*y)(double) = 0x0; - return y(d); -} - - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang09.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang09.hs deleted file mode 100644 index 4e20f177bf..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang09.hs +++ /dev/null @@ -1,10 +0,0 @@ -module Main where - -import SafeLang09_A -- trusted lib -import SafeLang09_B -- untrusted plugin - -main = do - let r = res [(1::Int)] - putStrLn $ "Result: " ++ show r - putStrLn $ "Result: " ++ show function - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang09.stderr b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang09.stderr deleted file mode 100644 index 27d951e959..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang09.stderr +++ /dev/null @@ -1 +0,0 @@ -SafeLang09: This curry is poisoned! diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang09_A.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang09_A.hs deleted file mode 100644 index 129c2c4b56..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang09_A.hs +++ /dev/null @@ -1,15 +0,0 @@ -{-# LANGUAGE FlexibleInstances #-} - --- | Trusted library that unsafe plugins can use -module SafeLang09_A where - -class Pos a where - res :: a -> Bool - --- Any call to res with a list in out TCB --- should use this method and never a more --- specific one provided by an untrusted module -instance Pos [a] where - res _ = True - - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang09_B.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang09_B.hs deleted file mode 100644 index 76e0fe5a1c..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang09_B.hs +++ /dev/null @@ -1,19 +0,0 @@ -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE OverlappingInstances #-} - --- Untrusted plugin! Don't wan't it changing behaviour of our --- trusted code -module SafeLang09_B where - -import SafeLang09_A - -instance Pos a where - res _ = False - -instance Pos [Int] where - res _ = error "This curry is poisoned!" - -function :: Int -function = 3 - - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10.hs deleted file mode 100644 index ff5c168cff..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10.hs +++ /dev/null @@ -1,12 +0,0 @@ -{-# LANGUAGE SafeImports #-} -module Main where - -import safe SafeLang10_A -- trusted lib -import safe SafeLang10_B -- untrusted plugin - -main = do - let r = res [(1::Int)] - putStrLn $ "Result: " ++ show r - putStrLn $ "Result: " ++ show function - - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10.stderr b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10.stderr deleted file mode 100644 index d9a671b08d..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10.stderr +++ /dev/null @@ -1,20 +0,0 @@ -[1 of 3] Compiling SafeLang10_A ( SafeLang10_A.hs, SafeLang10_A.o ) -[2 of 3] Compiling SafeLang10_B ( SafeLang10_B.hs, SafeLang10_B.o ) -[3 of 3] Compiling Main ( SafeLang10.hs, SafeLang10.o ) - -SafeLang10.hs:8:13: - Unsafe overlapping instances for Pos [Int] - arising from a use of `res' - The matching instance is: - instance [overlap ok] [safe] Pos [Int] - -- Defined at SafeLang10_B.hs:14:10-18 - It is compiled in a Safe module and as such can only - overlap instances from the same module, however it - overlaps the following instances from different modules: - instance Pos [a] -- Defined at SafeLang10_A.hs:13:10-16 - In the expression: res [(1 :: Int)] - In an equation for `r': r = res [(1 :: Int)] - In the expression: - do { let r = res ...; - putStrLn $ "Result: " ++ show r; - putStrLn $ "Result: " ++ show function } diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10.stdout b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10.stdout deleted file mode 100644 index 32f4c5bbce..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10.stdout +++ /dev/null @@ -1,3 +0,0 @@ -[1 of 3] Compiling SafeLang10_A ( SafeLang10_A.hs, SafeLang10_A.o ) -[2 of 3] Compiling SafeLang10_B ( SafeLang10_B.hs, SafeLang10_B.o ) -[3 of 3] Compiling Main ( SafeLang10.hs, SafeLang10.o ) diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10_A.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10_A.hs deleted file mode 100644 index 7be17b5ec0..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10_A.hs +++ /dev/null @@ -1,16 +0,0 @@ -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE Trustworthy #-} - --- | Trusted library that unsafe plugins can use -module SafeLang10_A where - -class Pos a where - res :: a -> Bool - --- Any call to res with a list in out TCB --- should use this method and never a more --- specific one provided by an untrusted module -instance Pos [a] where - res _ = True - - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10_B.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10_B.hs deleted file mode 100644 index 5b9954c12e..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang10_B.hs +++ /dev/null @@ -1,20 +0,0 @@ -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE OverlappingInstances #-} -{-# LANGUAGE Safe #-} - --- Untrusted plugin! Don't wan't it changing behaviour of our --- trusted code -module SafeLang10_B where - -import SafeLang10_A - -instance Pos a where - res _ = False - -instance Pos [Int] where - res _ = error "This curry is poisoned!" - -function :: Int -function = 3 - - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang11.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang11.hs deleted file mode 100644 index 11b32ec57c..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang11.hs +++ /dev/null @@ -1,12 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} -module Main where - -import SafeLang11_A -import SafeLang11_B - -$(mkSimpleClass ''A) - -main = do - let b = c :: A - putStrLn $ "I have a value of A :: " ++ show b - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang11.stdout b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang11.stdout deleted file mode 100644 index 34f1bf217a..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang11.stdout +++ /dev/null @@ -1 +0,0 @@ -I have a value of A :: A1 is secret! diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang11_A.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang11_A.hs deleted file mode 100644 index 7eb818183c..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang11_A.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE Safe #-} -module SafeLang11_A ( A ) where - -data A = A1 | A2 - -instance Show A where - show A1 = "A1 is secret!" - show A2 = "A2 is secret!" - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang11_B.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang11_B.hs deleted file mode 100644 index 8d81be6abc..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang11_B.hs +++ /dev/null @@ -1,16 +0,0 @@ -{-# LANGUAGE TemplateHaskell #-} -module SafeLang11_B ( Class(..), mkSimpleClass ) where - -import Language.Haskell.TH - -class Class a where - c :: a - -mkSimpleClass :: Name -> Q [Dec] -mkSimpleClass name = do - TyConI (DataD [] dname [] cs _) <- reify name - ((NormalC conname []):_) <- return cs - ClassI (ClassD [] cname [_] [] [SigD mname _]) _ <- reify ''Class - return [InstanceD [] (AppT (ConT cname) (ConT dname)) [FunD mname - [Clause [] (NormalB (ConE conname)) []]]] - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang12.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang12.hs deleted file mode 100644 index 5817e54095..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang12.hs +++ /dev/null @@ -1,14 +0,0 @@ -{-# LANGUAGE Safe #-} -{-# LANGUAGE TemplateHaskell #-} -module Main where - -import SafeLang11_A -import SafeLang12_B - -$(mkSimpleClass ''A) - -main = do - let b = c :: A - putStrLn $ "I have a value of A :: " ++ show b - - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang12.stderr b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang12.stderr deleted file mode 100644 index 1466921b07..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang12.stderr +++ /dev/null @@ -1,11 +0,0 @@ - -SafeLang12.hs:2:14: - Warning: XTemplateHaskell is not allowed in Safe Haskell; ignoring XTemplateHaskell - -SafeLang12_B.hs:2:14: - Warning: XTemplateHaskell is not allowed in Safe Haskell; ignoring XTemplateHaskell - -SafeLang12_B.hs:3:8: - File name does not match module name: - Saw: `SafeLang11_B' - Expected: `SafeLang12_B' diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang12_B.hs b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang12_B.hs deleted file mode 100644 index f6ce559448..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/SafeLang12_B.hs +++ /dev/null @@ -1,18 +0,0 @@ -{-# LANGUAGE Safe #-} -{-# LANGUAGE TemplateHaskell #-} -module SafeLang11_B ( Class(..), mkSimpleClass ) where - -import Language.Haskell.TH - -class Class a where - c :: a - -mkSimpleClass :: Name -> Q [Dec] -mkSimpleClass name = do - TyConI (DataD [] dname [] cs _) <- reify name - ((NormalC conname []):_) <- return cs - ClassI (ClassD [] cname [_] [] [SigD mname _]) _ <- reify ''Class - return [InstanceD [] (AppT (ConT cname) (ConT dname)) [FunD mname - [Clause [] (NormalB (ConE conname)) []]]] - - diff --git a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/all.T b/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/all.T deleted file mode 100644 index 7074c0f75c..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/safeLanguage/all.T +++ /dev/null @@ -1,19 +0,0 @@ -# Just do the normal way, SafeHaskell is all in the frontend -def f( opts ): - opts.only_ways = ['normal'] - -setTestOpts(f) - -test('SafeLang01', normal, compile, ['-trust base']) -test('SafeLang02', normal, compile, ['-trust base']) -test('SafeLang03', normal, compile, ['-trust base']) -test('SafeLang04', normal, compile_and_run, ['']) -test('SafeLang05', normal, compile_and_run, ['-trust base']) -test('SafeLang06', normal, compile_and_run, ['']) -test('SafeLang07', normal, compile_fail, ['']) -test('SafeLang08', normal, compile_fail, ['']) -test('SafeLang09', exit_code(1), compile_and_run, ['']) -test('SafeLang10', normal, compile_fail, ['--make -trust base']) -test('SafeLang11', req_interp, compile_and_run, ['--make -trust base']) -test('SafeLang12', normal, compile_fail, ['--make -trust base']) - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport01.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport01.hs deleted file mode 100644 index ae72dd6cd3..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport01.hs +++ /dev/null @@ -1,11 +0,0 @@ -{-# LANGUAGE Safe #-} -module Main where - -import System.IO.Unsafe - -f :: Int -f = unsafePerformIO $ putStrLn "What kind of swallow?" >> return 2 - -main :: IO () -main = putStrLn $ "X is: " ++ show f - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport01.stderr b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport01.stderr deleted file mode 100644 index 983e043591..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport01.stderr +++ /dev/null @@ -1,3 +0,0 @@ - -BadImport01.hs:4:1: - base:System.IO.Unsafe can't be safely imported! The module itself isn't safe. diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport02.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport02.hs deleted file mode 100644 index e9d5ca7577..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport02.hs +++ /dev/null @@ -1,27 +0,0 @@ -{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} - --- | Here we used typeable to produce an illegal value -module Main where - -import Data.Typeable - -import BadImport02_A - -deriving instance Typeable Nat - -data NInt = NInt Int deriving Show - -instance Typeable NInt where - typeOf _ = typeOf (undefined::Nat) - -main = do - let a = succ' $ zero - Just n@(NInt z) = (cast a) :: Maybe NInt - n' = NInt (-z) - Just m = (cast n') :: Maybe Nat - - putStrLn $ showNat a - putStrLn $ show n - putStrLn $ showNat m - return () - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport02.stdout b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport02.stdout deleted file mode 100644 index c0f565d07c..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport02.stdout +++ /dev/null @@ -1,3 +0,0 @@ -Nat 1 -NInt 1 -Nat -1 diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport02_A.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport02_A.hs deleted file mode 100644 index 2ca43343eb..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport02_A.hs +++ /dev/null @@ -1,16 +0,0 @@ -{-# LANGUAGE Trustworthy #-} -module BadImport02_A ( - Nat, zero, succ', showNat - ) where - -data Nat = NatC Int - -zero :: Nat -zero = NatC 0 - -succ' :: Nat -> Nat -succ' (NatC n) = NatC $ n + 1 - -showNat :: Nat -> String -showNat (NatC n) = "Nat " ++ show n - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport03.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport03.hs deleted file mode 100644 index 835009a276..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport03.hs +++ /dev/null @@ -1,29 +0,0 @@ -{-# LANGUAGE Safe #-} -{-# LANGUAGE StandaloneDeriving, DeriveDataTypeable #-} - --- | Here we used typeable to produce an illegal value --- Now using SAFE though so will fail -module Main where - -import Data.Typeable - -import BadImport02_A - -deriving instance Typeable Nat - -data NInt = NInt Int deriving Show - -instance Typeable NInt where - typeOf _ = typeOf (undefined::Nat) - -main = do - let a = succ' $ zero - Just n@(NInt z) = (cast a) :: Maybe NInt - n' = NInt (-z) - Just m = (cast n') :: Maybe Nat - - putStrLn $ showNat a - putStrLn $ show n - putStrLn $ showNat m - return () - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport03.stderr b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport03.stderr deleted file mode 100644 index b1fcc3ca09..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/BadImport03.stderr +++ /dev/null @@ -1,5 +0,0 @@ -[1 of 2] Compiling BadImport02_A ( BadImport02_A.hs, BadImport02_A.o ) -[2 of 2] Compiling Main ( BadImport03.hs, BadImport03.o ) - -BadImport03.hs:8:1: - base:Data.Typeable can't be safely imported! The module itself isn't safe. diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep01.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep01.hs deleted file mode 100644 index 5ee1cd0288..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep01.hs +++ /dev/null @@ -1,13 +0,0 @@ -module Dep01 where - -import Control.Monad -import Control.Monad.ST -import Data.STRef - -sumST :: Num a => [a] -> IO a -sumST xs = unsafeSTToIO $ do - n <- newSTRef 0 - forM_ xs $ \x -> do - modifySTRef n (+x) - readSTRef n - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep01.stderr b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep01.stderr deleted file mode 100644 index a21b4861dd..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep01.stderr +++ /dev/null @@ -1,5 +0,0 @@ - -Dep01.hs:4:1: - Warning: In the use of `unsafeSTToIO' - (imported from Control.Monad.ST): - Deprecated: "Please import from Control.Monad.ST.Unsafe instead; This will be removed in the next release" diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep02.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep02.hs deleted file mode 100644 index f9dbb26064..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep02.hs +++ /dev/null @@ -1,16 +0,0 @@ -module Dep02 where - -import Control.Monad -import Control.Monad.ST.Lazy -import Data.STRef.Lazy - -sumST :: Num a => [a] -> a -sumST xs = runST $ do - n <- newSTRef 0 - forM_ xs $ \x -> do - modifySTRef n (+x) - readSTRef n - -badST :: () -badST = runST $ unsafeIOToST $ putStrLn "Hello World" - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep02.stderr b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep02.stderr deleted file mode 100644 index 8ae7621251..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep02.stderr +++ /dev/null @@ -1,5 +0,0 @@ - -Dep02.hs:4:1: - Warning: In the use of `unsafeIOToST' - (imported from Control.Monad.ST.Lazy): - Deprecated: "Please import from Control.Monad.ST.Lazy.Unsafe instead; This will be removed in the next release" diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep03.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep03.hs deleted file mode 100644 index b5f39affc7..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep03.hs +++ /dev/null @@ -1,7 +0,0 @@ -module Dep03 where - -import Foreign - -bad :: IO a -> a -bad = unsafePerformIO - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep03.stderr b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep03.stderr deleted file mode 100644 index 51c4d0a850..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep03.stderr +++ /dev/null @@ -1,5 +0,0 @@ - -Dep03.hs:3:1: - Warning: In the use of `unsafePerformIO' - (imported from Foreign): - Deprecated: "Use System.IO.Unsafe.unsafePerformIO instead; This function will be removed in the next release" diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep04.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep04.hs deleted file mode 100644 index 5ff23ea0ad..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep04.hs +++ /dev/null @@ -1,8 +0,0 @@ -module Dep04 where - -import Foreign.Ptr -import Foreign.ForeignPtr - -bad :: ForeignPtr a -> Ptr a -bad = unsafeForeignPtrToPtr - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep04.stderr b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep04.stderr deleted file mode 100644 index ef81bf4212..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep04.stderr +++ /dev/null @@ -1,5 +0,0 @@ - -Dep04.hs:4:1: - Warning: In the use of `unsafeForeignPtrToPtr' - (imported from Foreign.ForeignPtr): - Deprecated: "Use Foreign.ForeignPtr.Unsafe.unsafeForeignPtrToPtr instead; This function will be removed in the next release" diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep05.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep05.hs deleted file mode 100644 index da25c1a52a..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep05.hs +++ /dev/null @@ -1,13 +0,0 @@ -{-# LANGUAGE NoMonomorphismRestriction #-} -module Dep05 where - -import GHC.Arr - -bad1 = unsafeArray - -bad2 = fill - -bad3 = done - -bad4 = unsafeThawSTArray - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep05.stderr b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep05.stderr deleted file mode 100644 index e69de29bb2..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep05.stderr +++ /dev/null diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep06.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep06.hs deleted file mode 100644 index 0a5811d02b..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep06.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Dep06 where - -import GHC.Conc - -bad1 = unsafeIOToSTM - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep06.stderr b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep06.stderr deleted file mode 100644 index e69de29bb2..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep06.stderr +++ /dev/null diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep07.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep07.hs deleted file mode 100644 index 6f0df7af11..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep07.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Dep07 where - -import GHC.ForeignPtr - -bad1 = unsafeForeignPtrToPtr - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep07.stderr b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep07.stderr deleted file mode 100644 index e69de29bb2..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep07.stderr +++ /dev/null diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep08.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep08.hs deleted file mode 100644 index a3fbc7be61..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep08.hs +++ /dev/null @@ -1,9 +0,0 @@ -{-# LANGUAGE NoMonomorphismRestriction #-} -module Dep08 where - -import GHC.IOArray - -bad1 = unsafeReadIOArray - -bad2 = unsafeWriteIOArray - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep08.stderr b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep08.stderr deleted file mode 100644 index e69de29bb2..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep08.stderr +++ /dev/null diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep09.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep09.hs deleted file mode 100644 index beeb7ffe95..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep09.hs +++ /dev/null @@ -1,6 +0,0 @@ -module Dep09 where - -import GHC.Ptr - -bad1 = castFunPtrToPtr - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep09.stderr b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep09.stderr deleted file mode 100644 index e69de29bb2..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep09.stderr +++ /dev/null diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep10.hs b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep10.hs deleted file mode 100644 index 70d660ed1c..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep10.hs +++ /dev/null @@ -1,8 +0,0 @@ -module Dep10 where - -import GHC.ST - -bad1 = liftST - -bad2 = unsafeInterleaveST - diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep10.stderr b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep10.stderr deleted file mode 100644 index e69de29bb2..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Dep10.stderr +++ /dev/null diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Makefile b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Makefile deleted file mode 100644 index 9ce1411567..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/Makefile +++ /dev/null @@ -1,3 +0,0 @@ -TOP=../../../.. -include $(TOP)/mk/boilerplate.mk -include $(TOP)/mk/test.mk
\ No newline at end of file diff --git a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/all.T b/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/all.T deleted file mode 100644 index c985b65c3c..0000000000 --- a/testsuite/tests/ghc-regress/safeHaskell/unsafeLibs/all.T +++ /dev/null @@ -1,21 +0,0 @@ -# Just do the normal way, SafeHaskell is all in the frontend -def f( opts ): - opts.only_ways = ['normal'] - -setTestOpts(f) - -test('Dep01', normal, compile, ['']) -test('Dep02', normal, compile, ['']) -test('Dep03', normal, compile, ['']) -test('Dep04', normal, compile, ['']) -test('Dep05', normal, compile, ['']) -test('Dep06', normal, compile, ['']) -test('Dep07', normal, compile, ['']) -test('Dep08', normal, compile, ['']) -test('Dep09', normal, compile, ['']) -test('Dep10', normal, compile, ['']) - -test('BadImport01', normal, compile_fail, ['']) -test('BadImport02', normal, compile_and_run, ['--make']) -test('BadImport03', normal, compile_fail, ['--make']) - |