summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore
diff options
context:
space:
mode:
authorSimon Peyton Jones <simon.peytonjones@gmail.com>2023-01-10 09:26:08 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-11 22:37:35 -0500
commitb3be0d185b6e597fa517859430cf6d54df04ca46 (patch)
tree6049b36592ab44bacafff1428163f7d7de114442 /testsuite/tests/simplCore
parentf7ceafc96bb8b6b1f3f062d07e0d433defaa9b41 (diff)
downloadhaskell-b3be0d185b6e597fa517859430cf6d54df04ca46.tar.gz
Fix finaliseArgBoxities for OPAQUE function
We never do worker wrapper for OPAQUE functions, so we must zap the unboxing info during strictness analysis. This patch fixes #22502
Diffstat (limited to 'testsuite/tests/simplCore')
-rw-r--r--testsuite/tests/simplCore/should_compile/T22502.hs15
-rw-r--r--testsuite/tests/simplCore/should_compile/all.T1
2 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T22502.hs b/testsuite/tests/simplCore/should_compile/T22502.hs
new file mode 100644
index 0000000000..396e4cab9f
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T22502.hs
@@ -0,0 +1,15 @@
+{-# LANGUAGE MagicHash #-}
+module M where
+
+import GHC.Exts
+import GHC.IO
+
+data T a = MkT !Bool !a
+
+fun :: T a -> IO a
+{-# OPAQUE fun #-}
+fun (MkT _ x) = IO $ \s -> noinline seq# x s
+-- evaluate/seq# should not produce its own eval for x
+-- since it is properly tagged (from a strict field)
+
+-- uses noinline to prevent caseRules from eliding the seq# in Core
diff --git a/testsuite/tests/simplCore/should_compile/all.T b/testsuite/tests/simplCore/should_compile/all.T
index e57bb4cafa..4fd57c5301 100644
--- a/testsuite/tests/simplCore/should_compile/all.T
+++ b/testsuite/tests/simplCore/should_compile/all.T
@@ -463,3 +463,4 @@ test('T22459', normal, compile, [''])
test('T22623', normal, multimod_compile, ['T22623', '-O -v0'])
test('T22662', normal, compile, [''])
test('T22725', normal, compile, ['-O'])
+test('T22502', normal, compile, ['-O'])