summaryrefslogtreecommitdiff
path: root/testsuite/tests/annotations
diff options
context:
space:
mode:
authorDavid Kraeutmann <kane@kane.cx>2015-09-08 11:35:33 -0500
committerAustin Seipp <austin@well-typed.com>2015-09-08 11:35:59 -0500
commit4356dacb4a2ae29dfbd7126b25b72d89bb9db1b0 (patch)
tree9d118c4eb0733cd134359efe95e6847d91688abf /testsuite/tests/annotations
parentdbb4e415126aceb603da0fbf657372389a47e466 (diff)
downloadhaskell-4356dacb4a2ae29dfbd7126b25b72d89bb9db1b0.tar.gz
Forbid annotations when Safe Haskell safe mode is enabled.
For now, this fails compliation immediately with an error. If desired, this can be a warning that annotations in Safe Haskell are ignored. Signed-off-by: David Kraeutmann <kane@kane.cx> Reviewed By: goldfire, austin Differential Revision: https://phabricator.haskell.org/D1226 GHC Trac Issues: #10826
Diffstat (limited to 'testsuite/tests/annotations')
-rw-r--r--testsuite/tests/annotations/should_fail/T10826.hs7
-rw-r--r--testsuite/tests/annotations/should_fail/T10826.stderr6
-rw-r--r--testsuite/tests/annotations/should_fail/all.T2
3 files changed, 14 insertions, 1 deletions
diff --git a/testsuite/tests/annotations/should_fail/T10826.hs b/testsuite/tests/annotations/should_fail/T10826.hs
new file mode 100644
index 0000000000..cddf33ca6f
--- /dev/null
+++ b/testsuite/tests/annotations/should_fail/T10826.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE Safe #-}
+module Test (hook) where
+
+import System.IO.Unsafe
+
+{-# ANN hook (unsafePerformIO (putStrLn "Woops.")) #-}
+hook = undefined
diff --git a/testsuite/tests/annotations/should_fail/T10826.stderr b/testsuite/tests/annotations/should_fail/T10826.stderr
new file mode 100644
index 0000000000..0e2bed5d8b
--- /dev/null
+++ b/testsuite/tests/annotations/should_fail/T10826.stderr
@@ -0,0 +1,6 @@
+
+T10826.hs:6:1: error:
+ Annotations are not compatible with Safe Haskell.
+ See https://ghc.haskell.org/trac/ghc/ticket/10826
+ In the annotation:
+ {-# ANN hook (unsafePerformIO (putStrLn "Woops.")) #-}
diff --git a/testsuite/tests/annotations/should_fail/all.T b/testsuite/tests/annotations/should_fail/all.T
index 21eaa765c3..0b10d8394a 100644
--- a/testsuite/tests/annotations/should_fail/all.T
+++ b/testsuite/tests/annotations/should_fail/all.T
@@ -18,7 +18,7 @@ test('annfail10', req_interp, compile_fail, [''])
test('annfail11', normal, compile_fail, [''])
test('annfail12', req_interp, compile_fail, ['-v0'])
test('annfail13', normal, compile_fail, [''])
-
+test('T10826', normal, compile_fail, [''])
""""
Helpful things to C+P: