summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/T22277.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/simplCore/should_compile/T22277.hs')
-rw-r--r--testsuite/tests/simplCore/should_compile/T22277.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T22277.hs b/testsuite/tests/simplCore/should_compile/T22277.hs
new file mode 100644
index 0000000000..16a990b0b4
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T22277.hs
@@ -0,0 +1,16 @@
+{-# OPTIONS_GHC -O2 -fforce-recomp #-}
+
+module T22277 where
+
+entry :: Int -> Int
+entry n = case n of
+ 0 -> f n (13,24)
+ _ -> f n (n,n)
+ where
+ f :: Int -> (Int,Int) -> Int
+ f m x = g m x
+ where
+ exit m = (length $ reverse $ reverse $ reverse $ reverse $ [0..m]) + n
+ g n p | even n = exit n
+ | n > 43 = g (n-1) p
+ | otherwise = fst p