diff options
Diffstat (limited to 'testsuite/tests/callarity')
-rw-r--r-- | testsuite/tests/callarity/unittest/CallArity1.hs | 5 | ||||
-rw-r--r-- | testsuite/tests/callarity/unittest/CallArity1.stderr | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/testsuite/tests/callarity/unittest/CallArity1.hs b/testsuite/tests/callarity/unittest/CallArity1.hs index a92a73b4f2..b889a2f981 100644 --- a/testsuite/tests/callarity/unittest/CallArity1.hs +++ b/testsuite/tests/callarity/unittest/CallArity1.hs @@ -145,6 +145,11 @@ exprs = Let (Rec [ (x, Var d `mkApps` [go `mkLApps` [1,2]]) , (go, mkLams [x] $ mkACase (mkLams [z] $ Var x) (Var go `mkVarApps` [x]) ) ]) $ Var go `mkApps` [mkLit 0, go `mkLApps` [0,1]] + , ("a thunk (non-function-type), in mutual recursion, causes many calls (d 1 would be bad)",) $ + mkLet d (f `mkLApps` [0]) $ + Let (Rec [ (x, Var go `mkApps` [go `mkLApps` [1,2], go `mkLApps` [1,2]]) + , (go, mkLams [x] $ mkACase (Var d) (Var go `mkVarApps` [x]) ) ]) $ + Var go `mkApps` [mkLit 0, go `mkLApps` [0,1]] , ("a thunk (function type), in mutual recursion, still calls once (d 1 would be good)",) $ mkLet d (f `mkLApps` [0]) $ Let (Rec [ (n, Var go `mkApps` [d `mkLApps` [1]]) diff --git a/testsuite/tests/callarity/unittest/CallArity1.stderr b/testsuite/tests/callarity/unittest/CallArity1.stderr index bd38032499..82cbc2ba01 100644 --- a/testsuite/tests/callarity/unittest/CallArity1.stderr +++ b/testsuite/tests/callarity/unittest/CallArity1.stderr @@ -63,7 +63,11 @@ a thunk (function type), called multiple times, still calls once: a thunk (non-function-type), in mutual recursion, still calls once (d 1 would be good): go 2 x 0 - d 1 + d 0 +a thunk (non-function-type), in mutual recursion, causes many calls (d 1 would be bad): + go 2 + x 0 + d 0 a thunk (function type), in mutual recursion, still calls once (d 1 would be good): go 1 d 1 |