[commit: testsuite] master: test for #6146 (eb18b0a)

Simon Marlow marlowsd at gmail.com
Thu Jun 7 18:03:46 CEST 2012


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/eb18b0a1aa8630ca5c5713b0ee3a9ebad875642a

>---------------------------------------------------------------

commit eb18b0a1aa8630ca5c5713b0ee3a9ebad875642a
Author: Simon Marlow <marlowsd at gmail.com>
Date:   Thu Jun 7 16:03:38 2012 +0100

    test for #6146

>---------------------------------------------------------------

 tests/codeGen/should_run/6146.hs                   |   20 ++++++++++++++++++++
 .../T5564.stdout => codeGen/should_run/6146.stdin} |    0 
 tests/codeGen/should_run/6146.stdout               |    3 +++
 tests/codeGen/should_run/all.T                     |    2 ++
 4 files changed, 25 insertions(+), 0 deletions(-)

diff --git a/tests/codeGen/should_run/6146.hs b/tests/codeGen/should_run/6146.hs
new file mode 100644
index 0000000..1142f5f
--- /dev/null
+++ b/tests/codeGen/should_run/6146.hs
@@ -0,0 +1,20 @@
+-- Test #6146 (a bug in -feager-blackholing) I couldn't reliably
+-- reproduce it, but this program occasionally triggers it so it's
+-- better than nothing.
+
+module Main (main) where
+
+import System.IO
+import Control.Concurrent
+import System.Mem
+
+main :: IO ()
+main = do
+    putStrLn "First number?  "
+    num1 <- readLn :: IO Int
+    performGC -- provokes bug (sometimes)
+    putStrLn "Second number? "
+    num2 <- readLn :: IO Int
+    let total = num1 + num2
+    putStrLn $ "The sum is " ++ (show total) ++ "."
+
diff --git a/tests/ghci/scripts/T5564.stdout b/tests/codeGen/should_run/6146.stdin
similarity index 100%
copy from tests/ghci/scripts/T5564.stdout
copy to tests/codeGen/should_run/6146.stdin
diff --git a/tests/codeGen/should_run/6146.stdout b/tests/codeGen/should_run/6146.stdout
new file mode 100644
index 0000000..e6ce1ac
--- /dev/null
+++ b/tests/codeGen/should_run/6146.stdout
@@ -0,0 +1,3 @@
+First number?  
+Second number? 
+The sum is 5.
diff --git a/tests/codeGen/should_run/all.T b/tests/codeGen/should_run/all.T
index 5e268eb..272eb4a 100644
--- a/tests/codeGen/should_run/all.T
+++ b/tests/codeGen/should_run/all.T
@@ -91,3 +91,5 @@ test('5747', if_arch('i386', extra_hc_opts('-msse2')), compile_and_run, ['-O2'])
 test('5785', normal, compile_and_run, [''])
 test('setByteArray', normal, compile_and_run, [''])
 
+test('6146', normal, compile_and_run, [''])
+





More information about the Cvs-ghc mailing list