summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-03-22 15:42:47 -0400
committerGHC GitLab CI <ghc-ci@gitlab-haskell.org>2022-04-28 09:10:31 +0000
commitf6a8185d741adec8b0cc89749bc660128eca57fe (patch)
tree67004367e333ee3a253dd9edd9afb3f61f628675
parent81cf52bb301592ff3d043d03eb9a0d547891a3e1 (diff)
downloadhaskell-f6a8185d741adec8b0cc89749bc660128eca57fe.tar.gz
testsuite: Add performance test for #14766wip/T14766-test
This distills the essence of the Sigs.hs program found in the ticket.
-rw-r--r--testsuite/tests/perf/compiler/all.T7
-rwxr-xr-xtestsuite/tests/perf/compiler/genT14766.py24
2 files changed, 31 insertions, 0 deletions
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T
index 17bb717ee9..3d0796564e 100644
--- a/testsuite/tests/perf/compiler/all.T
+++ b/testsuite/tests/perf/compiler/all.T
@@ -585,6 +585,13 @@ test ('T13253-spj',
],
compile,
['-v0 -O'])
+test ('T14766',
+ [ collect_compiler_stats('bytes allocated',2),
+ pre_cmd('python3 genT14766.py > T14766.hs'),
+ extra_files(['genT14766.py']),
+ ],
+ compile,
+ ['-v0'])
test ('T18223',
[ collect_compiler_stats('bytes allocated',2)
, compile_timeout_multiplier(2)
diff --git a/testsuite/tests/perf/compiler/genT14766.py b/testsuite/tests/perf/compiler/genT14766.py
new file mode 100755
index 0000000000..fed2665598
--- /dev/null
+++ b/testsuite/tests/perf/compiler/genT14766.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python3
+# -*- coding: utf-8 -*-
+
+N_VARS = 100
+N_BINDS = 50
+
+tyvars = ' '.join('v{i}'.format(i=i) for i in range(N_VARS))
+
+print('''
+{{-# LANGUAGE PartialTypeSignatures #-}}
+{{-# OPTIONS_GHC -Wno-partial-type-signatures #-}}
+
+module T14766 where
+
+newtype T {tyvars} = T ()
+
+'''.format(tyvars=tyvars))
+
+holes = ' '.join('_' for i in range(N_VARS))
+for i in range(N_BINDS):
+ print('v{i} :: T {holes}'.format(i=i, holes=holes))
+ print('v{i} = T ()'.format(i=i))
+
+