diff options
-rw-r--r-- | testsuite/tests/perf/compiler/all.T | 7 | ||||
-rwxr-xr-x | testsuite/tests/perf/compiler/genT14766.py | 24 |
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)) + + |