summaryrefslogtreecommitdiff
path: root/testsuite/tests/perf
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/perf')
-rw-r--r--testsuite/tests/perf/compiler/Makefile5
-rw-r--r--testsuite/tests/perf/compiler/all.T11
-rwxr-xr-xtestsuite/tests/perf/compiler/genT2274428
3 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/tests/perf/compiler/Makefile b/testsuite/tests/perf/compiler/Makefile
index 762883b0b4..06f9ac1304 100644
--- a/testsuite/tests/perf/compiler/Makefile
+++ b/testsuite/tests/perf/compiler/Makefile
@@ -32,3 +32,8 @@ MultiLayerModulesTH_OneShot_Prep: MultiLayerModulesTH_Make_Prep
InstanceMatching:
./genMatchingTest 0
'$(TEST_HC)' $(TEST_HC_OPTS) -fno-code -fwrite-interface Defs.hs
+
+T22744:
+ ./genT22744
+ '$(TEST_HC)' $(TEST_HC_OPTS) T22744.hs
+
diff --git a/testsuite/tests/perf/compiler/all.T b/testsuite/tests/perf/compiler/all.T
index 14cd4cce94..56729a6e3f 100644
--- a/testsuite/tests/perf/compiler/all.T
+++ b/testsuite/tests/perf/compiler/all.T
@@ -670,3 +670,14 @@ test('RecordUpdPerf',
],
multimod_compile,
['RecordUpdPerf', '-fno-code -v0'])
+
+test('T22744',
+ [ collect_compiler_stats('peak_megabytes_allocated',20),
+ req_interp,
+ pre_cmd('$MAKE -s --no-print-directory T22744'),
+ extra_files(['genT22744']),
+ compile_timeout_multiplier(2)
+ ],
+ multimod_compile,
+ ['T22744', '-v0'])
+
diff --git a/testsuite/tests/perf/compiler/genT22744 b/testsuite/tests/perf/compiler/genT22744
new file mode 100755
index 0000000000..fdbe1fcefb
--- /dev/null
+++ b/testsuite/tests/perf/compiler/genT22744
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+NUMDEP=10000
+NUMMOD=100
+
+seq 1 $NUMDEP | xargs -I{} touch foo{}
+
+cat > T22744.hs << EOF
+module Main where
+EOF
+
+for i in $(seq $NUMMOD); do
+ cat > M$i.hs << EOF
+{-# LANGUAGE TemplateHaskell #-}
+module M$i where
+import Language.Haskell.TH.Syntax
+import Control.Monad
+
+\$(do forM_ [1..$NUMDEP] $ \i -> addDependentFile $ "foo" ++ show i
+ return [])
+EOF
+ echo "import M$i" >> T22744.hs
+done
+
+cat >> T22744.hs << EOF
+main = pure ()
+EOF
+