UNREG: fix pprHexVal to emit zeros (#10518)
authorSergei Trofimovich <slyfox@gentoo.org>
Sun, 14 Jun 2015 15:42:03 +0000 (16:42 +0100)
committerSergei Trofimovich <siarheit@google.com>
Sun, 14 Jun 2015 15:42:53 +0000 (16:42 +0100)
commita5084557b0b30faf3f89386ee6ee5a308dae51b1
treebee0c708d008f0d3c65984b7a3fd162b2f1f36cb
parent6e542a62e070b113f95908315c81d01c300d8803
UNREG: fix pprHexVal to emit zeros (#10518)

jakzale on #ghc reported a build failure
when ported GHC on a new target.

The code 'pprHexVal (2^32) W32' emits '0xU'
which is invalid C.

I've introduced bug in
    43f1b2ecd1960fa7377cf55a2b97c66059a701ef
when added literal truncation. That truncation
is a new source of zeros.

Signed-off-by: Sergei Trofimovich <siarheit@google.com>
Test Plan: added test and tested on UNREG ghc

Reviewers: austin

Reviewed By: austin

Subscribers: thomie, bgamari

Differential Revision: https://phabricator.haskell.org/D987

GHC Trac Issues: #10518
compiler/cmm/PprC.hs
testsuite/tests/codeGen/should_compile/T10518.cmm [new file with mode: 0644]
testsuite/tests/codeGen/should_compile/all.T