summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore
diff options
context:
space:
mode:
authorAlejandro Serrano <trupill@gmail.com>2015-07-27 17:05:10 +0200
committerAlejandro Serrano <trupill@gmail.com>2015-07-27 17:05:10 +0200
commita87bb2b35a9af784de688fe50cc2daea3090f5de (patch)
treed240e225f7a0754f58302f25f79cecb409981775 /testsuite/tests/simplCore
parent6b05f0c574a5067cbd6db5909e34d66c3512aa8f (diff)
parent474d4ccc6e4a3bea93be16cb7daef6ffcdf9b663 (diff)
downloadhaskell-a87bb2b35a9af784de688fe50cc2daea3090f5de.tar.gz
Merge remote-tracking branch 'origin/master' into wip/impredicativity
Conflicts: compiler/typecheck/Inst.hs compiler/typecheck/TcBinds.hs compiler/typecheck/TcExpr.hs compiler/typecheck/TcRnTypes.hs compiler/types/Unify.hs
Diffstat (limited to 'testsuite/tests/simplCore')
-rw-r--r--testsuite/tests/simplCore/should_compile/Makefile6
-rw-r--r--testsuite/tests/simplCore/should_compile/T10083.hs5
-rw-r--r--testsuite/tests/simplCore/should_compile/T10083.hs-boot3
-rw-r--r--testsuite/tests/simplCore/should_compile/T10083a.hs4
-rw-r--r--testsuite/tests/simplCore/should_compile/T10181.hs3
-rw-r--r--testsuite/tests/simplCore/should_compile/T3717.stderr2
-rw-r--r--testsuite/tests/simplCore/should_compile/T3772.stdout2
-rw-r--r--testsuite/tests/simplCore/should_compile/T4908.stderr3
-rw-r--r--testsuite/tests/simplCore/should_compile/T4930.stderr3
-rw-r--r--testsuite/tests/simplCore/should_compile/T7360.stderr5
-rw-r--r--testsuite/tests/simplCore/should_compile/T9400.stderr1
-rw-r--r--testsuite/tests/simplCore/should_compile/all.T9
-rw-r--r--testsuite/tests/simplCore/should_compile/spec-inline.stderr7
13 files changed, 53 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/Makefile b/testsuite/tests/simplCore/should_compile/Makefile
index a7460b0d14..7f43dafdc8 100644
--- a/testsuite/tests/simplCore/should_compile/Makefile
+++ b/testsuite/tests/simplCore/should_compile/Makefile
@@ -126,3 +126,9 @@ T8221:
T5996:
$(RM) -f T5996.o T5996.hi
'$(TEST_HC)' $(TEST_HC_OPTS) -O -c T5996.hs -ddump-simpl -dsuppress-uniques -dsuppress-all | grep y2
+
+T10083:
+ $(RM) -f T10083.o T10083.hi T10083.hi-boot T10083a.o T10083a.hi
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083.hs-boot
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083a.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c -O T10083.hs
diff --git a/testsuite/tests/simplCore/should_compile/T10083.hs b/testsuite/tests/simplCore/should_compile/T10083.hs
new file mode 100644
index 0000000000..df896e6dab
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T10083.hs
@@ -0,0 +1,5 @@
+module T10083 where
+ import T10083a
+ data RSR = MkRSR SR
+ eqRSR (MkRSR s1) (MkRSR s2) = (eqSR s1 s2)
+ foo x y = not (eqRSR x y)
diff --git a/testsuite/tests/simplCore/should_compile/T10083.hs-boot b/testsuite/tests/simplCore/should_compile/T10083.hs-boot
new file mode 100644
index 0000000000..3d3e4a1281
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T10083.hs-boot
@@ -0,0 +1,3 @@
+module T10083 where
+ data RSR
+ eqRSR :: RSR -> RSR -> Bool
diff --git a/testsuite/tests/simplCore/should_compile/T10083a.hs b/testsuite/tests/simplCore/should_compile/T10083a.hs
new file mode 100644
index 0000000000..f4fd782a99
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T10083a.hs
@@ -0,0 +1,4 @@
+module T10083a where
+ import {-# SOURCE #-} T10083
+ data SR = MkSR RSR
+ eqSR (MkSR r1) (MkSR r2) = eqRSR r1 r2
diff --git a/testsuite/tests/simplCore/should_compile/T10181.hs b/testsuite/tests/simplCore/should_compile/T10181.hs
new file mode 100644
index 0000000000..1983507cd2
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T10181.hs
@@ -0,0 +1,3 @@
+module T10181 where
+
+t a = t a
diff --git a/testsuite/tests/simplCore/should_compile/T3717.stderr b/testsuite/tests/simplCore/should_compile/T3717.stderr
index 9515266807..374533605e 100644
--- a/testsuite/tests/simplCore/should_compile/T3717.stderr
+++ b/testsuite/tests/simplCore/should_compile/T3717.stderr
@@ -3,6 +3,7 @@
Result size of Tidy Core = {terms: 22, types: 10, coercions: 0}
Rec {
+-- RHS size: {terms: 10, types: 2, coercions: 0}
T3717.$wfoo [InlPrag=[0], Occ=LoopBreaker] :: Int# -> Int#
[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType <S,1*U>]
T3717.$wfoo =
@@ -13,6 +14,7 @@ T3717.$wfoo =
}
end Rec }
+-- RHS size: {terms: 10, types: 4, coercions: 0}
foo [InlPrag=INLINE[0]] :: Int -> Int
[GblId,
Arity=1,
diff --git a/testsuite/tests/simplCore/should_compile/T3772.stdout b/testsuite/tests/simplCore/should_compile/T3772.stdout
index 3d236823a6..e74fa39cb5 100644
--- a/testsuite/tests/simplCore/should_compile/T3772.stdout
+++ b/testsuite/tests/simplCore/should_compile/T3772.stdout
@@ -3,6 +3,7 @@
Result size of Tidy Core = {terms: 26, types: 11, coercions: 0}
Rec {
+-- RHS size: {terms: 10, types: 2, coercions: 0}
$wxs :: Int# -> ()
[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType <S,1*U>]
$wxs =
@@ -13,6 +14,7 @@ $wxs =
}
end Rec }
+-- RHS size: {terms: 14, types: 5, coercions: 0}
foo [InlPrag=NOINLINE] :: Int -> ()
[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType <S,1*U(U)>]
foo =
diff --git a/testsuite/tests/simplCore/should_compile/T4908.stderr b/testsuite/tests/simplCore/should_compile/T4908.stderr
index ee3418c5bf..6ad89470bb 100644
--- a/testsuite/tests/simplCore/should_compile/T4908.stderr
+++ b/testsuite/tests/simplCore/should_compile/T4908.stderr
@@ -3,6 +3,7 @@
Result size of Tidy Core = {terms: 54, types: 38, coercions: 0}
Rec {
+-- RHS size: {terms: 19, types: 5, coercions: 0}
T4908.f_$s$wf [Occ=LoopBreaker] :: Int# -> Int -> Int# -> Bool
[GblId, Arity=3, Caf=NoCafRefs, Str=DmdType <S,1*U><L,A><L,U>]
T4908.f_$s$wf =
@@ -17,6 +18,7 @@ T4908.f_$s$wf =
}
end Rec }
+-- RHS size: {terms: 24, types: 13, coercions: 0}
T4908.$wf [InlPrag=[0]] :: Int# -> (Int, Int) -> Bool
[GblId,
Arity=2,
@@ -39,6 +41,7 @@ T4908.$wf =
0# -> True
}
+-- RHS size: {terms: 8, types: 6, coercions: 0}
f [InlPrag=INLINE[0]] :: Int -> (Int, Int) -> Bool
[GblId,
Arity=2,
diff --git a/testsuite/tests/simplCore/should_compile/T4930.stderr b/testsuite/tests/simplCore/should_compile/T4930.stderr
index faf513477d..3e140ddc92 100644
--- a/testsuite/tests/simplCore/should_compile/T4930.stderr
+++ b/testsuite/tests/simplCore/should_compile/T4930.stderr
@@ -2,14 +2,17 @@
==================== Tidy Core ====================
Result size of Tidy Core = {terms: 23, types: 11, coercions: 0}
+-- RHS size: {terms: 2, types: 0, coercions: 0}
lvl :: [Char]
[GblId, Str=DmdType]
lvl = unpackCString# "Too small"#
+-- RHS size: {terms: 2, types: 1, coercions: 0}
T4930.foo1 :: Int
[GblId, Str=DmdType b]
T4930.foo1 = error @ Int lvl
+-- RHS size: {terms: 16, types: 5, coercions: 0}
foo :: Int -> Int
[GblId,
Arity=1,
diff --git a/testsuite/tests/simplCore/should_compile/T7360.stderr b/testsuite/tests/simplCore/should_compile/T7360.stderr
index ec3c4b08fb..f7979075ac 100644
--- a/testsuite/tests/simplCore/should_compile/T7360.stderr
+++ b/testsuite/tests/simplCore/should_compile/T7360.stderr
@@ -2,6 +2,7 @@
==================== Tidy Core ====================
Result size of Tidy Core = {terms: 36, types: 29, coercions: 0}
+-- RHS size: {terms: 6, types: 3, coercions: 0}
T7360.$WFoo3 [InlPrag=INLINE] :: Int -> Foo
[GblId[DataConWrapper],
Arity=1,
@@ -16,10 +17,12 @@ T7360.$WFoo3 =
\ (dt [Occ=Once!] :: Int) ->
case dt of _ [Occ=Dead] { I# dt [Occ=Once] -> T7360.Foo3 dt }
+-- RHS size: {terms: 5, types: 2, coercions: 0}
fun1 [InlPrag=NOINLINE] :: Foo -> ()
[GblId, Arity=1, Caf=NoCafRefs, Str=DmdType <S,1*U>]
fun1 = \ (x :: Foo) -> case x of _ [Occ=Dead] { __DEFAULT -> () }
+-- RHS size: {terms: 2, types: 0, coercions: 0}
T7360.fun5 :: ()
[GblId,
Str=DmdType,
@@ -27,6 +30,7 @@ T7360.fun5 :: ()
WorkFree=False, Expandable=False, Guidance=IF_ARGS [] 20 0}]
T7360.fun5 = fun1 T7360.Foo1
+-- RHS size: {terms: 2, types: 0, coercions: 0}
T7360.fun4 :: Int
[GblId,
Caf=NoCafRefs,
@@ -35,6 +39,7 @@ T7360.fun4 :: Int
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
T7360.fun4 = I# 0#
+-- RHS size: {terms: 16, types: 12, coercions: 0}
fun2 :: forall a. [a] -> ((), Int)
[GblId,
Arity=1,
diff --git a/testsuite/tests/simplCore/should_compile/T9400.stderr b/testsuite/tests/simplCore/should_compile/T9400.stderr
index 2600dd00ba..5216d1ed5f 100644
--- a/testsuite/tests/simplCore/should_compile/T9400.stderr
+++ b/testsuite/tests/simplCore/should_compile/T9400.stderr
@@ -2,6 +2,7 @@
==================== Tidy Core ====================
Result size of Tidy Core = {terms: 23, types: 16, coercions: 0}
+-- RHS size: {terms: 22, types: 14, coercions: 0}
main :: IO ()
[GblId, Str=DmdType]
main =
diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T
index ee2f63170b..b675077fda 100644
--- a/testsuite/tests/simplCore/should_compile/all.T
+++ b/testsuite/tests/simplCore/should_compile/all.T
@@ -106,6 +106,10 @@ test('T4918',
run_command,
['$MAKE -s --no-print-directory T4918'])
+# This test flips too and fro about whether it passes
+# I'm not sure why it is so delicate, but it greps the
+# result of -ddump-simpl, which is never advertised to
+# be very stable
test('T4945',
expect_broken(4945),
run_command,
@@ -214,3 +218,8 @@ test('T10176', only_ways(['optasm']), compile, [''])
test('T10180', only_ways(['optasm']), compile, [''])
test('T10602', only_ways(['optasm']), multimod_compile, ['T10602','-v0'])
test('T10627', only_ways(['optasm']), compile, [''])
+test('T10181', [expect_broken(10181), only_ways(['optasm'])], compile, [''])
+test('T10083',
+ expect_broken(10083),
+ run_command,
+ ['$MAKE -s --no-print-directory T10083'])
diff --git a/testsuite/tests/simplCore/should_compile/spec-inline.stderr b/testsuite/tests/simplCore/should_compile/spec-inline.stderr
index 4bc2226554..392d4fba73 100644
--- a/testsuite/tests/simplCore/should_compile/spec-inline.stderr
+++ b/testsuite/tests/simplCore/should_compile/spec-inline.stderr
@@ -2,12 +2,14 @@
==================== Tidy Core ====================
Result size of Tidy Core = {terms: 162, types: 61, coercions: 0}
+-- RHS size: {terms: 2, types: 1, coercions: 0}
Roman.foo3 :: Int
[GblId, Str=DmdType b]
Roman.foo3 =
patError @ Int "spec-inline.hs:(19,5)-(29,25)|function go"#
Rec {
+-- RHS size: {terms: 55, types: 9, coercions: 0}
Roman.foo_$s$wgo [Occ=LoopBreaker] :: Int# -> Int# -> Int#
[GblId, Arity=2, Caf=NoCafRefs, Str=DmdType <L,U><L,U>]
Roman.foo_$s$wgo =
@@ -30,6 +32,7 @@ Roman.foo_$s$wgo =
}
end Rec }
+-- RHS size: {terms: 74, types: 22, coercions: 0}
Roman.$wgo [InlPrag=[0]] :: Maybe Int -> Maybe Int -> Int#
[GblId,
Arity=2,
@@ -67,6 +70,7 @@ Roman.$wgo =
}
}
+-- RHS size: {terms: 9, types: 5, coercions: 0}
Roman.foo_go [InlPrag=INLINE[0]] :: Maybe Int -> Maybe Int -> Int
[GblId,
Arity=2,
@@ -80,6 +84,7 @@ Roman.foo_go =
\ (w :: Maybe Int) (w1 :: Maybe Int) ->
case Roman.$wgo w w1 of ww { __DEFAULT -> I# ww }
+-- RHS size: {terms: 2, types: 0, coercions: 0}
Roman.foo2 :: Int
[GblId,
Caf=NoCafRefs,
@@ -88,6 +93,7 @@ Roman.foo2 :: Int
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
Roman.foo2 = I# 6#
+-- RHS size: {terms: 2, types: 1, coercions: 0}
Roman.foo1 :: Maybe Int
[GblId,
Caf=NoCafRefs,
@@ -96,6 +102,7 @@ Roman.foo1 :: Maybe Int
WorkFree=True, Expandable=True, Guidance=IF_ARGS [] 10 20}]
Roman.foo1 = Just @ Int Roman.foo2
+-- RHS size: {terms: 11, types: 4, coercions: 0}
foo :: Int -> Int
[GblId,
Arity=1,