diff options
author | Peter Trommler <ptrommler@acm.org> | 2015-11-11 12:32:19 +0100 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2015-11-11 12:32:33 +0100 |
commit | fb0d5120d383324c6934144b938525378e3ade75 (patch) | |
tree | b01c3b34f7b342efcd471c0d5a5db75fe9d3eae2 /testsuite/tests | |
parent | badf5d54907a5a5e9224c44310f991a52379b4c1 (diff) | |
download | haskell-fb0d5120d383324c6934144b938525378e3ade75.tar.gz |
nativeGen.PPC: Fix shift arith. right > 31 bits
Arithmetic right shifts of more than 31 bits set all bits to
the sign bit on PowerPC. iThe assembler does not allow shift
amounts larger than 32 so do an arithemetic right shift of 31
bit instead.
Fixes #10870
Test Plan: validate (especially on powerpc)
Reviewers: austin, erikd, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D1459
GHC Trac Issues: #10870
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/codeGen/should_run/T10870.hs | 1 | ||||
-rw-r--r-- | testsuite/tests/codeGen/should_run/T10870.stdout | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/testsuite/tests/codeGen/should_run/T10870.hs b/testsuite/tests/codeGen/should_run/T10870.hs index 642ef2c1ff..255f5780dd 100644 --- a/testsuite/tests/codeGen/should_run/T10870.hs +++ b/testsuite/tests/codeGen/should_run/T10870.hs @@ -8,4 +8,5 @@ unsafeShift32R x = unsafeShiftR x 32 main :: IO () main = do print $ map unsafeShift32R [ 123456, 0x7fffffff :: Int ] + print $ map unsafeShift32R [ -123456, -0x80000000 :: Int ] print $ map unsafeShift32R [ 123456, 0xffffffff :: Word ] diff --git a/testsuite/tests/codeGen/should_run/T10870.stdout b/testsuite/tests/codeGen/should_run/T10870.stdout index 945f244e36..54b015cbda 100644 --- a/testsuite/tests/codeGen/should_run/T10870.stdout +++ b/testsuite/tests/codeGen/should_run/T10870.stdout @@ -1,2 +1,3 @@ [0,0] +[-1,-1] [0,0] |