diff options
author | Simon Jakobi <simon.jakobi@gmail.com> | 2021-03-10 17:05:18 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-03-20 07:51:01 -0400 |
commit | 8592a2462a4f1e901459b5866020ddf7b381b4a9 (patch) | |
tree | d308f8d75e13c1156e9975512ea62ec622f73091 /testsuite/tests | |
parent | 044e5be3b595858d0d689e27dad427bbdbf26cb4 (diff) | |
download | haskell-8592a2462a4f1e901459b5866020ddf7b381b4a9.tar.gz |
Add compiler perf regression test for #9198
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/perf/compiler/T9198.hs | 12 | ||||
-rw-r--r-- | testsuite/tests/perf/compiler/all.T | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/perf/compiler/T9198.hs b/testsuite/tests/perf/compiler/T9198.hs new file mode 100644 index 0000000000..11d3ae4a0d --- /dev/null +++ b/testsuite/tests/perf/compiler/T9198.hs @@ -0,0 +1,12 @@ +-- Type checking time for this test used to be quadratic in the number of `a`s +-- in `main` from GHC 7.8 to 8.6. It appears to have been fixed in 8.8. +begin :: Monad m => (m () -> t) -> t +begin cont = cont (return ()) + +a :: IO a -> (IO () -> t) -> t +a m cont = cont (m >> putStrLn "a") + +end :: t -> t +end m = m + +main = begin a a a a a a a a a a a a a a a a a a end diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T index 5fde44d7ea..937858c2a7 100644 --- a/testsuite/tests/perf/compiler/all.T +++ b/testsuite/tests/perf/compiler/all.T @@ -448,3 +448,7 @@ test ('T16577', [ collect_compiler_stats('bytes allocated',2) ], compile, ['-v0 -O']) +test ('T9198', + [ collect_compiler_stats('bytes allocated',2) ], + compile, + ['']) |