Make Block.h compile with c++ compilers
[ghc.git] / testsuite / tests / perf / should_run / InlineByteArrayAlloc.hs
1 {-# LANGUAGE MagicHash, UnboxedTuples #-}
2 module Main where
3
4 import GHC.Exts
5 import GHC.IO
6
7 main :: IO ()
8 main = loop 10000000
9 where
10 loop :: Int -> IO ()
11 loop 0 = return ()
12 loop i = newByteArray >> loop (i-1)
13
14 newByteArray :: IO ()
15 newByteArray = IO $ \s -> case newByteArray# 128# s of
16 (# s', _ #) -> (# s', () #)