Merge branch 'master' into atomics
[ghc.git] / testsuite / tests / simplCore / should_compile / T5658b.hs
1 {-# LANGUAGE MagicHash, BangPatterns #-}
2 module T5658b where
3 import GHC.Prim
4 import GHC.PrimWrappers
5
6 foo :: ByteArray# -> ByteArray# -> Int# -> Int# -> Bool
7 foo xs ys m n = go 0# 0#
8 where
9 go i j = case i >=# m of
10 False -> let !x = indexIntArray# xs i in
11 case j >=# n of
12 False -> case x ==# indexIntArray# ys j of
13 False -> False
14 True -> go (i +# 1#) (j +# 1#)
15 True -> False
16 True -> case j >=# n of
17 False -> let !y = indexIntArray# ys i in False
18 True -> True