summaryrefslogtreecommitdiff
path: root/testsuite/tests/generics
diff options
context:
space:
mode:
authorRyanGlScott <ryan.gl.scott@gmail.com>2015-12-29 13:43:52 +0100
committerBen Gamari <ben@smart-cactus.org>2015-12-29 14:13:34 +0100
commit8e735fd0f88454b74fbb866a59b608925a2b3e48 (patch)
tree5e1f4db982fb8d72450799dfce68f4049ada5cf1 /testsuite/tests/generics
parent5bb7fecb09f828ea41e5b5a295ea159fa405dcc5 (diff)
downloadhaskell-8e735fd0f88454b74fbb866a59b608925a2b3e48.tar.gz
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
Diffstat (limited to 'testsuite/tests/generics')
-rw-r--r--testsuite/tests/generics/GEq/GEq1.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/testsuite/tests/generics/GEq/GEq1.hs b/testsuite/tests/generics/GEq/GEq1.hs
index d6ca0b057e..54867db8ed 100644
--- a/testsuite/tests/generics/GEq/GEq1.hs
+++ b/testsuite/tests/generics/GEq/GEq1.hs
@@ -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