summaryrefslogtreecommitdiff
path: root/testsuite/tests/callarity
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2014-02-18 11:50:19 +0000
committerJoachim Breitner <mail@joachim-breitner.de>2014-02-18 18:16:55 +0000
commitf347bfeae0d73d248032e32323a63dae8d5af828 (patch)
tree8e688df3a112b2351a54e71dcd556d1a9817dfe3 /testsuite/tests/callarity
parentd51d7efd67fec4fd55b42c95d5a8cf17759b9023 (diff)
downloadhaskell-f347bfeae0d73d248032e32323a63dae8d5af828.tar.gz
Support mutual recursion
Diffstat (limited to 'testsuite/tests/callarity')
-rw-r--r--testsuite/tests/callarity/unittest/CallArity1.hs7
-rw-r--r--testsuite/tests/callarity/unittest/CallArity1.stderr10
2 files changed, 13 insertions, 4 deletions
diff --git a/testsuite/tests/callarity/unittest/CallArity1.hs b/testsuite/tests/callarity/unittest/CallArity1.hs
index 24c85961ba..ddfc8586c9 100644
--- a/testsuite/tests/callarity/unittest/CallArity1.hs
+++ b/testsuite/tests/callarity/unittest/CallArity1.hs
@@ -126,10 +126,15 @@ exprs =
Let (Rec [ (n, mkACase (mkLams [y] $ mkLit 0) (Var d))
, (d, mkACase (mkLams [y] $ mkLit 0) (Var n))]) $
Var n `mkApps` [Var d `mkApps` [Var d `mkApps` [mkLit 0]]]
- , ("mutual recursion (functions), but no thunks (both arity 2 would be good)",) $
+ , ("mutual recursion (functions), but no thunks",) $
Let (Rec [ (go, mkLams [x] (mkACase (mkLams [y] $ mkLit 0) (Var go2 `mkVarApps` [x])))
, (go2, mkLams [x] (mkACase (mkLams [y] $ mkLit 0) (Var go `mkVarApps` [x])))]) $
Var go `mkApps` [go2 `mkLApps` [0,1], mkLit 0]
+ , ("mutual recursion (functions), one boring (d 1 would be bad)",) $
+ mkLet d (f `mkLApps` [0]) $
+ Let (Rec [ (go, mkLams [x, y] (Var d `mkApps` [go2 `mkLApps` [1,2]]))
+ , (go2, mkLams [x] (mkACase (mkLams [y] $ mkLit 0) (Var go `mkVarApps` [x])))]) $
+ Var d `mkApps` [go2 `mkLApps` [0,1]]
]
main = do
diff --git a/testsuite/tests/callarity/unittest/CallArity1.stderr b/testsuite/tests/callarity/unittest/CallArity1.stderr
index 14f0a300e6..eebeaf8d2d 100644
--- a/testsuite/tests/callarity/unittest/CallArity1.stderr
+++ b/testsuite/tests/callarity/unittest/CallArity1.stderr
@@ -7,7 +7,7 @@ nested_go2:
d 1
n 1
d0:
- go 0
+ go 1
d 0
go2 (in case crut):
go 2
@@ -50,6 +50,10 @@ two functions (recursive):
mutual recursion (thunks), called mutiple times (both arity 1 would be bad!):
d 0
n 0
-mutual recursion (functions), but no thunks (both arity 2 would be good):
+mutual recursion (functions), but no thunks:
+ go 2
+ go2 2
+mutual recursion (functions), one boring (d 1 would be bad):
go 0
- go2 0
+ go2 2
+ d 0