summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal/sigs/T16197b.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/stranal/sigs/T16197b.hs')
-rw-r--r--testsuite/tests/stranal/sigs/T16197b.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/sigs/T16197b.hs b/testsuite/tests/stranal/sigs/T16197b.hs
new file mode 100644
index 0000000000..4ce440d3bf
--- /dev/null
+++ b/testsuite/tests/stranal/sigs/T16197b.hs
@@ -0,0 +1,12 @@
+-- | The same as T16197, but a bit more distilled.
+-- Important takeaway: The signature of `f` may not say "strict in the Bool
+-- field of T", otherwise the Simplifier will drop the `seq` on the `Bool` at
+-- call sites after unboxing the `T`.
+module T16197b where
+
+data T = T !Bool
+data Box a = Box a
+
+f :: T -> Box Bool
+f (T b) = Box b
+{-# NOINLINE f #-} -- I like NOINLINE better than artificial recursion, YMMV