summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_fail/CheckBoundsCompareByteArray3.hs
blob: 8a7dcd31232321052232930b352112b7fff4ce0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE NondecreasingIndentation  #-}
{-# LANGUAGE UnboxedTuples #-}
{-# LANGUAGE MagicHash #-}

module Main where

import GHC.Exts
import GHC.IO

main :: IO ()
main = do
    IO $ \s0 ->
      case newByteArray# 4# s0 of
        (# s1, a_marr #) -> case newByteArray# 4# s1 of
          (# s2, b_marr #) -> case unsafeFreezeByteArray# a_marr s2 of
            (# s3, a_arr #) -> case unsafeFreezeByteArray# b_marr s2 of
              (# s4, b_arr #) -> case compareByteArrays# a_arr 2# b_arr 3# (-1#) of
                0# -> (# s4, () #)