summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/perf/should_run/T19474.hs15
-rw-r--r--testsuite/tests/perf/should_run/all.T4
2 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/perf/should_run/T19474.hs b/testsuite/tests/perf/should_run/T19474.hs
new file mode 100644
index 0000000000..8379a4debd
--- /dev/null
+++ b/testsuite/tests/perf/should_run/T19474.hs
@@ -0,0 +1,15 @@
+module T19474 where
+
+import Control.Monad
+import qualified Data.Vector.Storable.Mutable as M
+
+main = do
+ v <- M.new 1
+ forM_ [0..10000] $ \some -> do
+ addSome v 0 some
+ M.unsafeRead v 0 >>= print
+
+addSome :: M.IOVector Int -> Int -> Int -> IO ()
+addSome m idx some = do
+ val <- M.unsafeRead m idx
+ M.unsafeWrite m idx $ val + some
diff --git a/testsuite/tests/perf/should_run/all.T b/testsuite/tests/perf/should_run/all.T
index d7257472e2..6e603b46f4 100644
--- a/testsuite/tests/perf/should_run/all.T
+++ b/testsuite/tests/perf/should_run/all.T
@@ -395,3 +395,7 @@ test('T19347',
compile_and_run,
['-O'])
+test ('T19474',
+ [ collect_stats('bytes allocated', 5), reqlib('vector') ],
+ compile_and_run,
+ ['-v0 -O'])