summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/sigs/T21888a.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/stranal/sigs/T21888a.hs')
-rw-r--r--testsuite/tests/stranal/sigs/T21888a.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/sigs/T21888a.hs b/testsuite/tests/stranal/sigs/T21888a.hs
new file mode 100644
index 0000000000..6a72d89ec1
--- /dev/null
+++ b/testsuite/tests/stranal/sigs/T21888a.hs
@@ -0,0 +1,19 @@
+module T21888a where
+
+-- This tests case (B) of
+-- Note [No lazy, Unboxed demands in demand signature]
+-- in GHC.Core.Opt.DmdAnal
+
+-- We should get a worker-wrapper split on g
+-- and on wombat, even though f uses x unboxed
+
+{-# NOINLINE f #-}
+f x = Just x
+
+wombat :: Int -> a
+wombat x = error (show (f x))
+
+g :: Bool -> Int -> Int
+g True x | x>0 = g True (x-1)
+ | otherwise = x+1
+g False x = wombat x