summaryrefslogtreecommitdiff
path: root/testsuite/tests/perf/should_run/InlineArrayAlloc.hs
blob: 09f3e405864f385885ddc78c27e5811a40c7b8a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples #-}
module Main where

import GHC.Exts
import GHC.IO

main :: IO ()
main = loop 10000000
  where
    loop :: Int -> IO ()
    loop 0 = return ()
    loop i = newArray >> loop (i-1)

newArray :: IO ()
newArray = IO $ \s -> case newArray# 16# () s of
    (# s', _ #) -> (# s', () #)