summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_fail/T13233.hs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-06-21 12:42:53 -0400
committerBen Gamari <ben@smart-cactus.org>2019-06-23 14:12:04 -0400
commit4ae71eba8c1f680f3163fa27fd83cc5a5214770a (patch)
treeeeeacdd08cf0250a5ae07b99ccff63d3ab1e9650 /testsuite/tests/codeGen/should_fail/T13233.hs
parentcd753410da64bc1c2b1e8a9dc0331e96f4990004 (diff)
downloadhaskell-4ae71eba8c1f680f3163fa27fd83cc5a5214770a.tar.gz
Don't eta-expand unsaturated primopswip/T16846
Previously, as described in Note [Primop wrappers], `hasNoBinding` would return False in the case of `PrimOpId`s. This would result in eta expansion of unsaturated primop applications during CorePrep. Not only did this expansion result in unnecessary allocations, but it also meant lead to rather nasty inconsistencies between the CAFfy-ness determinations made by TidyPgm and CorePrep. This fixes #16846.
Diffstat (limited to 'testsuite/tests/codeGen/should_fail/T13233.hs')
-rw-r--r--testsuite/tests/codeGen/should_fail/T13233.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_fail/T13233.hs b/testsuite/tests/codeGen/should_fail/T13233.hs
index f24fc03bfb..a8d2343e65 100644
--- a/testsuite/tests/codeGen/should_fail/T13233.hs
+++ b/testsuite/tests/codeGen/should_fail/T13233.hs
@@ -21,6 +21,9 @@ obscure _ = ()
quux :: ()
quux = obscure (#,#)
+-- It used to be that primops has no binding. However, as described in
+-- Note [Primop wrappers] in PrimOp we now rewrite unsaturated primop
+-- applications to their wrapper, which allows safe use of levity polymorphism.
primop :: forall (rep :: RuntimeRep) (a :: TYPE rep) b c.
a -> b -> (State# RealWorld -> (# State# RealWorld, c #))
-> State# RealWorld -> (# State# RealWorld, Weak# b #)