summaryrefslogtreecommitdiff
path: root/testsuite/tests/perf/compiler/genMultiLayerModulesDefs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/perf/compiler/genMultiLayerModulesDefs')
-rwxr-xr-xtestsuite/tests/perf/compiler/genMultiLayerModulesDefs26
1 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/perf/compiler/genMultiLayerModulesDefs b/testsuite/tests/perf/compiler/genMultiLayerModulesDefs
new file mode 100755
index 0000000000..8dd1d92fd9
--- /dev/null
+++ b/testsuite/tests/perf/compiler/genMultiLayerModulesDefs
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+# Generate $DEPTH layers of modules with $WIDTH modules on each layer
+# Every module on layer N imports all the modules on layer N-1
+# Each module has $DEFS definitions in
+# MultiLayerModules.hs imports all the modules from the last layer
+DEPTH=3
+WIDTH=3
+DEFS=1000
+for i in $(seq -w 1 $WIDTH); do
+ echo "module DummyLevel0M$i where" > DummyLevel0M$i.hs;
+done
+for l in $(seq 1 $DEPTH); do
+ for i in $(seq -w 1 $WIDTH); do
+ echo "module DummyLevel${l}M$i where" > DummyLevel${l}M$i.hs;
+ for j in $(seq -w 1 $WIDTH); do
+ echo "import DummyLevel$((l-1))M$j" >> DummyLevel${l}M$i.hs;
+ done
+ for k in $(seq -w 1 $DEFS); do
+ echo "a_${l}_${i}_${j}_${k} = ${l} + ${i} + ${j} + ${k}" >> DummyLevel${l}M$i.hs;
+ done
+ done
+done
+echo "module MultiLayerModules where" > MultiLayerModules.hs
+for j in $(seq -w 1 $WIDTH); do
+ echo "import DummyLevel${DEPTH}M$j" >> MultiLayerModules.hs;
+done