[commit: ghc] master: Call arity testcase for #3924 (d3c579c)

git at git.haskell.org git at git.haskell.org
Tue Feb 18 18:58:08 UTC 2014


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

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

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

commit d3c579c75ffec4346a043582d89205998790145e
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Tue Feb 18 12:02:11 2014 +0000

    Call arity testcase for #3924
    
    nice numbers coming from these micro-benchmarks.


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

d3c579c75ffec4346a043582d89205998790145e
 .../should_compile => callarity/perf}/Makefile            |    0
 testsuite/tests/callarity/perf/T3924.hs                   |   13 +++++++++++++
 testsuite/tests/callarity/perf/T3924.stdout               |    1 +
 testsuite/tests/callarity/perf/all.T                      |    8 ++++++++
 4 files changed, 22 insertions(+)

diff --git a/testsuite/tests/annotations/should_compile/Makefile b/testsuite/tests/callarity/perf/Makefile
similarity index 100%
copy from testsuite/tests/annotations/should_compile/Makefile
copy to testsuite/tests/callarity/perf/Makefile
diff --git a/testsuite/tests/callarity/perf/T3924.hs b/testsuite/tests/callarity/perf/T3924.hs
new file mode 100644
index 0000000..164a3a6
--- /dev/null
+++ b/testsuite/tests/callarity/perf/T3924.hs
@@ -0,0 +1,13 @@
+f2 :: Int -> Int -> Int
+f2 x1 = if x1 == 0 then (\x0 -> x0) else let
+     y = x1 - 1
+     in f3 y y
+f3 :: Int -> Int -> Int -> Int
+f3 x2 = if x2 == 0 then f2 else let
+     y = x2 - 1
+     in f4 y y
+f4 :: Int -> Int -> Int -> Int -> Int
+f4 x3 = if x3 == 0 then f3 else let
+     y = x3 - 1
+     in \x2 x1 x0 -> f4 y x2 x1 (y + x0)
+main = print (f2 100 0)
diff --git a/testsuite/tests/callarity/perf/T3924.stdout b/testsuite/tests/callarity/perf/T3924.stdout
new file mode 100644
index 0000000..13c5c81
--- /dev/null
+++ b/testsuite/tests/callarity/perf/T3924.stdout
@@ -0,0 +1 @@
+3921225
diff --git a/testsuite/tests/callarity/perf/all.T b/testsuite/tests/callarity/perf/all.T
new file mode 100644
index 0000000..d5a1108
--- /dev/null
+++ b/testsuite/tests/callarity/perf/all.T
@@ -0,0 +1,8 @@
+test('T3924',
+     [stats_num_field('bytes allocated', (51480, 5)),
+          # previously, without call-arity: 22326544
+          # 2014-01-18: 51480  (amd64/Linux)
+      only_ways(['normal'])
+      ],
+     compile_and_run,
+     ['-O'])



More information about the ghc-commits mailing list