Skip to content
Snippets Groups Projects
Commit c6ec7f48 authored by Ben Gamari's avatar Ben Gamari Committed by Marge Bot
Browse files

testsuite: Add test for #19413

This was fixed as a result of #19181.
parent e679321e
No related branches found
No related tags found
No related merge requests found
{-# OPTIONS_GHC -O1 #-}
import System.IO.Unsafe
import Data.IORef
{-# NOINLINE resourceId #-}
resourceId :: IO Int
resourceId = unsafePerformIO counter
counter :: IO (IO Int)
counter = do
ref <- newIORef 0
pure $ atomicModifyIORef' ref $ \i -> let j = i + 1 in (j, j)
main = do
print =<< resourceId
print =<< resourceId
1
2
......@@ -97,3 +97,4 @@ test('NumConstantFolding8', normal, compile_and_run, [''])
test('NumConstantFolding16', normal, compile_and_run, [''])
test('NumConstantFolding32', normal, compile_and_run, [''])
test('NumConstantFolding', normal, compile_and_run, [''])
test('T19413', normal, compile_and_run, [''])
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