summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2018-04-23 10:41:38 -0400
committerBen Gamari <ben@smart-cactus.org>2018-04-24 09:55:01 -0400
commit1126e6942624f4e6578e59b2a28b9848ad9fcea2 (patch)
tree4f0cd3338b56398f04af6aff1dfe958aa700c3bf
parente7322107d3647e5d3097eeca878e036b1c98557b (diff)
downloadhaskell-1126e6942624f4e6578e59b2a28b9848ad9fcea2.tar.gz
testsuite: Fix overflow in T13623 on 32-bit machines
We simply truncate the result to 32-bits to ensure that the test passed under both environments. Test Plan: Validate on 32-bit Subscribers: thomie, carter GHC Trac Issues: #13623 Differential Revision: https://phabricator.haskell.org/D4615
-rw-r--r--testsuite/tests/perf/should_run/T13623.hs5
-rw-r--r--testsuite/tests/perf/should_run/T13623.stdout2
2 files changed, 5 insertions, 2 deletions
diff --git a/testsuite/tests/perf/should_run/T13623.hs b/testsuite/tests/perf/should_run/T13623.hs
index 7a048b2a36..83004f32ac 100644
--- a/testsuite/tests/perf/should_run/T13623.hs
+++ b/testsuite/tests/perf/should_run/T13623.hs
@@ -4,6 +4,7 @@
module Main where
+import Data.Int
import GHC.Types
@@ -16,7 +17,9 @@ foo = \i j -> sfoldl' (+) 0 $ xs i j +++ ys i j
{-# Inline foo #-}
-main = do { n <- foo 1 1; print n }
+-- We narrow the result to 32-bits to account for the fact that this overflows
+-- on 32-bit machines.
+main = do { n <- foo 1 1; print (fromIntegral n :: Int32) }
diff --git a/testsuite/tests/perf/should_run/T13623.stdout b/testsuite/tests/perf/should_run/T13623.stdout
index ac3eff3654..c94819c4ba 100644
--- a/testsuite/tests/perf/should_run/T13623.stdout
+++ b/testsuite/tests/perf/should_run/T13623.stdout
@@ -1 +1 @@
-65000250000
+575740560