Skip to content

cgrun072 (optllvm) failing

  • Platform: OS X 10.8.4 x86_64
  • GHC Version 7.7.20130904 (built with gcc-4.8)

To reproduce this:

$ make test TEST=cgrun072 WAY=optllvm

Expected output (for failure):

=====> cgrun072(optllvm) 172 of 3749 [0, 0, 2]
cd ./codeGen/should_run && '/Users/leroux/Dropbox/src/ghc/ghc-validate/inplace/bin/ghc-stage2' -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-package-db -rtsopts -fno-ghci-history -o cgrun072 cgrun072.hs -O -fllvm   >cgrun072.comp.stderr 2>&1
cd ./codeGen/should_run && ./cgrun072    </dev/null >cgrun072.run.stdout 2>cgrun072.run.stderr
Actual stdout output differs from expected:
--- ./codeGen/should_run/cgrun072.stdout	2013-09-04 02:22:32.000000000 -0500
+++ ./codeGen/should_run/cgrun072.run.stdout	2013-09-07 03:27:09.000000000 -0500
@@ -1,3 +1,6 @@
 OK
-OK
+FAIL
+   Input: 1480294021
+Expected: 2239642456
+  Actual: -2055324840
 OK
*** unexpected failure for cgrun072(optllvm)

The failing test case is test_bSwap32.

Here are some relevant snippets. bswap and cgrun072 were added in #7902 (closed).

https://github.com/ghc/testsuite/blob/master/tests/codeGen/should_run/cgrun072.hs:

bswap32 :: Word32 -> Word32
bswap32 (W32# w#) = W32# (byteSwap32# w#)

slowBswap32 :: Word32 -> Word32
slowBswap32 w =
         (w `shiftR` 24)             .|. (w `shiftL` 24)
     .|. ((w `shiftR` 8) .&. 0xff00) .|. ((w .&. 0xff00) `shiftL` 8)

test_bSwap32 = test casesW32 bswap32 slowBswap32

https://github.com/ghc/packages-ghc-prim/blob/master/cbits/bswap.c#L10-L17:

extern StgWord32 hs_bswap32(StgWord32 x);
StgWord32
hs_bswap32(StgWord32 x)
{
  return ((x >> 24) | ((x >> 8) & 0xff00) |
          (x << 24) | ((x & 0xff00) << 8));
}

Here are a few things to look at or try.

Trac metadata
Trac field Value
Version 7.6.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (LLVM)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC leroux@fezrev.com
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information