Follow changes in comparison primops (see #6135)
[ghc.git] / testsuite / tests / codeGen / should_run / T2080.hs
1 {-# OPTIONS_GHC -XMagicHash #-}
2 module Main where
3 import GHC.Base
4
5 import Foreign
6 import Foreign.C
7 import GHC.Ptr (Ptr(..))
8
9 utf8DecodeChar# :: Addr# -> Bool -> Bool
10 {-# NOINLINE utf8DecodeChar# #-}
11 utf8DecodeChar# a# fred =
12 case () of
13 _ | isTrue# (word2Int# (indexWord8OffAddr# a# 0#) <=# 0x7F#) -> True
14
15 -- Omitting the next line gives an ASSERT error:
16 -- ghc-6.9: panic! (the 'impossible' happened)
17 -- (GHC version 6.9 for x86_64-unknown-linux):
18 -- ASSERT failed! file nativeGen/MachCodeGen.hs line 1049
19 -- %MO_S_Le_I8(I8[R2], 127 :: I8)
20 | fred -> True
21
22 | otherwise -> False
23
24 main = print (utf8DecodeChar# "\128"# False) -- should be False
25