summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_gen_asm/bytearray-memset-unroll.hs
blob: b5108d411deba6686845c6169540e3ad3aaff0d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# language MagicHash #-}
{-# language UnboxedTuples #-}

module FillArray
  ( fill
  ) where

import GHC.Exts
import GHC.IO

data ByteArray = ByteArray ByteArray#

fill :: IO ByteArray
fill = IO $ \s0 -> case newByteArray# 24# s0 of
  (# s1, m #) -> case setByteArray# m 0# 23# 1# s1 of
    s2 -> case unsafeFreezeByteArray# m s2 of
          (# s3, r #) -> (# s3, ByteArray r #)