testsuite: Make T10245 pass on 32-bit platforms
authorBen Gamari <ben@smart-cactus.org>
Fri, 24 Mar 2017 15:36:31 +0000 (11:36 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 26 Mar 2017 22:09:52 +0000 (18:09 -0400)
testsuite/tests/codeGen/should_run/T10245.hs
testsuite/tests/codeGen/should_run/T10245.stdout-ws-32 [new file with mode: 0644]
testsuite/tests/codeGen/should_run/T10245.stdout-ws-64 [moved from testsuite/tests/codeGen/should_run/T10245.stdout with 100% similarity]

index 7094a1d..43383a3 100644 (file)
@@ -1,11 +1,23 @@
+{-# LANGUAGE CPP #-}
+
+#include "MachDeps.h"
+
 f :: Int -> String
 f n = case n of
+#if WORD_SIZE_IN_BITS == 64
   0x8000000000000000 -> "yes"
+#else
+  0x80000000 -> "yes"
+#endif
   _ -> "no"
 {-# NOINLINE f #-}
 
 main = do
+#if WORD_SIZE_IN_BITS == 64
     let string = "0x8000000000000000"
+#else
+    let string = "0x80000000"
+#endif
     let i = read string :: Integer
     let i' = fromIntegral i :: Int
     print i
diff --git a/testsuite/tests/codeGen/should_run/T10245.stdout-ws-32 b/testsuite/tests/codeGen/should_run/T10245.stdout-ws-32
new file mode 100644 (file)
index 0000000..a6c8f1f
--- /dev/null
@@ -0,0 +1,3 @@
+2147483648
+-2147483648
+"yes"