diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-06-05 09:31:13 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-06-05 09:31:13 +0100 |
commit | 3ae71382184b5770940dd5069c0435316b6e6972 (patch) | |
tree | 7479e3faaec5a8e9c46b286c177a2b40ef33812a /testsuite | |
parent | ac2bc9c83ce5c53f5e2ff66589b9d97f79d816f0 (diff) | |
parent | 12e5c1e7d8f75f0626950dca72810829cc05ced6 (diff) | |
download | haskell-3ae71382184b5770940dd5069c0435316b6e6972.tar.gz |
Merge branch 'master' of http://darcs.haskell.org/testsuite
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/tests/codeGen/should_run/setByteArray.hs | 23 | ||||
-rw-r--r-- | testsuite/tests/perf/compiler/all.T | 2 |
2 files changed, 24 insertions, 1 deletions
diff --git a/testsuite/tests/codeGen/should_run/setByteArray.hs b/testsuite/tests/codeGen/should_run/setByteArray.hs new file mode 100644 index 0000000000..099376cb4b --- /dev/null +++ b/testsuite/tests/codeGen/should_run/setByteArray.hs @@ -0,0 +1,23 @@ +{-# LANGUAGE BangPatterns, MagicHash, UnboxedTuples #-} +{-# OPTIONS_GHC -Wall #-} + +module Main ( main ) where + +import GHC.Base + +data BA = BA ByteArray# + +-- Checks that setByteArray# works +main :: IO () +main = do BA ba <- IO $ \s0 -> + case newByteArray# 8# s0 of + (# !s1, !mba #) -> + case setByteArray# mba 0# 8# 65# s1 of + !s2 -> + case setByteArray# mba 1# 6# 67# s2 of + !s3 -> + case unsafeFreezeByteArray# mba s3 of + (# s4, ba #) -> (# s4, BA ba #) + let f (I# i) = putStrLn [C# (indexCharArray# ba i)] + mapM_ f [0..7] + diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 373fc5d0ee..ae7f8c43bb 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -253,6 +253,6 @@ test('T6048', compiler_stats_range_field('bytes allocated', 38000000, 10)), if_wordsize(64, - compiler_stats_range_field('bytes allocated', 77000000, 10)) + compiler_stats_range_field('bytes allocated', 67328320, 10)) ], compile,['']) |