summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2014-01-20 10:31:45 +0000
committerJoachim Breitner <mail@joachim-breitner.de>2014-01-20 10:33:22 +0000
commitda66a8dff05f656cb379edf61827af426e1b05e7 (patch)
tree34819286a08ef4e053bd4762953fda18b55a1a39
parent0c578870d5a65b496cb57b260cd83d71db50f3b3 (diff)
downloadhaskell-da66a8dff05f656cb379edf61827af426e1b05e7.tar.gz
Test case for #T7619
(artificial test cases are so nice: 90.7% improvement!)
-rw-r--r--testsuite/tests/perf/should_run/T7619.hs12
-rw-r--r--testsuite/tests/perf/should_run/all.T8
2 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/perf/should_run/T7619.hs b/testsuite/tests/perf/should_run/T7619.hs
new file mode 100644
index 0000000000..d64073952b
--- /dev/null
+++ b/testsuite/tests/perf/should_run/T7619.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE TypeFamilies #-}
+module Main where
+data family Foo a
+
+data instance Foo Int = FooInt Int Int
+
+foo :: Foo Int -> Int
+foo (FooInt a 0) = 0
+foo (FooInt a b) = foo (FooInt a (b-1))
+
+main :: IO ()
+main = foo (FooInt 0 10000) `seq` return ()
diff --git a/testsuite/tests/perf/should_run/all.T b/testsuite/tests/perf/should_run/all.T
index 4f6a9d35c0..98a68d7e39 100644
--- a/testsuite/tests/perf/should_run/all.T
+++ b/testsuite/tests/perf/should_run/all.T
@@ -314,3 +314,11 @@ test('T4267',
compile_and_run,
['-O'])
+test('T7619',
+ [stats_num_field('bytes allocated',
+ [ (wordsize(64), 40992, 10)]),
+ # previously, it was >400000 bytes
+ only_ways(['normal'])],
+ compile_and_run,
+ ['-O'])
+