summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Steuck <greg@nest.cx>2021-12-24 12:58:14 -0800
committerGreg Steuck <blackgnezdo@gmail.com>2022-01-03 05:18:24 +0000
commitd9e491958fab83d34f261f6adeaf3c8ace71b276 (patch)
tree32560fbd2be360053dd3bde4fdcd9688f6b78350
parentf212cece72b4be2750afa0f71f833f4b0190383a (diff)
downloadhaskell-d9e491958fab83d34f261f6adeaf3c8ace71b276.tar.gz
Replace `seq` with POSIX-standard printf(1) in ManyAlternatives test
The test now passes on OpenBSD instead of generating broken source which was rejected by GHC with ManyAlternatives.hs:5:1: error: The type signature for ‘f’ lacks an accompanying binding
-rwxr-xr-xtestsuite/tests/perf/compiler/genManyAlternatives10
1 files changed, 6 insertions, 4 deletions
diff --git a/testsuite/tests/perf/compiler/genManyAlternatives b/testsuite/tests/perf/compiler/genManyAlternatives
index 1035425bd4..6b5c79e036 100755
--- a/testsuite/tests/perf/compiler/genManyAlternatives
+++ b/testsuite/tests/perf/compiler/genManyAlternatives
@@ -24,11 +24,13 @@ MODULE=ManyAlternatives
echo "module $MODULE where" > $MODULE.hs
echo >> $MODULE.hs
echo "data A$SIZE = A0" >> $MODULE.hs
-for i in $(seq -w 1 $SIZE); do
- echo " | A$i" >> $MODULE.hs
+i=1; while test $i -lt $SIZE; do
+ printf " | A%03d\n" $i >> $MODULE.hs
+ i=$((i+1))
done
echo >> $MODULE.hs
echo "f :: A$SIZE -> Int" >> $MODULE.hs
-for i in $(seq -w 1 $SIZE); do
- echo "f A$i = 199$i" >> $MODULE.hs
+i=1; while test $i -lt $SIZE; do
+ printf "f A%03d = 199%03d\n" $i $i >> $MODULE.hs
+ i=$((i+1))
done