Add a test for #7850
authorIan Lynagh <ian@well-typed.com>
Sat, 13 Jul 2013 19:37:31 +0000 (20:37 +0100)
committerIan Lynagh <ian@well-typed.com>
Sat, 13 Jul 2013 19:37:31 +0000 (20:37 +0100)
testsuite/tests/perf/should_run/T7850.hs [new file with mode: 0644]
testsuite/tests/perf/should_run/T7850.stdout [new file with mode: 0644]
testsuite/tests/perf/should_run/all.T

diff --git a/testsuite/tests/perf/should_run/T7850.hs b/testsuite/tests/perf/should_run/T7850.hs
new file mode 100644 (file)
index 0000000..d3124db
--- /dev/null
@@ -0,0 +1,11 @@
+
+{-# LANGUAGE BangPatterns #-}
+
+main :: IO ()
+main = print $ ack 4 1
+
+ack :: Int -> Int -> Int
+ack 0 !n = n+1
+ack m  0 = ack (m-1) 1
+ack m  n = ack (m-1) $ ack m (n-1)
+
diff --git a/testsuite/tests/perf/should_run/T7850.stdout b/testsuite/tests/perf/should_run/T7850.stdout
new file mode 100644 (file)
index 0000000..b07de00
--- /dev/null
@@ -0,0 +1 @@
+65533
index f95f751..84bb9d3 100644 (file)
@@ -284,3 +284,9 @@ test('T7954',
      compile_and_run,
      ['-O'])
 
+test('T7850',
+     [stats_num_field('peak_megabytes_allocated', (4, 1)),
+      only_ways(['normal'])],
+     compile_and_run,
+     ['-O'])
+