From e96a8bf8ae101a91cfebf7be1cf956376b951b43 Mon Sep 17 00:00:00 2001
From: Ben Gamari <ben@smart-cactus.org>
Date: Fri, 24 Mar 2017 12:51:59 -0400
Subject: [PATCH] T229: Rework to pass on 32-bit machines

Previously it failed with,

-T229: Data.Array.Base.safe_scale: Overflow; scale: 4, n: 4611686018427387904
-CallStack (from HasCallStack):
-  error, called at libraries/array/Data/Array/Base.hs ...
+T229: Ix{Int}.index: Index (17) out of range ((0,-1))
---
 tests/T229.hs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/T229.hs b/tests/T229.hs
index 22658521..1d8c157b 100644
--- a/tests/T229.hs
+++ b/tests/T229.hs
@@ -5,5 +5,11 @@ import Data.Word
 main :: IO ()
 main = do
   -- This should fail due to integer overflow
+#if WORD_SIZE == 8
   m <- newArray_ (0,2^62-1) :: IO (IOUArray Int Word32) -- allocates 0 bytes
   readArray m 17 >>= print -- Read some random location in address space
+#else
+  m <- newArray_ (0,2^30-1) :: IO (IOUArray Int Word32) -- allocates 0 bytes
+  readArray m 17 >>= print -- Read some random location in address space
+#endif
+
-- 
GitLab