[commit: ghc] master: Test case for #T7619 (da66a8d)

git at git.haskell.org git at git.haskell.org
Mon Jan 20 11:44:14 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/da66a8dff05f656cb379edf61827af426e1b05e7/ghc

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

commit da66a8dff05f656cb379edf61827af426e1b05e7
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Mon Jan 20 10:31:45 2014 +0000

    Test case for #T7619
    
    (artificial test cases are so nice: 90.7% improvement!)


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

da66a8dff05f656cb379edf61827af426e1b05e7
 testsuite/tests/perf/should_run/T7619.hs |   12 ++++++++++++
 testsuite/tests/perf/should_run/all.T    |    8 ++++++++
 2 files changed, 20 insertions(+)

diff --git a/testsuite/tests/perf/should_run/T7619.hs b/testsuite/tests/perf/should_run/T7619.hs
new file mode 100644
index 0000000..d640739
--- /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 4f6a9d3..98a68d7 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'])
+



More information about the ghc-commits mailing list