Commit 33b88645 authored by Andreas Klebinger's avatar Andreas Klebinger Committed by Marge Bot

Add regression test for T19474.

In version 0.12.2.0 of vector when used with GHC-9.0 we
rebox values from storeable mutable vectors.

This should catch such a change in the future.
parent 2783d498
Pipeline #33973 canceled with stages
in 32 seconds
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
......@@ -395,3 +395,7 @@ test('T19347',
compile_and_run,
['-O'])
test ('T19474',
[ collect_stats('bytes allocated', 5), reqlib('vector') ],
compile_and_run,
['-v0 -O'])
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