Commit 8e735fd0 authored by Ryan Scott's avatar Ryan Scott Committed by Ben Gamari
Browse files

Fix GEq1 when optimizations are enabled

When optimizations are enabled, primitive string literals can be
inlined, which can create two copies of a string constant with different
addresses. We want to avoid this behavior at all costs in the `GEq1`
test, since the output depends on the result of `eqAddr#`. We prevent
such inlining through use of the `{-# NOINLINE #-}` pragma.

Fixes #11292.

Test Plan: Validate with T11292

Reviewers: thomie, austin, bgamari

Reviewed By: bgamari

Differential Revision: https://phabricator.haskell.org/D1714

GHC Trac Issues: #11292
parent 5bb7fecb
......@@ -46,9 +46,11 @@ f2 = F 0.0 4 'h'
u0 :: U Int
u0 = U 1 "1"# '1'# 1.0## 1.0# 1# 1##
{-# NOINLINE u0 #-}
uf0 :: UF Int Int Int
uf0 = UF 2 2 "1"# '2'# 2.0## 2.0# 2# 2##
{-# NOINLINE uf0 #-}
-- Generic instances
instance GEq C
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment