diff options
author | Kevin Buhr <buhr@asaurus.net> | 2019-05-09 19:56:53 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-05-22 16:45:08 -0400 |
commit | 78c3f3305e173c7667ffb47b97ff0ecacc279fe5 (patch) | |
tree | b576828e34fa7ac38fd7973426ab0104835105c3 /testsuite/tests/numeric/should_run | |
parent | ddae344e80eee3044f773061126937a69d16c957 (diff) | |
download | haskell-78c3f3305e173c7667ffb47b97ff0ecacc279fe5.tar.gz |
Add regression test for old Word32 arithmetic issue (#497)
Diffstat (limited to 'testsuite/tests/numeric/should_run')
-rw-r--r-- | testsuite/tests/numeric/should_run/T497.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/numeric/should_run/T497.stdout | 2 | ||||
-rw-r--r-- | testsuite/tests/numeric/should_run/all.T | 1 |
3 files changed, 15 insertions, 0 deletions
diff --git a/testsuite/tests/numeric/should_run/T497.hs b/testsuite/tests/numeric/should_run/T497.hs new file mode 100644 index 0000000000..9605b4e121 --- /dev/null +++ b/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 diff --git a/testsuite/tests/numeric/should_run/T497.stdout b/testsuite/tests/numeric/should_run/T497.stdout new file mode 100644 index 0000000000..664b67d742 --- /dev/null +++ b/testsuite/tests/numeric/should_run/T497.stdout @@ -0,0 +1,2 @@ +4294967295 +18446744073709551615 diff --git a/testsuite/tests/numeric/should_run/all.T b/testsuite/tests/numeric/should_run/all.T index a966038fa4..cf2e2ea8d6 100644 --- a/testsuite/tests/numeric/should_run/all.T +++ b/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']) |