[Git][ghc/ghc][master] Add regression test for old Word32 arithmetic issue (#497)

Marge Bot gitlab at gitlab.haskell.org
Wed May 22 20:48:40 UTC 2019



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
78c3f330 by Kevin Buhr at 2019-05-22T20:45:08Z
Add regression test for old Word32 arithmetic issue (#497)

- - - - -


3 changed files:

- + testsuite/tests/numeric/should_run/T497.hs
- + testsuite/tests/numeric/should_run/T497.stdout
- testsuite/tests/numeric/should_run/all.T


Changes:

=====================================
testsuite/tests/numeric/should_run/T497.hs
=====================================
@@ -0,0 +1,12 @@
+import Data.Word
+
+-- #497: using -O should not make these == 1
+main = do
+  print $ q * 2 + 1
+  print $ q' * 2 + 1
+
+q :: Word32
+q = 0x7FFFFFFF
+
+q' :: Word64
+q' = 0x7FFFFFFFFFFFFFFF


=====================================
testsuite/tests/numeric/should_run/T497.stdout
=====================================
@@ -0,0 +1,2 @@
+4294967295
+18446744073709551615


=====================================
testsuite/tests/numeric/should_run/all.T
=====================================
@@ -67,3 +67,4 @@ test('T10962', omit_ways(['ghci']), compile_and_run, ['-O2'])
 test('T11702', extra_ways(['optasm']), compile_and_run, [''])
 test('T12136', normal, compile_and_run, [''])
 test('T15301', normal, compile_and_run, ['-O2'])
+test('T497', normal, compile_and_run, ['-O'])



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/78c3f3305e173c7667ffb47b97ff0ecacc279fe5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/78c3f3305e173c7667ffb47b97ff0ecacc279fe5
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20190522/1844ebc5/attachment.html>


More information about the ghc-commits mailing list