[commit: ghc] ghc-8.2: testsuite: add new test for desugar warnings/errors with -fno-code (6723c2f)

git at git.haskell.org git at git.haskell.org
Fri May 5 15:54:06 UTC 2017


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/6723c2fdf3ce39227578d8da890969dc4ea836e7/ghc

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

commit 6723c2fdf3ce39227578d8da890969dc4ea836e7
Author: doug <douglas.wilson at gmail.com>
Date:   Fri May 5 09:18:53 2017 -0400

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


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

6723c2fdf3ce39227578d8da890969dc4ea836e7
 testsuite/tests/driver/T10600.hs     | 10 ++++++++++
 testsuite/tests/driver/T10600.stderr |  2 ++
 testsuite/tests/driver/T8101.stderr  |  3 +--
 testsuite/tests/driver/T8101b.stderr |  3 ++-
 testsuite/tests/driver/all.T         |  1 +
 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 0000000..86b6e6c
--- /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 0000000..4298e67
--- /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 6fda857..9f57360 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 555b036..ea8bcf0 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 09dc79a..7971d46 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=.'])



More information about the ghc-commits mailing list