summaryrefslogtreecommitdiff
path: root/testsuite/tests/eyeball/inline3.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/eyeball/inline3.hs')
-rw-r--r--testsuite/tests/eyeball/inline3.hs35
1 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/tests/eyeball/inline3.hs b/testsuite/tests/eyeball/inline3.hs
new file mode 100644
index 0000000000..1bde5f722a
--- /dev/null
+++ b/testsuite/tests/eyeball/inline3.hs
@@ -0,0 +1,35 @@
+{-# OPTIONS_GHC -fglasgow-exts -O -ddump-simpl #-}
+module Roman where
+
+foo :: Int -> Maybe Int -> Int
+foo 0 (Just n) = n
+foo 0 Nothing = 1
+foo n p = let f = foo (n-1+n-1+n-1+n-1+n-1+n-1+n-1+n-1)
+ in
+ case p of { Just m -> f (Just m); Nothing -> f Nothing }
+
+
+{- At one time this oddly produced;
+
+ foo = \n p ->
+ case n of ds {
+ __DEFAULT ->
+ let
+ x = ds -# 1 +# ds -# 1 +# ds -# 1 +# ds -# 1 +# ds -# 1
+ in
+ case p of {
+ Nothing ->
+ foo (x +# ds -# 1 +# ds -# 1 +# ds -# 1) Nothing
+ ;
+ Just m ->
+ foo (x +# ds -# 1 +# ds -# 1 +# ds -# 1) (Just m)
+ };
+ 0 ->
+ case p of {
+ Nothing -> lvl_sbC; Just n -> n
+ }
+ }
+
+But it shouldn't; and doesn't now.
+
+-}