summaryrefslogtreecommitdiff
path: root/testsuite/tests/safeHaskell
diff options
context:
space:
mode:
authorKai Harries <kai.harries@gmail.com>2016-03-20 17:51:39 +0100
committerBen Gamari <ben@smart-cactus.org>2016-03-20 22:00:37 +0100
commit289d57a6894b5d3eb5daf696a75275a8146f0092 (patch)
tree2c1c4e522dd00391c6668e13fc93d2f4e4084774 /testsuite/tests/safeHaskell
parentb735e99d79448bd7f416b35d8b0473d8eb5271f1 (diff)
downloadhaskell-289d57a6894b5d3eb5daf696a75275a8146f0092.tar.gz
Add test for incompatible flags (issue #11580)
Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2013 GHC Trac Issues: #11580
Diffstat (limited to 'testsuite/tests/safeHaskell')
-rw-r--r--testsuite/tests/safeHaskell/flags/SafeFlags30.hs7
-rw-r--r--testsuite/tests/safeHaskell/flags/SafeFlags30.stderr3
-rw-r--r--testsuite/tests/safeHaskell/flags/all.T1
3 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags30.hs b/testsuite/tests/safeHaskell/flags/SafeFlags30.hs
new file mode 100644
index 0000000000..27790a4c96
--- /dev/null
+++ b/testsuite/tests/safeHaskell/flags/SafeFlags30.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE Safe, Unsafe, Trustworthy #-}
+-- | Basic test to see that incompatible flags give a nice error
+-- message and ghc do not panic (see issue #11580).
+module SafeFlags30 where
+
+f :: Int
+f = 1
diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags30.stderr b/testsuite/tests/safeHaskell/flags/SafeFlags30.stderr
new file mode 100644
index 0000000000..11ff3a620d
--- /dev/null
+++ b/testsuite/tests/safeHaskell/flags/SafeFlags30.stderr
@@ -0,0 +1,3 @@
+ghc: SafeFlags30.hs:1:20-25: Incompatible Safe Haskell flags! (Safe, Unsafe)
+SafeFlags30.hs:1:28-38: Incompatible Safe Haskell flags! (Safe, Trustworthy)
+Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/safeHaskell/flags/all.T b/testsuite/tests/safeHaskell/flags/all.T
index fff8841797..0fa30e5628 100644
--- a/testsuite/tests/safeHaskell/flags/all.T
+++ b/testsuite/tests/safeHaskell/flags/all.T
@@ -62,3 +62,4 @@ test('SafeFlags29', normal, compile_fail, [''])
test('Flags01', normal, compile, ['-XSafe'])
test('Flags02', normal, compile, ['-XSafe'])
+test('SafeFlags30', normal, compile_fail, [''])