summaryrefslogtreecommitdiff
path: root/testsuite/tests/perf/compiler/genT22744
blob: fdbe1fcefb4a36bbb440062aafe6773b3f05672b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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