summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2011-06-26 17:05:31 +0100
committerIan Lynagh <igloo@earth.li>2011-06-26 17:05:31 +0100
commitdb26a241d44ade30b7df5807d15ec719ac339502 (patch)
tree577c2907f25f9beb39e8f03540402d7ddd422385
parent93f0a15d565ff7789181a97a63c1b06c41c56f3e (diff)
downloadhaskell-db26a241d44ade30b7df5807d15ec719ac339502.tar.gz
Add a perf test for #5205
-rw-r--r--testsuite/tests/ghc-regress/perf/should_run/T5205.hs13
-rw-r--r--testsuite/tests/ghc-regress/perf/should_run/T5205.stdout1
-rw-r--r--testsuite/tests/ghc-regress/perf/should_run/all.T15
3 files changed, 29 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-regress/perf/should_run/T5205.hs b/testsuite/tests/ghc-regress/perf/should_run/T5205.hs
new file mode 100644
index 0000000000..215dd42647
--- /dev/null
+++ b/testsuite/tests/ghc-regress/perf/should_run/T5205.hs
@@ -0,0 +1,13 @@
+
+import Control.Concurrent
+import Control.Monad
+
+main :: IO ()
+main = do t <- forkIO (x >> x)
+ threadDelay 1000000
+ killThread t
+ putStrLn "Done"
+
+x :: IO ()
+x = forever yield
+
diff --git a/testsuite/tests/ghc-regress/perf/should_run/T5205.stdout b/testsuite/tests/ghc-regress/perf/should_run/T5205.stdout
new file mode 100644
index 0000000000..a965a70ed4
--- /dev/null
+++ b/testsuite/tests/ghc-regress/perf/should_run/T5205.stdout
@@ -0,0 +1 @@
+Done
diff --git a/testsuite/tests/ghc-regress/perf/should_run/all.T b/testsuite/tests/ghc-regress/perf/should_run/all.T
index 5d6c148d74..04133979df 100644
--- a/testsuite/tests/ghc-regress/perf/should_run/all.T
+++ b/testsuite/tests/ghc-regress/perf/should_run/all.T
@@ -131,3 +131,18 @@ test('T4978',
],
compile_and_run,
['-O2'])
+
+test('T5205',
+ [if_wordsize(32,
+ stats_num_field('bytes allocated', 40000,
+ 50000)),
+ # expected value: 47088 (x86/Darwin)
+ if_wordsize(64,
+ stats_num_field('bytes allocated', 40000,
+ 60000)),
+ # expected value: 51320 (amd64/Linux)
+ only_ways(['normal'])
+ ],
+ compile_and_run,
+ ['-O'])
+