summaryrefslogtreecommitdiff
path: root/testsuite/tests/callarity/perf
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2014-02-18 12:02:11 +0000
committerJoachim Breitner <mail@joachim-breitner.de>2014-02-18 18:16:55 +0000
commitd3c579c75ffec4346a043582d89205998790145e (patch)
treecf939e30406e76d4c0292cb0d49ab26671a20d1e /testsuite/tests/callarity/perf
parentf347bfeae0d73d248032e32323a63dae8d5af828 (diff)
downloadhaskell-d3c579c75ffec4346a043582d89205998790145e.tar.gz
Call arity testcase for #3924
nice numbers coming from these micro-benchmarks.
Diffstat (limited to 'testsuite/tests/callarity/perf')
-rw-r--r--testsuite/tests/callarity/perf/Makefile3
-rw-r--r--testsuite/tests/callarity/perf/T3924.hs13
-rw-r--r--testsuite/tests/callarity/perf/T3924.stdout1
-rw-r--r--testsuite/tests/callarity/perf/all.T8
4 files changed, 25 insertions, 0 deletions
diff --git a/testsuite/tests/callarity/perf/Makefile b/testsuite/tests/callarity/perf/Makefile
new file mode 100644
index 0000000000..9101fbd40a
--- /dev/null
+++ b/testsuite/tests/callarity/perf/Makefile
@@ -0,0 +1,3 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/callarity/perf/T3924.hs b/testsuite/tests/callarity/perf/T3924.hs
new file mode 100644
index 0000000000..164a3a6430
--- /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 0000000000..13c5c81aa6
--- /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 0000000000..d5a1108356
--- /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'])