summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2021-02-26 14:51:59 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-03-05 04:48:39 -0500
commit4cd98bd2c91cac4a10831ab7111c7be8153bdd33 (patch)
treeab3fc0a338e56e9fe901332fbb957abf7a2eefce /testsuite
parent6467a48e64ce5ccea29099cb89962e879cded91c (diff)
downloadhaskell-4cd98bd2c91cac4a10831ab7111c7be8153bdd33.tar.gz
Run linear Lint on the desugarer output (part of #19165)
This addresses points (1a) and (1b) of #19165. - Move mkFailExpr to HsToCore/Utils, as it can be shared - Desugar incomplete patterns and holes to an empty case, as in Note [Incompleteness and linearity] - Enable linear linting of desugarer output - Mark MultConstructor as broken. It fails Lint, but I'd like to fix this separately. Metric Decrease: T6048
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/linear/should_compile/all.T2
-rw-r--r--testsuite/tests/simplCore/should_compile/T9400.stderr10
-rw-r--r--testsuite/tests/simplCore/should_compile/spec-inline.stderr5
3 files changed, 10 insertions, 7 deletions
diff --git a/testsuite/tests/linear/should_compile/all.T b/testsuite/tests/linear/should_compile/all.T
index 4869db0f2f..17e04ca94a 100644
--- a/testsuite/tests/linear/should_compile/all.T
+++ b/testsuite/tests/linear/should_compile/all.T
@@ -29,7 +29,7 @@ test('LinearConstructors', normal, compile, [''])
test('Linear1Rule', normal, compile, [''])
test('LinearEmptyCase', normal, compile, [''])
test('Tunboxer', normal, compile, [''])
-test('MultConstructor', normal, compile, [''])
+test('MultConstructor', expect_broken(19165), compile, [''])
test('LinearLetRec', expect_broken(405), compile, ['-O -dlinear-core-lint'])
test('LinearTH1', normal, compile, [''])
test('LinearTH2', normal, compile, [''])
diff --git a/testsuite/tests/simplCore/should_compile/T9400.stderr b/testsuite/tests/simplCore/should_compile/T9400.stderr
index 9e3f4184ea..7825071aea 100644
--- a/testsuite/tests/simplCore/should_compile/T9400.stderr
+++ b/testsuite/tests/simplCore/should_compile/T9400.stderr
@@ -9,7 +9,7 @@ T9400.hs:18:9: warning: [-Woverlapping-patterns (in -Wdefault)]
==================== Tidy Core ====================
Result size of Tidy Core
- = {terms: 37, types: 22, coercions: 0, joins: 0/0}
+ = {terms: 38, types: 22, coercions: 0, joins: 0/0}
-- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0}
$trModule1 :: Addr#
@@ -36,7 +36,7 @@ T9400.$trModule :: Module
[GblId, Unf=OtherCon []]
T9400.$trModule = GHC.Types.Module $trModule2 $trModule4
--- RHS size: {terms: 22, types: 15, coercions: 0, joins: 0/0}
+-- RHS size: {terms: 23, types: 15, coercions: 0, joins: 0/0}
main :: IO ()
[GblId]
main
@@ -64,8 +64,10 @@ main
@()
@()
(putStrLn (unpackCString# "efg"#))
- (Control.Exception.Base.patError
- @'LiftedRep @(IO ()) "T9400.hs:(17,5)-(18,29)|case"#))))
+ (case Control.Exception.Base.patError
+ @'LiftedRep @() "T9400.hs:(17,5)-(18,29)|case"#
+ of wild {
+ }))))
diff --git a/testsuite/tests/simplCore/should_compile/spec-inline.stderr b/testsuite/tests/simplCore/should_compile/spec-inline.stderr
index a9da295e8b..a8fa8e58e8 100644
--- a/testsuite/tests/simplCore/should_compile/spec-inline.stderr
+++ b/testsuite/tests/simplCore/should_compile/spec-inline.stderr
@@ -45,10 +45,11 @@ lvl :: GHC.Prim.Addr#
lvl = "spec-inline.hs:(19,5)-(29,25)|function go"#
-- RHS size: {terms: 2, types: 2, coercions: 0, joins: 0/0}
-Roman.foo3 :: Int
+Roman.foo3 :: ()
[GblId, Str=b, Cpr=b]
Roman.foo3
- = Control.Exception.Base.patError @'GHC.Types.LiftedRep @Int lvl
+ = Control.Exception.Base.patError
+ @'GHC.Types.LiftedRep @() lvl
Rec {
-- RHS size: {terms: 40, types: 5, coercions: 0, joins: 0/0}