summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Jakobi <simon.jakobi@gmail.com>2021-03-10 17:05:18 +0100
committerSimon Jakobi <simon.jakobi@gmail.com>2021-03-10 17:35:33 +0100
commitdca3d344de6931d2dee0e402049b1862b7e0e27e (patch)
tree354df97ebc3b045ab39807fd551fb08fbfbc923e
parentdf8e8ba267ffd7b8be0702bd64b8c39532359461 (diff)
downloadhaskell-wip/9198.tar.gz
Add compiler perf regression test for #9198wip/9198
-rw-r--r--testsuite/tests/perf/compiler/T9198.hs12
-rw-r--r--testsuite/tests/perf/compiler/all.T4
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,
+ [''])