Move ioref001 to base/tests
authorIan Lynagh <igloo@earth.li>
Sat, 19 Nov 2011 23:53:35 +0000 (23:53 +0000)
committerIan Lynagh <igloo@earth.li>
Sat, 19 Nov 2011 23:53:35 +0000 (23:53 +0000)
tests/all.T
tests/ioref001.hs [new file with mode: 0644]
tests/ioref001.stdout [new file with mode: 0644]

index b96722a..c7f9e7f 100644 (file)
@@ -24,3 +24,9 @@ test('take001', extra_run_opts('1'), compile_and_run, [''])
 test('genericNegative001', extra_run_opts('-1'), compile_and_run, [''])
 test('ix001', normal, compile_and_run, [''])
 
+# need to add -K64m to the compiler opts, so that GHCi gets it too
+test('ioref001',
+     [skip_if_fast,extra_run_opts('+RTS -K64m -RTS')],
+     compile_and_run,
+     ['+RTS -K64m -RTS'])
+
diff --git a/tests/ioref001.hs b/tests/ioref001.hs
new file mode 100644 (file)
index 0000000..837b82e
--- /dev/null
@@ -0,0 +1,9 @@
+
+module Main where
+
+import Data.IORef
+
+loop r 0 = return ()
+loop r c = loop r (c-1) >> writeIORef r 42
+
+main = newIORef 0 >>= \r -> loop r 1000000 >> putStrLn "done"
diff --git a/tests/ioref001.stdout b/tests/ioref001.stdout
new file mode 100644 (file)
index 0000000..19f86f4
--- /dev/null
@@ -0,0 +1 @@
+done