Follow changes in comparison primops (see #6135)
[ghc.git] / testsuite / tests / simplCore / should_run / T5453.hs
1 {-# LANGUAGE MagicHash #-}
2 module Main where
3
4 import GHC.Exts
5
6 data Var = TyVar !Int Bool Bool
7 | TcTyVar Bool !Int Bool
8 | Var Bool Bool !Int
9 deriving (Show)
10
11 scrut :: Var -> (Bool, String)
12 scrut v = (True, case v of
13 TcTyVar {} -> "OK"
14 _ -> show v ++ show (case (case v of
15 TyVar b _ _ -> b
16 Var _ _ b -> b) of
17 I# x# -> if isTrue# (x# ==# 7#)
18 then show (I# (x# +# 1#))
19 else show (I# (x# +# 2#))))
20
21 main = putStrLn $ snd (scrut (TcTyVar True 1 False))