summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorDavid Terei <davidterei@gmail.com>2011-12-20 00:57:03 -0800
committerDavid Terei <davidterei@gmail.com>2011-12-20 01:01:29 -0800
commit6b90fe44329fc79b448b4db0fb96803ab2443994 (patch)
tree09cbb2ea66d69e2441e180305e792755b0b743e8 /testsuite
parent0909d1b8455fab98d4c3283ec7ec2935e2ed8372 (diff)
downloadhaskell-6b90fe44329fc79b448b4db0fb96803ab2443994.tar.gz
Update Safe Haskell tests
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/safeHaskell/check/Check01.hs2
-rw-r--r--testsuite/tests/safeHaskell/check/Check05.hs7
-rw-r--r--testsuite/tests/safeHaskell/check/Check05.stderr3
-rw-r--r--testsuite/tests/safeHaskell/check/all.T3
-rw-r--r--testsuite/tests/safeHaskell/flags/SafeFlags18.stderr6
-rw-r--r--testsuite/tests/safeHaskell/flags/all.T2
6 files changed, 21 insertions, 2 deletions
diff --git a/testsuite/tests/safeHaskell/check/Check01.hs b/testsuite/tests/safeHaskell/check/Check01.hs
index f11d87db15..1d5df588a4 100644
--- a/testsuite/tests/safeHaskell/check/Check01.hs
+++ b/testsuite/tests/safeHaskell/check/Check01.hs
@@ -1,4 +1,4 @@
-{-# GHC_OPTIONS -fpackage-trust #-}
+{-# OPTIONS_GHC -fpackage-trust #-}
{-# LANGUAGE Unsafe #-}
module Check01 ( main' ) where
diff --git a/testsuite/tests/safeHaskell/check/Check05.hs b/testsuite/tests/safeHaskell/check/Check05.hs
new file mode 100644
index 0000000000..2c3512a0b4
--- /dev/null
+++ b/testsuite/tests/safeHaskell/check/Check05.hs
@@ -0,0 +1,7 @@
+{-# OPTIONS_GHC -fpackage-trust #-}
+module Check05 ( main' ) where
+
+main' = do
+ let n = 1
+ print $ n
+
diff --git a/testsuite/tests/safeHaskell/check/Check05.stderr b/testsuite/tests/safeHaskell/check/Check05.stderr
new file mode 100644
index 0000000000..9db0875f44
--- /dev/null
+++ b/testsuite/tests/safeHaskell/check/Check05.stderr
@@ -0,0 +1,3 @@
+
+Check05.hs:1:16:
+ Warning: -fpackage-trust ignored; must be specified with a Safe Haskell flag
diff --git a/testsuite/tests/safeHaskell/check/all.T b/testsuite/tests/safeHaskell/check/all.T
index d665c655c4..d8b2f379fa 100644
--- a/testsuite/tests/safeHaskell/check/all.T
+++ b/testsuite/tests/safeHaskell/check/all.T
@@ -39,3 +39,6 @@ test('Check04', normal, multi_compile, ['Check04', [
('Check04_1.hs', '-trust base')
], '-fpackage-trust'])
+# Check -fpackage-trust with no safe haskell flag is an error
+test('Check05', normal, compile, [''])
+
diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags18.stderr b/testsuite/tests/safeHaskell/flags/SafeFlags18.stderr
new file mode 100644
index 0000000000..7ef83389a8
--- /dev/null
+++ b/testsuite/tests/safeHaskell/flags/SafeFlags18.stderr
@@ -0,0 +1,6 @@
+
+SafeFlags18.hs:1:16:
+ Warning: -fpackage-trust ignored; must be specified with a Safe Haskell flag
+
+<no location info>:
+Failing due to -Werror.
diff --git a/testsuite/tests/safeHaskell/flags/all.T b/testsuite/tests/safeHaskell/flags/all.T
index f5e9a896d0..9269f8b842 100644
--- a/testsuite/tests/safeHaskell/flags/all.T
+++ b/testsuite/tests/safeHaskell/flags/all.T
@@ -37,7 +37,7 @@ test('SafeFlags14', normal, compile_fail, [''])
test('SafeFlags15', normal, compile, [''])
test('SafeFlags16', normal, compile, [''])
test('SafeFlags17', normal, compile_fail, ['-distrust base'])
-test('SafeFlags18', normal, compile, ['-trust base'])
+test('SafeFlags18', normal, compile_fail, ['-trust base -Werror'])
test('SafeFlags19', normal, compile_fail, [''])
test('SafeFlags20', normal, compile, ['-trust base'])