summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_compile/T23307c.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simon.peytonjones@gmail.com>2023-04-28 00:29:04 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-05-13 14:58:34 -0400
commit902f0730b4c50f39b7767a346be324c98bf7a8a6 (patch)
treef811093f39fa207770c6f24e97f76bbf4e68e588 /testsuite/tests/simplCore/should_compile/T23307c.hs
parent8a0d45f7d846e92cf4b6641fd8c67606412cdb3a (diff)
downloadhaskell-902f0730b4c50f39b7767a346be324c98bf7a8a6.tar.gz
Make GHC.Types.Id.Make.shouldUnpackTy a bit more clever
As #23307, GHC.Types.Id.Make.shouldUnpackTy was leaving money on the table, failing to unpack arguments that are perfectly unpackable. The fix is pretty easy; see Note [Recursive unboxing]
Diffstat (limited to 'testsuite/tests/simplCore/should_compile/T23307c.hs')
-rw-r--r--testsuite/tests/simplCore/should_compile/T23307c.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/testsuite/tests/simplCore/should_compile/T23307c.hs b/testsuite/tests/simplCore/should_compile/T23307c.hs
new file mode 100644
index 0000000000..a0d4de1cfa
--- /dev/null
+++ b/testsuite/tests/simplCore/should_compile/T23307c.hs
@@ -0,0 +1,7 @@
+module Foo where
+
+newtype Identity x = MkId x
+newtype Fix f = MkFix (f (Fix f))
+
+-- This test just checks that the compiler itself doesn't loop
+data Loop = LCon {-# UNPACK #-} !(Fix Identity)