Commit d793a148 authored by tibbe's avatar tibbe
Browse files

Add perf test for inline array allocation

parent d8b38265
{-# 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', () #)
...@@ -331,3 +331,9 @@ test('T7619', ...@@ -331,3 +331,9 @@ test('T7619',
compile_and_run, compile_and_run,
['-O']) ['-O'])
test('InlineArrayAlloc',
[stats_num_field('bytes allocated',
[ (wordsize(64), 1600040960, 5)]),
only_ways(['normal'])],
compile_and_run,
['-O2'])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment