Commit 1126e694 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari
Browse files

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
parent e7322107
......@@ -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) }
......
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