summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authordoug <douglas.wilson@gmail.com>2017-05-05 09:18:53 -0400
committerBen Gamari <ben@smart-cactus.org>2017-05-07 12:29:06 -0400
commitbaa18def0da17f11497fecc6fe440cf125b50878 (patch)
tree3515e924b2641e5aa5ea4a36225e2bc295b37a0a /testsuite/tests
parented0c7f8b1f91651203db4a0ee5931d47e1e6ab51 (diff)
downloadhaskell-baa18def0da17f11497fecc6fe440cf125b50878.tar.gz
testsuite: add new test for desugar warnings/errors with -fno-code
Add a new (expect_broken) test T10600 that checks that the error: Top-level bindings for unlifted types aren't allowed: is thrown when compiling with -fno-code. This test currently fails because modules compiled with -fno-code aren't desugared. There are several other errors which can be thrown during desugaring that aren't tested for, discoverable by grepping for "errDs". Update .stderr files T8101 and T8101b. Presumably the compilation output has changed slightly since they were written. Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #10600, #8101 Differential Revision: https://phabricator.haskell.org/D3533
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/driver/T10600.hs10
-rw-r--r--testsuite/tests/driver/T10600.stderr2
-rw-r--r--testsuite/tests/driver/T8101.stderr3
-rw-r--r--testsuite/tests/driver/T8101b.stderr3
-rw-r--r--testsuite/tests/driver/all.T1
5 files changed, 16 insertions, 3 deletions
diff --git a/testsuite/tests/driver/T10600.hs b/testsuite/tests/driver/T10600.hs
new file mode 100644
index 0000000000..86b6e6cbfc
--- /dev/null
+++ b/testsuite/tests/driver/T10600.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE MagicHash #-}
+module T10600 where
+
+import GHC.Prim
+
+-- This shouldn't compile as unlifted bindings aren't allowed at top-level.
+-- However, #10600 described the situation where an error isn't throw when we
+-- compile with -fno-code.
+foo :: Int#
+foo = 10600#
diff --git a/testsuite/tests/driver/T10600.stderr b/testsuite/tests/driver/T10600.stderr
new file mode 100644
index 0000000000..4298e67dfc
--- /dev/null
+++ b/testsuite/tests/driver/T10600.stderr
@@ -0,0 +1,2 @@
+T10600.hs:10:1:
+ Top-level bindings for unlifted types aren't allowed: foo = 10600# \ No newline at end of file
diff --git a/testsuite/tests/driver/T8101.stderr b/testsuite/tests/driver/T8101.stderr
index 6fda85797f..9f57360448 100644
--- a/testsuite/tests/driver/T8101.stderr
+++ b/testsuite/tests/driver/T8101.stderr
@@ -1,5 +1,4 @@
-
-T8101.hs:7:9: Warning:
+T8101.hs:7:9: warning: [-Wincomplete-patterns (in -Wextra)]
Pattern match(es) are non-exhaustive
In a case alternative:
Patterns not matched:
diff --git a/testsuite/tests/driver/T8101b.stderr b/testsuite/tests/driver/T8101b.stderr
index 555b0362d0..ea8bcf0c4d 100644
--- a/testsuite/tests/driver/T8101b.stderr
+++ b/testsuite/tests/driver/T8101b.stderr
@@ -1,5 +1,6 @@
+[1 of 1] Compiling A ( T8101b.hs, nothing )
-T8101b.hs:7:9: Warning:
+T8101b.hs:7:9: warning: [-Wincomplete-patterns (in -Wextra)]
Pattern match(es) are non-exhaustive
In a case alternative:
Patterns not matched:
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 09dc79ab79..7971d46cb3 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -203,6 +203,7 @@ test('T2182', normal, run_command, ['$MAKE -s --no-print-directory T2182'])
test('T8101', expect_broken(10600), compile, ['-Wall -fno-code'])
test('T8101b', expect_broken(10600), multimod_compile,
['T8101b', '-Wall -fno-code'])
+test('T10600', expect_broken(10600), compile_fail, ['-fno-code'])
# Should not panic when compiling cmm file together with -outputdir.
test('T9050', cmm_src, compile, ['-outputdir=.'])