summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/T15056a.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/simplCore/should_compile/T15056a.hs')
-rw-r--r--testsuite/tests/simplCore/should_compile/T15056a.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T15056a.hs b/testsuite/tests/simplCore/should_compile/T15056a.hs
new file mode 100644
index 0000000000..6883a90e4b
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T15056a.hs
@@ -0,0 +1,11 @@
+module T15056a where
+
+test :: Int -> Bool
+test 0 = True
+test n = test (n-1)
+
+foo :: Foldable t => Int -> t Int -> Int
+foo n xs | test n
+ = foldr (+) n xs
+ | otherwise
+ = n+7