[commit: ghc] ghc-8.0: Add test for incompatible flags (issue #11580) (9f8e1d9)

git at git.haskell.org git at git.haskell.org
Thu Mar 24 22:00:05 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-8.0
Link       : http://ghc.haskell.org/trac/ghc/changeset/9f8e1d93460b7f8cb4137cab743d52e97b69f76a/ghc

>---------------------------------------------------------------

commit 9f8e1d93460b7f8cb4137cab743d52e97b69f76a
Author: Kai Harries <kai.harries at gmail.com>
Date:   Sun Mar 20 17:51:39 2016 +0100

    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
    
    (cherry picked from commit 289d57a6894b5d3eb5daf696a75275a8146f0092)


>---------------------------------------------------------------

9f8e1d93460b7f8cb4137cab743d52e97b69f76a
 testsuite/tests/safeHaskell/flags/SafeFlags30.hs     | 7 +++++++
 testsuite/tests/safeHaskell/flags/SafeFlags30.stderr | 3 +++
 testsuite/tests/safeHaskell/flags/all.T              | 1 +
 3 files changed, 11 insertions(+)

diff --git a/testsuite/tests/safeHaskell/flags/SafeFlags30.hs b/testsuite/tests/safeHaskell/flags/SafeFlags30.hs
new file mode 100644
index 0000000..27790a4
--- /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 0000000..11ff3a6
--- /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 fff8841..0fa30e5 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, [''])



More information about the ghc-commits mailing list