Skip to content
Snippets Groups Projects
Commit d793a148 authored by tibbe's avatar tibbe
Browse files

Add perf test for inline array allocation

parent d8b38265
No related branches found
No related tags found
No related merge requests found
{-# 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',
compile_and_run,
['-O'])
test('InlineArrayAlloc',
[stats_num_field('bytes allocated',
[ (wordsize(64), 1600040960, 5)]),
only_ways(['normal'])],
compile_and_run,
['-O2'])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment