summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2021-01-31 19:56:48 +0000
committerStefan Eßer <se@FreeBSD.org>2021-01-31 19:58:45 +0000
commit47a52dc4d48f259ab7d9f9ba6b65f4f2331a22dc (patch)
tree6e73791cfb3f127d7f2889c8e0a0380bc9913514 /tests
parent7fe0a3f2085758fdef0a705dbc81d72f1f1953c6 (diff)
Diffstat (limited to 'tests')
-rwxr-xr-xtests/afl.py22
-rwxr-xr-xtests/all.sh191
-rw-r--r--tests/bc/all.txt6
-rw-r--r--tests/bc/scripts/all.txt15
-rwxr-xr-xtests/bc/timeconst.sh9
-rw-r--r--tests/bcl.c2
-rw-r--r--tests/dc/errors/30.txt1
-rw-r--r--tests/dc/errors/31.txt1
-rw-r--r--tests/dc/scripts/all.txt9
-rwxr-xr-xtests/diff.sh51
-rwxr-xr-xtests/errors.sh20
-rw-r--r--tests/extra_required.txt7
-rw-r--r--tests/fuzzing/bc.dict68
-rw-r--r--tests/fuzzing/bc_inputs1/abs.txt7
-rw-r--r--tests/fuzzing/bc_inputs1/add.txt146
-rw-r--r--tests/fuzzing/bc_inputs1/arctangent.txt26
-rwxr-xr-xtests/fuzzing/bc_inputs1/array.bc60
-rw-r--r--tests/fuzzing/bc_inputs1/arrays.txt10
-rw-r--r--tests/fuzzing/bc_inputs1/assignments.txt122
-rw-r--r--tests/fuzzing/bc_inputs1/basic.txt7
-rw-r--r--tests/fuzzing/bc_inputs1/boolean.txt184
-rw-r--r--tests/fuzzing/bc_inputs1/cosine.txt44
-rw-r--r--tests/fuzzing/bc_inputs1/decimal.txt35
-rw-r--r--tests/fuzzing/bc_inputs1/divide.txt31
-rw-r--r--tests/fuzzing/bc_inputs1/engineering.txt19
-rw-r--r--tests/fuzzing/bc_inputs1/exponent.txt22
-rw-r--r--tests/fuzzing/bc_inputs1/functions.bc7
-rw-r--r--tests/fuzzing/bc_inputs1/functions.txt13
-rw-r--r--tests/fuzzing/bc_inputs1/globals.txt21
-rw-r--r--tests/fuzzing/bc_inputs1/len.bc48
-rw-r--r--tests/fuzzing/bc_inputs1/length.txt59
-rw-r--r--tests/fuzzing/bc_inputs1/lib10.txt4
-rw-r--r--tests/fuzzing/bc_inputs1/lib11.txt4
-rw-r--r--tests/fuzzing/bc_inputs1/lib12.txt1
-rw-r--r--tests/fuzzing/bc_inputs1/lib2.txt15
-rw-r--r--tests/fuzzing/bc_inputs1/lib3.txt6
-rw-r--r--tests/fuzzing/bc_inputs1/lib4.txt10
-rw-r--r--tests/fuzzing/bc_inputs1/lib5.txt2
-rw-r--r--tests/fuzzing/bc_inputs1/lib6.txt5
-rw-r--r--tests/fuzzing/bc_inputs1/lib7.txt12
-rw-r--r--tests/fuzzing/bc_inputs1/lib8.txt3
-rw-r--r--tests/fuzzing/bc_inputs2/lib13.txt1
-rw-r--r--tests/fuzzing/bc_inputs2/lib14.txt1
-rw-r--r--tests/fuzzing/bc_inputs2/lib15.txt1
-rw-r--r--tests/fuzzing/bc_inputs2/lib16.txt1
-rw-r--r--tests/fuzzing/bc_inputs2/lib19.txt1
-rw-r--r--tests/fuzzing/bc_inputs2/lib20.txt1
-rw-r--r--tests/fuzzing/bc_inputs2/lib21.txt1
-rw-r--r--tests/fuzzing/bc_inputs2/lib22.txt1
-rw-r--r--tests/fuzzing/bc_inputs2/lib23.txt1
-rw-r--r--tests/fuzzing/bc_inputs2/lib24.txt1
-rw-r--r--tests/fuzzing/bc_inputs2/log.txt22
-rw-r--r--tests/fuzzing/bc_inputs2/misc.txt13
-rw-r--r--tests/fuzzing/bc_inputs2/misc1.txt76
-rw-r--r--tests/fuzzing/bc_inputs2/misc2.txt110
-rw-r--r--tests/fuzzing/bc_inputs2/misc3.txt12
-rw-r--r--tests/fuzzing/bc_inputs2/modulus.txt69
-rw-r--r--tests/fuzzing/bc_inputs2/multiply.txt40
-rw-r--r--tests/fuzzing/bc_inputs2/pi.txt4
-rw-r--r--tests/fuzzing/bc_inputs2/places.txt19
-rw-r--r--tests/fuzzing/bc_inputs2/power.txt44
-rw-r--r--tests/fuzzing/bc_inputs2/print2.txt194
-rwxr-xr-xtests/fuzzing/bc_inputs2/references.bc408
-rw-r--r--tests/fuzzing/bc_inputs2/scale.txt57
-rw-r--r--tests/fuzzing/bc_inputs2/scientific.txt51
-rw-r--r--tests/fuzzing/bc_inputs2/shift.txt281
-rw-r--r--tests/fuzzing/bc_inputs2/sine.txt207
-rw-r--r--tests/fuzzing/bc_inputs3/01.txt339
-rw-r--r--tests/fuzzing/bc_inputs3/02.txt1
-rw-r--r--tests/fuzzing/bc_inputs3/03.txt2
-rw-r--r--tests/fuzzing/bc_inputs3/04.txt1
-rw-r--r--tests/fuzzing/bc_inputs3/05.txt1
-rw-r--r--tests/fuzzing/bc_inputs3/06.txt1
-rw-r--r--tests/fuzzing/bc_inputs3/07.txt8
-rw-r--r--tests/fuzzing/bc_inputs3/08.txt3
-rw-r--r--tests/fuzzing/bc_inputs3/09.txt11
-rw-r--r--tests/fuzzing/bc_inputs3/10.txt1
-rw-r--r--tests/fuzzing/bc_inputs3/11.txt99
-rw-r--r--tests/fuzzing/bc_inputs3/12.txt2
-rw-r--r--tests/fuzzing/bc_inputs3/13.txt56
-rw-r--r--tests/fuzzing/bc_inputs3/14.txt1
-rw-r--r--tests/fuzzing/bc_inputs3/15.txt3
-rw-r--r--tests/fuzzing/bc_inputs3/16.txt1
-rw-r--r--tests/fuzzing/bc_inputs3/17.txt11
-rw-r--r--tests/fuzzing/bc_inputs3/18.txt3
-rw-r--r--tests/fuzzing/bc_inputs3/19.txt5
-rw-r--r--tests/fuzzing/bc_inputs3/20.txt51
-rw-r--r--tests/fuzzing/bc_inputs3/21.txt10
-rw-r--r--tests/fuzzing/bc_inputs3/22.txt2
-rw-r--r--tests/fuzzing/bc_inputs3/23.txtbin0 -> 1024 bytes
-rw-r--r--tests/fuzzing/bc_inputs3/24.txt4
-rw-r--r--tests/fuzzing/bc_inputs3/sqrt.txt14
-rw-r--r--tests/fuzzing/bc_inputs3/strings.txt12
-rw-r--r--tests/fuzzing/bc_inputs3/subtract.txt153
-rw-r--r--tests/fuzzing/bc_inputs3/trunc.txt15
-rw-r--r--tests/fuzzing/bc_inputs3/void.txt20
-rw-r--r--tests/fuzzing/dc_inputs/01.txt2
-rw-r--r--tests/fuzzing/dc_inputs/02.txt5
-rw-r--r--tests/fuzzing/dc_inputs/03.txt2
-rw-r--r--tests/fuzzing/dc_inputs/04.txt9
-rw-r--r--tests/fuzzing/dc_inputs/05.txt3
-rw-r--r--tests/fuzzing/dc_inputs/06.txt1
-rw-r--r--tests/fuzzing/dc_inputs/07.txt3
-rw-r--r--tests/fuzzing/dc_inputs/08.txt1
-rw-r--r--tests/fuzzing/dc_inputs/09.txt9
-rw-r--r--tests/fuzzing/dc_inputs/10.txt11
-rw-r--r--tests/fuzzing/dc_inputs/11.txt4
-rw-r--r--tests/fuzzing/dc_inputs/12.txt2
-rw-r--r--tests/fuzzing/dc_inputs/13.txt7
-rw-r--r--tests/fuzzing/dc_inputs/14.txt7
-rw-r--r--tests/fuzzing/dc_inputs/15.txt11
-rw-r--r--tests/fuzzing/dc_inputs/16.txt1
-rw-r--r--tests/fuzzing/dc_inputs/17.txt20
-rw-r--r--tests/fuzzing/dc_inputs/18.txt3
-rw-r--r--tests/fuzzing/dc_inputs/19.txt1
-rw-r--r--tests/fuzzing/dc_inputs/20.txt3
-rw-r--r--tests/fuzzing/dc_inputs/21.txt5
-rw-r--r--tests/fuzzing/dc_inputs/22.txt36
-rw-r--r--tests/fuzzing/dc_inputs/23.txt2
-rw-r--r--tests/fuzzing/dc_inputs/24.txt1
-rw-r--r--tests/fuzzing/dc_inputs/25.txt6
-rw-r--r--tests/fuzzing/dc_inputs/26.txt155
-rw-r--r--tests/fuzzing/dc_inputs/27.txt2
-rw-r--r--tests/fuzzing/dc_inputs/28.txt1
-rw-r--r--tests/fuzzing/dc_inputs/29.txt13
-rw-r--r--tests/fuzzing/dc_inputs/30.txt1
-rw-r--r--tests/fuzzing/dc_inputs/31.txt1
-rw-r--r--tests/fuzzing/dc_inputs/abs.txt7
-rw-r--r--tests/fuzzing/dc_inputs/add.txt33
-rw-r--r--tests/fuzzing/dc_inputs/array.dc2
-rw-r--r--tests/fuzzing/dc_inputs/boolean.txt80
-rw-r--r--tests/fuzzing/dc_inputs/decimal.txt36
-rw-r--r--tests/fuzzing/dc_inputs/divide.txt33
-rw-r--r--tests/fuzzing/dc_inputs/divmod.txt64
-rw-r--r--tests/fuzzing/dc_inputs/else.dc4
-rw-r--r--tests/fuzzing/dc_inputs/engineering.txt19
-rw-r--r--tests/fuzzing/dc_inputs/loop.dc3
-rw-r--r--tests/fuzzing/dc_inputs/misc.txt1
-rw-r--r--tests/fuzzing/dc_inputs/modexp.txt103
-rw-r--r--tests/fuzzing/dc_inputs/modulus.txt70
-rw-r--r--tests/fuzzing/dc_inputs/multiply.txt42
-rw-r--r--tests/fuzzing/dc_inputs/places.txt14
-rw-r--r--tests/fuzzing/dc_inputs/power.txt36
-rw-r--r--tests/fuzzing/dc_inputs/quit.dc2
-rw-r--r--tests/fuzzing/dc_inputs/scientific.txt51
-rw-r--r--tests/fuzzing/dc_inputs/shift.txt42
-rw-r--r--tests/fuzzing/dc_inputs/sqrt.txt14
-rw-r--r--tests/fuzzing/dc_inputs/stdin.txt205
-rwxr-xr-xtests/fuzzing/dc_inputs/stream.dc2
-rw-r--r--tests/fuzzing/dc_inputs/strings.txt50
-rw-r--r--tests/fuzzing/dc_inputs/subtract.txt33
-rw-r--r--tests/fuzzing/dc_inputs/trunc.txt11
-rw-r--r--tests/fuzzing/dc_inputs/vars.txt2
-rw-r--r--tests/fuzzing/dc_inputs/weird.dc2
-rwxr-xr-xtests/other.sh271
-rwxr-xr-xtests/radamsa.sh2
-rwxr-xr-xtests/randmath.py2
-rwxr-xr-xtests/read.sh23
-rwxr-xr-xtests/script.sh26
-rwxr-xr-xtests/scripts.sh9
-rwxr-xr-xtests/stdin.sh23
-rwxr-xr-xtests/test.sh32
162 files changed, 5208 insertions, 241 deletions
diff --git a/tests/afl.py b/tests/afl.py
index ff3b9229c1c2..a235ee5be176 100755
--- a/tests/afl.py
+++ b/tests/afl.py
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -89,6 +89,10 @@ def get_children(dir, get_files):
dirs.sort()
return dirs
+
+def exe_name(d):
+ return "bc" if d == "bc1" or d == "bc2" or d == "bc3" else "dc"
+
script = sys.argv[0]
testdir = os.path.dirname(script)
@@ -112,18 +116,26 @@ if asan:
usage()
exedir = sys.argv[idx]
+print("exedir: {}".format(exedir))
+
if len(sys.argv) >= idx + 2:
resultsdir = sys.argv[idx + 1]
else:
- if exedir == "bc":
- resultsdir = testdir + "/../../results"
+ if exedir == "bc1":
+ resultsdir = testdir + "/fuzzing/bc_outputs1"
+ elif exedir == "bc2":
+ resultsdir = testdir + "/fuzzing/bc_outputs2"
+ elif exedir == "bc3":
+ resultsdir = testdir + "/fuzzing/bc_outputs3"
else:
- resultsdir = testdir + "/../../results_dc"
+ resultsdir = testdir + "/fuzzing/dc_outputs"
+
+print("resultsdir: {}".format(resultsdir))
if len(sys.argv) >= idx + 3:
exe = sys.argv[idx + 2]
else:
- exe = testdir + "/../bin/" + exedir
+ exe = testdir + "/../bin/" + exe_name(exedir)
exebase = os.path.basename(exe)
diff --git a/tests/all.sh b/tests/all.sh
index 07fd346f04c5..1f745cdff079 100755
--- a/tests/all.sh
+++ b/tests/all.sh
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -110,195 +110,12 @@ done < "$testdir/$d/all.txt"
sh "$testdir/stdin.sh" "$d" "$exe" "$@"
-sh "$testdir/scripts.sh" "$d" "$extra" "$run_stack_tests" "$generate_tests" "$time_tests" "$exe" "$@"
+sh "$testdir/scripts.sh" "$d" "$extra" "$run_stack_tests" "$generate_tests" \
+ "$time_tests" "$exe" "$@"
sh "$testdir/read.sh" "$d" "$exe" "$@"
sh "$testdir/errors.sh" "$d" "$exe" "$@"
-num=100000000000000000000000000000000000000000000000000000000000000000000000000000
-numres="$num"
-num70="10000000000000000000000000000000000000000000000000000000000000000000\\
-0000000000"
-
-if [ "$d" = "bc" ]; then
- halt="halt"
- opt="x"
- lopt="extended-register"
- line_var="BC_LINE_LENGTH"
-else
- halt="q"
- opt="l"
- lopt="mathlib"
- line_var="DC_LINE_LENGTH"
- num="$num pR"
-fi
-
-printf '\nRunning %s quit test...' "$d"
-
-printf '%s\n' "$halt" | "$exe" "$@" > /dev/null 2>&1
-
-if [ "$d" = bc ]; then
- printf '%s\n' "quit" | "$exe" "$@" > /dev/null 2>&1
- two=$("$exe" "$@" -e 1+1 -e quit)
- if [ "$two" != "2" ]; then
- err_exit "$d failed a quit test" 1
- fi
-fi
-
-printf 'pass\n'
-
-base=$(basename "$exe")
-
-if [ "$base" != "bc" -a "$base" != "dc" ]; then
- exit 0
-fi
-
-printf 'Running %s environment var tests...' "$d"
-
-if [ "$d" = "bc" ]; then
- export BC_ENV_ARGS=" '-l' '' -q"
- export BC_EXPR_EXIT="1"
- printf 's(.02893)\n' | "$exe" "$@" > /dev/null
- "$exe" -e 4 "$@" > /dev/null
-else
- export DC_ENV_ARGS="'-x'"
- export DC_EXPR_EXIT="1"
- printf '4s stuff\n' | "$exe" "$@" > /dev/null
- "$exe" -e 4pR "$@" > /dev/null
-fi
-
-printf 'pass\n'
-
-out1="$testdir/../.log_$d.txt"
-out2="$testdir/../.log_${d}_test.txt"
-
-printf 'Running %s line length tests...' "$d"
-
-printf '%s\n' "$numres" > "$out1"
-
-export "$line_var"=80
-printf '%s\n' "$num" | "$exe" "$@" > "$out2"
-
-diff "$out1" "$out2"
-
-printf '%s\n' "$num70" > "$out1"
-
-export "$line_var"=2147483647
-printf '%s\n' "$num" | "$exe" "$@" > "$out2"
-
-diff "$out1" "$out2"
-
-printf 'pass\n'
-
-printf 'Running %s arg tests...' "$d"
-
-f="$testdir/$d/add.txt"
-exprs=$(cat "$f")
-results=$(cat "$testdir/$d/add_results.txt")
-
-printf '%s\n%s\n%s\n%s\n' "$results" "$results" "$results" "$results" > "$out1"
-
-"$exe" "$@" -e "$exprs" -f "$f" --expression "$exprs" --file "$f" -e "$halt" > "$out2"
-
-diff "$out1" "$out2"
-
-printf '%s\n' "$halt" | "$exe" "$@" -- "$f" "$f" "$f" "$f" > "$out2"
-
-diff "$out1" "$out2"
-
-if [ "$d" = "bc" ]; then
- printf '%s\n' "$halt" | "$exe" "$@" -i > /dev/null 2>&1
-fi
-
-printf '%s\n' "$halt" | "$exe" "$@" -h > /dev/null
-printf '%s\n' "$halt" | "$exe" "$@" -P > /dev/null
-printf '%s\n' "$halt" | "$exe" "$@" -v > /dev/null
-printf '%s\n' "$halt" | "$exe" "$@" -V > /dev/null
-
-set +e
-
-"$exe" "$@" -f "saotehasotnehasthistohntnsahxstnhalcrgxgrlpyasxtsaosysxsatnhoy.txt" > /dev/null 2> "$out2"
-err="$?"
-
-checktest "$d" "$err" "invalid file argument" "$out2" "$d"
-
-"$exe" "$@" "-$opt" -e "$exprs" > /dev/null 2> "$out2"
-err="$?"
-
-checktest "$d" "$err" "invalid option argument" "$out2" "$d"
-
-"$exe" "$@" "--$lopt" -e "$exprs" > /dev/null 2> "$out2"
-err="$?"
-
-checktest "$d" "$err" "invalid long option argument" "$out2" "$d"
-
-"$exe" "$@" "-u" -e "$exprs" > /dev/null 2> "$out2"
-err="$?"
-
-checktest "$d" "$err" "unrecognized option argument" "$out2" "$d"
-
-"$exe" "$@" "--uniform" -e "$exprs" > /dev/null 2> "$out2"
-err="$?"
-
-checktest "$d" "$err" "unrecognized long option argument" "$out2" "$d"
-
-"$exe" "$@" -f > /dev/null 2> "$out2"
-err="$?"
-
-checktest "$d" "$err" "missing required argument to short option" "$out2" "$d"
-
-"$exe" "$@" --file > /dev/null 2> "$out2"
-err="$?"
-
-checktest "$d" "$err" "missing required argument to long option" "$out2" "$d"
-
-"$exe" "$@" --version=5 > /dev/null 2> "$out2"
-err="$?"
-
-checktest "$d" "$err" "given argument to long option with no argument" "$out2" "$d"
-
-printf 'pass\n'
-
-printf 'Running %s directory test...' "$d"
-
-"$exe" "$@" "$testdir" > /dev/null 2> "$out2"
-err="$?"
-
-checktest "$d" "$err" "directory" "$out2" "$d"
-
-printf 'pass\n'
-
-printf 'Running %s binary file test...' "$d"
-
-bin="/bin/sh"
-
-"$exe" "$@" "$bin" > /dev/null 2> "$out2"
-err="$?"
-
-checktest "$d" "$err" "binary file" "$out2" "$d"
-
-printf 'pass\n'
-
-printf 'Running %s binary stdin test...' "$d"
-
-cat "$bin" | "$exe" "$@" > /dev/null 2> "$out2"
-err="$?"
-
-checktest "$d" "$err" "binary stdin" "$out2" "$d"
-
-printf 'pass\n'
-
-if [ "$d" = "bc" ]; then
-
- printf 'Running %s limits tests...' "$d"
- printf 'limits\n' | "$exe" "$@" > "$out2" /dev/null 2>&1
-
- if [ ! -s "$out2" ]; then
- err_exit "$d did not produce output on the limits test" 1
- fi
-
- printf 'pass\n'
-
-fi
+sh "$testdir/other.sh" "$d" "$exe" "$@"
printf '\nAll %s tests passed.\n' "$d"
diff --git a/tests/bc/all.txt b/tests/bc/all.txt
index b623e8a11b71..92cfee226758 100644
--- a/tests/bc/all.txt
+++ b/tests/bc/all.txt
@@ -1,4 +1,7 @@
decimal
+print
+print2
+parse
length
scale
shift
@@ -22,9 +25,6 @@ engineering
globals
strings
letters
-print
-print2
-parse
exponent
log
pi
diff --git a/tests/bc/scripts/all.txt b/tests/bc/scripts/all.txt
new file mode 100644
index 000000000000..16f067c13b79
--- /dev/null
+++ b/tests/bc/scripts/all.txt
@@ -0,0 +1,15 @@
+print.bc
+parse.bc
+add.bc
+subtract.bc
+multiply.bc
+divide.bc
+array.bc
+atan.bc
+bessel.bc
+functions.bc
+globals.bc
+len.bc
+rand.bc
+references.bc
+screen.bc
diff --git a/tests/bc/timeconst.sh b/tests/bc/timeconst.sh
index 32e1e743d9e4..8cdc63a90e6b 100755
--- a/tests/bc/timeconst.sh
+++ b/tests/bc/timeconst.sh
@@ -1,6 +1,6 @@
#! /bin/sh
#
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -57,6 +57,11 @@ if [ ! -f "$timeconst" ]; then
exit 0
fi
+unset BC_ENV_ARGS
+unset BC_LINE_LENGTH
+unset DC_ENV_ARGS
+unset DC_LINE_LENGTH
+
printf 'Running %s...' "$base"
nums=$(printf 'for (i = 0; i <= 1000; ++i) { i }\n' | bc)
@@ -88,4 +93,4 @@ done
rm -f "$out1"
rm -f "$out2"
-printf 'pass\n'
+exec printf 'pass\n'
diff --git a/tests/bcl.c b/tests/bcl.c
index aab2c5d35e9b..5157890e9bb8 100644
--- a/tests/bcl.c
+++ b/tests/bcl.c
@@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: BSD-2-Clause
*
- * Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+ * Copyright (c) 2018-2021 Gavin D. Howard and contributors.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
diff --git a/tests/dc/errors/30.txt b/tests/dc/errors/30.txt
new file mode 100644
index 000000000000..e072e71617d8
--- /dev/null
+++ b/tests/dc/errors/30.txt
@@ -0,0 +1 @@
+0;0[]0:b;bs0l0x;0
diff --git a/tests/dc/errors/31.txt b/tests/dc/errors/31.txt
new file mode 100644
index 000000000000..9bada9d07d0e
--- /dev/null
+++ b/tests/dc/errors/31.txt
@@ -0,0 +1 @@
+0;0[]0:b;bS0l0x;0
diff --git a/tests/dc/scripts/all.txt b/tests/dc/scripts/all.txt
new file mode 100644
index 000000000000..e15dae5e15ff
--- /dev/null
+++ b/tests/dc/scripts/all.txt
@@ -0,0 +1,9 @@
+prime.dc
+asciify.dc
+stream.dc
+array.dc
+else.dc
+factorial.dc
+loop.dc
+quit.dc
+weird.dc
diff --git a/tests/diff.sh b/tests/diff.sh
new file mode 100755
index 000000000000..6d664a8a81b8
--- /dev/null
+++ b/tests/diff.sh
@@ -0,0 +1,51 @@
+#! /bin/sh
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+set -e
+
+script="$0"
+
+testdir=$(dirname "$script")
+
+if [ "$#" -lt 2 ]; then
+ printf 'usage: %s dir test\n' "$0"
+ printf 'valid dirs are:\n'
+ printf '\n'
+ cat "$testdir/all.txt"
+ printf '\n'
+ exit 1
+fi
+
+d="$1"
+shift
+
+t="$1"
+shift
+
+exec diff "$testdir/$d/${t}_results.txt" "$testdir/${d}_outputs/${t}_results.txt"
diff --git a/tests/errors.sh b/tests/errors.sh
index 17c84ca24ef3..4654aed2f970 100755
--- a/tests/errors.sh
+++ b/tests/errors.sh
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -49,7 +49,17 @@ else
shift
fi
-out="$testdir/../.log_${d}_test.txt"
+unset BC_ENV_ARGS
+unset BC_LINE_LENGTH
+unset DC_ENV_ARGS
+unset DC_LINE_LENGTH
+
+out="$testdir/${d}_outputs/errors_results.txt"
+outdir=$(dirname "$out")
+
+if [ ! -d "$outdir" ]; then
+ mkdir -p "$outdir"
+fi
exebase=$(basename "$exe")
@@ -83,7 +93,7 @@ for testfile in $testdir/$d/*errors.txt; do
die "$d" "returned an error ($err)" "POSIX warning" 1
fi
- checktest "$d" "1" "$line" "$out" "$exebase"
+ checkerrtest "$d" "1" "$line" "$out" "$exebase"
options="-ls"
else
@@ -101,7 +111,7 @@ for testfile in $testdir/$d/*errors.txt; do
printf '%s\n' "$line" | "$exe" "$@" "$options" 2> "$out" > /dev/null
err="$?"
- checktest "$d" "$err" "$line" "$out" "$exebase"
+ checkerrtest "$d" "$err" "$line" "$out" "$exebase"
done < "$testfile"
@@ -116,7 +126,7 @@ for testfile in $testdir/$d/errors/*.txt; do
printf '%s\n' "$halt" | "$exe" "$@" $opts "$testfile" 2> "$out" > /dev/null
err="$?"
- checktest "$d" "$err" "$testfile" "$out" "$exebase"
+ checkerrtest "$d" "$err" "$testfile" "$out" "$exebase"
printf 'pass\n'
diff --git a/tests/extra_required.txt b/tests/extra_required.txt
new file mode 100644
index 000000000000..a87a9a0aacf2
--- /dev/null
+++ b/tests/extra_required.txt
@@ -0,0 +1,7 @@
+engineering
+lib2
+places
+rand
+scientific
+shift
+trunc
diff --git a/tests/fuzzing/bc.dict b/tests/fuzzing/bc.dict
new file mode 100644
index 000000000000..f4dc965844e1
--- /dev/null
+++ b/tests/fuzzing/bc.dict
@@ -0,0 +1,68 @@
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+# AFL dictionary for bc
+#
+
+keyword_abs="abs"
+keyword_auto="auto"
+keyword_break="break"
+keyword_continue="continue"
+keyword_define="define"
+keyword_else="else"
+keyword_for="for"
+keyword_halt="halt"
+keyword_ibase="ibase"
+keyword_if="if"
+keyword_irand="irand"
+keyword_last="last"
+keyword_length="length"
+keyword_limits="limits"
+keyword_maxibase="maxibase"
+keyword_maxobase="maxobase"
+keyword_maxrand="maxrand"
+keyword_maxscale="maxscale"
+keyword_obase="obase"
+keyword_print="print"
+keyword_quit="quit"
+keyword_rand="rand"
+keyword_read="read"
+keyword_return="return"
+keyword_scale="scale"
+keyword_seed="seed"
+keyword_sqrt="sqrt"
+keyword_while="while"
+
+"{"
+"}"
+","
+"["
+"]"
+"1"
+"1.234"
+"-3.2892"
+"3e4"
diff --git a/tests/fuzzing/bc_inputs1/abs.txt b/tests/fuzzing/bc_inputs1/abs.txt
new file mode 100644
index 000000000000..ffb7aba65c3b
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/abs.txt
@@ -0,0 +1,7 @@
+abs(0)
+abs(1)
+abs(.289365)
+abs(289.82937658)
+abs(-19)
+abs(-.2098180)
+abs(-198289.1098376)
diff --git a/tests/fuzzing/bc_inputs1/add.txt b/tests/fuzzing/bc_inputs1/add.txt
new file mode 100644
index 000000000000..647781732c63
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/add.txt
@@ -0,0 +1,146 @@
+0 + 0
+0 + 1
+1 + 1
+1 + 0
+2 + 5
+237 + 483
+999 + 999
+2374623 + 324869356734856
+2378639084586723980562 + 23468729367839
+37298367203972395108367910823465293084561329084561390845613409516734503870691837451 + 785621394067928346918023476190834672198467134908618723249671349062187346898241093486139046139084613490817356023871869102746182749061872609129847
+1.1 + 0
+0 + 1.1
+457283.731284923576 + 37842934672834.3874629385672354
+1.0 + 0.1
+3746289134067138046 + 0.138375863945672398456712389456273486293
+-1 + -1
+-4 + -15
+-1346782 + -1287904651762468913476
+99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999995 + 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005
+99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999899999999999999999999999999999999999999999999999999999999999999 + 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+99999999999999999999999999999999999989999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+-1889985797 + 2012747315
+0 + -14338.391079082
+-2422297 + 1.3134942556
+182039471029834 + 282039471029834
+282039471029834 + 182039471029834
+182039471029834.2801722893 + 282039471029834
+282039471029834.2801722893 + 182039471029834
+182039471029834.2801722893 + 282039471029834.2838
+282039471029834.2801722893 + 182039471029834.2838
+182039471029834 + 282039471029834.2801722893
+282039471029834 + 182039471029834.2801722893
+182039471029834.8297282893 + 282039471029834.2801722893
+282039471029834.8297282893 + 182039471029834.2801722893
+471029834 + 282039471029834
+471029834 + 182039471029834
+471029834.2801722893 + 282039471029834
+471029834.2801722893 + 182039471029834
+471029834.2801722893 + 282039471029834.2838
+471029834.2801722893 + 182039471029834.2838
+471029834 + 282039471029834.2801722893
+471029834 + 182039471029834.2801722893
+471029834.8297282893 + 282039471029834.2801722893
+471029834.8297282893 + 182039471029834.2801722893
+182039471029834 + 471029834
+282039471029834 + 471029834
+182039471029834.2801722893 + 471029834
+282039471029834.2801722893 + 471029834
+182039471029834.2801722893 + 471029834.2838
+282039471029834.2801722893 + 471029834.2838
+182039471029834 + 471029834.2801722893
+282039471029834 + 471029834.2801722893
+182039471029834.8297282893 + 471029834.2801722893
+282039471029834.8297282893 + 471029834.2801722893
+-182039471029834 + 282039471029834
+-282039471029834 + 182039471029834
+-182039471029834.2801722893 + 282039471029834
+-282039471029834.2801722893 + 182039471029834
+-182039471029834.2801722893 + 282039471029834.2838
+-282039471029834.2801722893 + 182039471029834.2838
+-182039471029834 + 282039471029834.2801722893
+-282039471029834 + 182039471029834.2801722893
+-182039471029834.8297282893 + 282039471029834.2801722893
+-282039471029834.8297282893 + 182039471029834.2801722893
+-471029834 + 282039471029834
+-471029834 + 182039471029834
+-471029834.2801722893 + 282039471029834
+-471029834.2801722893 + 182039471029834
+-471029834.2801722893 + 282039471029834.2838
+-471029834.2801722893 + 182039471029834.2838
+-471029834 + 282039471029834.2801722893
+-471029834 + 182039471029834.2801722893
+-471029834.8297282893 + 282039471029834.2801722893
+-471029834.8297282893 + 182039471029834.2801722893
+-182039471029834 + 471029834
+-282039471029834 + 471029834
+-182039471029834.2801722893 + 471029834
+-282039471029834.2801722893 + 471029834
+-182039471029834.2801722893 + 471029834.2838
+-282039471029834.2801722893 + 471029834.2838
+-182039471029834 + 471029834.2801722893
+-282039471029834 + 471029834.2801722893
+-182039471029834.8297282893 + 471029834.2801722893
+-282039471029834.8297282893 + 471029834.2801722893
+182039471029834 + -282039471029834
+282039471029834 + -182039471029834
+182039471029834.2801722893 + -282039471029834
+282039471029834.2801722893 + -182039471029834
+182039471029834.2801722893 + -282039471029834.2838
+282039471029834.2801722893 + -182039471029834.2838
+182039471029834 + -282039471029834.2801722893
+282039471029834 + -182039471029834.2801722893
+182039471029834.8297282893 + -282039471029834.2801722893
+282039471029834.8297282893 + -182039471029834.2801722893
+471029834 + -282039471029834
+471029834 + -182039471029834
+471029834.2801722893 + -282039471029834
+471029834.2801722893 + -182039471029834
+471029834.2801722893 + -282039471029834.2838
+471029834.2801722893 + -182039471029834.2838
+471029834 + -282039471029834.2801722893
+471029834 + -182039471029834.2801722893
+471029834.8297282893 + -282039471029834.2801722893
+471029834.8297282893 + -182039471029834.2801722893
+182039471029834 + -471029834
+282039471029834 + -471029834
+182039471029834.2801722893 + -471029834
+282039471029834.2801722893 + -471029834
+182039471029834.2801722893 + -471029834.2838
+282039471029834.2801722893 + -471029834.2838
+182039471029834 + -471029834.2801722893
+282039471029834 + -471029834.2801722893
+182039471029834.8297282893 + -471029834.2801722893
+282039471029834.8297282893 + -471029834.2801722893
+-182039471029834 + -282039471029834
+-282039471029834 + -182039471029834
+-182039471029834.2801722893 + -282039471029834
+-282039471029834.2801722893 + -182039471029834
+-182039471029834.2801722893 + -282039471029834.2838
+-282039471029834.2801722893 + -182039471029834.2838
+-182039471029834 + -282039471029834.2801722893
+-282039471029834 + -182039471029834.2801722893
+-182039471029834.8297282893 + -282039471029834.2801722893
+-282039471029834.8297282893 + -182039471029834.2801722893
+-471029834 + -282039471029834
+-471029834 + -182039471029834
+-471029834.2801722893 + -282039471029834
+-471029834.2801722893 + -182039471029834
+-471029834.2801722893 + -282039471029834.2838
+-471029834.2801722893 + -182039471029834.2838
+-471029834 + -282039471029834.2801722893
+-471029834 + -182039471029834.2801722893
+-471029834.8297282893 + -282039471029834.2801722893
+-471029834.8297282893 + -182039471029834.2801722893
+-182039471029834 + -471029834
+-282039471029834 + -471029834
+-182039471029834.2801722893 + -471029834
+-282039471029834.2801722893 + -471029834
+-182039471029834.2801722893 + -471029834.2838
+-282039471029834.2801722893 + -471029834.2838
+-182039471029834 + -471029834.2801722893
+-282039471029834 + -471029834.2801722893
+-182039471029834.8297282893 + -471029834.2801722893
+-282039471029834.8297282893 + -471029834.2801722893
diff --git a/tests/fuzzing/bc_inputs1/arctangent.txt b/tests/fuzzing/bc_inputs1/arctangent.txt
new file mode 100644
index 000000000000..f665ea90b728
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/arctangent.txt
@@ -0,0 +1,26 @@
+a(.267)
+a(1)
+scale = 64
+a(.267)
+a(1)
+scale = 100
+a(.267)
+a(1)
+scale = 20
+a(0)
+a(.5)
+a(0.577350269189625764509148780501)
+a(1.5)
+a(1.7320508075688772935274463415)
+a(2)
+a(3)
+a(1000)
+a(-.5)
+a(-0.577350269189625764509148780501)
+a(-1.5)
+a(-1.7320508075688772935274463415)
+a(-2)
+a(-3)
+a(-1000)
+a(-3249917614.2821897119)
+a(-694706362.1974670468)
diff --git a/tests/fuzzing/bc_inputs1/array.bc b/tests/fuzzing/bc_inputs1/array.bc
new file mode 100755
index 000000000000..dac232804914
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/array.bc
@@ -0,0 +1,60 @@
+#! /usr/bin/bc -q
+
+define z(a[]) {
+ for (i = 0; i < l; ++i) {
+ a[i]
+ }
+}
+
+define x(a[]) {
+
+ # Test for separate vars and arrays.
+ auto a
+
+ for (a = 0; a < l; ++a) {
+ a[a] = -a
+ }
+
+ z(a[])
+}
+
+define g(x[], y[]) {
+ return x[0] - y[0]
+}
+
+define h(y[], x[]) {
+ return g(x[], y[])
+}
+
+define m(*x[], *y[]) {
+ return x[0] / y[0]
+}
+
+define n(*y[], *x[]) {
+ return m(x[], y[])
+}
+
+for (i = 0; i < 101; ++i) {
+ a[i] = i
+}
+
+a[104] = 204
+
+l = length(a[])
+
+for (i = 0; i <= l; ++i) {
+ a[i]
+}
+
+z(a[])
+x(a[])
+z(a[])
+l
+
+x[0] = 5
+y[0] = 4
+
+h(x[], y[])
+n(x[], y[])
+
+halt
diff --git a/tests/fuzzing/bc_inputs1/arrays.txt b/tests/fuzzing/bc_inputs1/arrays.txt
new file mode 100644
index 000000000000..26a284b8d814
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/arrays.txt
@@ -0,0 +1,10 @@
+a[0] = 1
+a[2-1] = 2
+
+a[0]+a[0]
+
+a[2-1]+a[2-1]
+
+a[5] = 2
+a[5.789]
+
diff --git a/tests/fuzzing/bc_inputs1/assignments.txt b/tests/fuzzing/bc_inputs1/assignments.txt
new file mode 100644
index 000000000000..6a776e7840ec
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/assignments.txt
@@ -0,0 +1,122 @@
+define x(x) {
+ return (i++ + x)
+}
+define y(x) {
+ return (++i + x)
+}
+define z(x) {
+ return (i *= 2) + x
+}
+
+i++
+i--
+++i
+--i
+
+(i++)
+(i--)
+(++i)
+(--i)
+
+i += 1
+i
+i -= -4
+i
+i *= 5
+i
+i /= 12.5
+i
+
+i = 0
+
+(i += 1)
+(i -= -4)
+(i *= 5)
+(i /= 12.5)
+
+i = 0
+
+a[i++] += ++i
+i--
+i--
+i
+a[i]
+
+a[i]++
+a[i]--
+++a[i]
+--a[i]
+
+i += 4
+i
+
+sqrt(i *= 4)
+i
+length(i /= 2)
+i
+
+i = 4
+scale(i /= 2)
+i
+
+i = -1
+
+abs(i--)
+abs(--i)
+abs(++i)
+abs(i++)
+
+i = -i
+
+a = 4
+
+x(a)
+i
+
+x(a *= 5)
+a
+i
+
+a = 4
+
+y(a)
+i
+
+y(a -= 2)
+a
+i
+
+a = 4
+
+z(a)
+i
+
+z(a /= 0.5)
+a
+i
+
+i = 1
+
+if (i -= 1) print "true\n"
+else print "false\n"
+
+if (i += 1) print "true\n"
+else print "false\n"
+
+i = 3
+
+while (i -= 2) print "i: ", i += 1, "\n"
+
+a = 5
+
+for (i = 5; i-= 1; --a) print "i: ", i, "; a: ", a, "\n"
+
+define void t(x, y) {
+ print "x: ", x, "; y: ", y, "\n"
+}
+
+t(i++, i++)
+i
+
+t(++i, ++i)
+i
diff --git a/tests/fuzzing/bc_inputs1/basic.txt b/tests/fuzzing/bc_inputs1/basic.txt
new file mode 100644
index 000000000000..f3d957a26635
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/basic.txt
@@ -0,0 +1,7 @@
+scale=10;123981239.981273987 * 12983791827398.29836472638
+scale=100;759634576394.3946587934658364895 / 9834759834895386.36459364958346
+34895734986539489834759837489573498573.398475984759837485734987598345 + 9823749832749872384234872934.28347982374987239847982374
+a=123123123.987239874; b=123123123.239479823748; a+b
+20347023.23498723984 - 28934723874.234720384
+scale=100;a=739534985.895347284957;b=238746782364.2374623784; c = a / b; c+0
+
diff --git a/tests/fuzzing/bc_inputs1/boolean.txt b/tests/fuzzing/bc_inputs1/boolean.txt
new file mode 100644
index 000000000000..e26ded34bd1d
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/boolean.txt
@@ -0,0 +1,184 @@
+!0
+!1
+!(-129)
+4 && 5
+4 && 0
+0 && 5
+4 && 5 && 7
+4 && 0 && 7
+0 && 5 && 7
+4 && 5 && 0
+0 && 0 && 7
+4 && 0 && 0
+0 && 5 && 0
+!4 && 5
+!4 && 0
+!0 && 5
+4 && !5
+4 && !0
+0 && !5
+!4 && 5 && 7
+!4 && 0 && 7
+!0 && 5 && 7
+!4 && 5 && 0
+!0 && 0 && 7
+!4 && 0 && 0
+!0 && 5 && 0
+4 && !5 && 7
+4 && !0 && 7
+0 && !5 && 7
+4 && !5 && 0
+0 && !0 && 7
+4 && !0 && 0
+0 && !5 && 0
+4 && 5 && !7
+4 && 0 && !7
+0 && 5 && !7
+4 && 5 && !0
+0 && 0 && !7
+4 && 0 && !0
+0 && 5 && !0
+!4 && !5 && 7
+!4 && !0 && 7
+!0 && !5 && 7
+!4 && !5 && 0
+!0 && !0 && 7
+!4 && !0 && 0
+!0 && !5 && 0
+!4 && 5 && !7
+!4 && 0 && !7
+!0 && 5 && !7
+!4 && 5 && !0
+!0 && 0 && !7
+!4 && 0 && !0
+!0 && 5 && !0
+4 && !5 && !7
+4 && !0 && !7
+0 && !5 && !7
+4 && !5 && !0
+0 && !0 && !7
+4 && !0 && !0
+0 && !5 && !0
+!4 && !5 && !7
+!4 && !0 && !7
+!0 && !5 && !7
+!4 && !5 && !0
+!0 && !0 && !7
+!4 && !0 && !0
+!0 && !5 && !0
+3 < 4 && 7
+3 && 4 >= 4
+3 > 4 && 7
+3 && 4 >= 5
+3 < 4 && 0
+0 && 4 >= 4
+3 > 4 && 0
+0 && 4 >= 5
+3 > 4 && 0
+0 && 4 < 4
+3 >= 4 && 0
+0 && 4 >= 5
+3 < 4 && 7
+3 && 4 >= 4
+3 > 4 && 7 > 4
+3 >= 2 && 4 >= 5
+3 < 4 && 0 > -1
+4 < 3 && 4 >= 4
+3 > 4 && 3 == 3
+3 != 3 && 4 >= 5
+3 > 4 && 0 > 1
+0 >= 0 && 4 < 4
+3 >= 4 && 0 >= 1
+0 <= -1 && 4 >= 5
+4 || 5
+4 || 0
+0 || 5
+4 || 5 || 7
+4 || 0 || 7
+0 || 5 || 7
+4 || 5 || 0
+0 || 0 || 7
+4 || 0 || 0
+0 || 5 || 0
+!4 || 5
+!4 || 0
+!0 || 5
+4 || !5
+4 || !0
+0 || !5
+!4 || 5 || 7
+!4 || 0 || 7
+!0 || 5 || 7
+!4 || 5 || 0
+!0 || 0 || 7
+!4 || 0 || 0
+!0 || 5 || 0
+4 || !5 || 7
+4 || !0 || 7
+0 || !5 || 7
+4 || !5 || 0
+0 || !0 || 7
+4 || !0 || 0
+0 || !5 || 0
+4 || 5 || !7
+4 || 0 || !7
+0 || 5 || !7
+4 || 5 || !0
+0 || 0 || !7
+4 || 0 || !0
+0 || 5 || !0
+!4 || !5 || 7
+!4 || !0 || 7
+!0 || !5 || 7
+!4 || !5 || 0
+!0 || !0 || 7
+!4 || !0 || 0
+!0 || !5 || 0
+!4 || 5 || !7
+!4 || 0 || !7
+!0 || 5 || !7
+!4 || 5 || !0
+!0 || 0 || !7
+!4 || 0 || !0
+!0 || 5 || !0
+4 || !5 || !7
+4 || !0 || !7
+0 || !5 || !7
+4 || !5 || !0
+0 || !0 || !7
+4 || !0 || !0
+0 || !5 || !0
+!4 || !5 || !7
+!4 || !0 || !7
+!0 || !5 || !7
+!4 || !5 || !0
+!0 || !0 || !7
+!4 || !0 || !0
+!0 || !5 || !0
+3 < 4 || 7
+3 || 4 >= 4
+3 > 4 || 7
+3 || 4 >= 5
+3 < 4 || 0
+0 || 4 >= 4
+3 > 4 || 0
+0 || 4 >= 5
+3 > 4 || 0
+0 || 4 < 4
+3 >= 4 || 0
+0 || 4 >= 5
+3 < 4 || 7
+3 || 4 >= 4
+3 > 4 || 7 > 4
+3 >= 2 || 4 >= 5
+3 < 4 || 0 > -1
+4 < 3 || 4 >= 4
+3 > 4 || 3 == 3
+3 != 3 || 4 >= 5
+3 > 4 || 0 > 1
+0 >= 0 || 4 < 4
+3 >= 4 || 0 >= 1
+0 <= -1 || 4 >= 5
+1 <= 0 && 1 <= 2 || 1 >= 0 && 1 == 2
+1 <= 0 && 1 <= 2 || 1 >= 0 && 1 != 2
+1 >= 0 && 1 <= 2 || 1 >= 0 && 1 == 2
diff --git a/tests/fuzzing/bc_inputs1/cosine.txt b/tests/fuzzing/bc_inputs1/cosine.txt
new file mode 100644
index 000000000000..9e67df4c6f69
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/cosine.txt
@@ -0,0 +1,44 @@
+scale = 25
+p = 4 * a(1)
+scale = 20
+c(0)
+c(0.5)
+c(1)
+c(2)
+c(3)
+c(-0.5)
+c(-1)
+c(-2)
+c(-3)
+c(p / 7)
+c(-p / 7)
+c(p / 4)
+c(-p / 4)
+c(p / 3)
+c(-p / 3)
+c(p / 2)
+c(-p / 2)
+c(3 * p / 4)
+c(3 * -p / 4)
+c(p)
+c(-p)
+c(3 * p / 2)
+c(3 * -p / 2)
+c(7 * p / 4)
+c(7 * -p / 4)
+c(13 * p / 4)
+c(13 * -p / 4)
+c(2 * p)
+c(2 * -p)
+c(131231)
+c(-131231)
+c(859799894.3562378245)
+c(859799894.3562378245)
+c(4307371)
+c(3522556.3323810191)
+c(44961070)
+c(6918619.1574479809)
+c(190836996.2180244164)
+c(34934)
+c(2483599)
+c(13720376)
diff --git a/tests/fuzzing/bc_inputs1/decimal.txt b/tests/fuzzing/bc_inputs1/decimal.txt
new file mode 100644
index 000000000000..5c6bd327c1a8
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/decimal.txt
@@ -0,0 +1,35 @@
+0
+0.0
+000000000000000000000000.00000000000000000000000
+000000000000000000000000000135482346782356
+000000000000000000000000002
+1
+11
+123
+7505
+1023468723275435238491972521917846
+4343472432431705867392073517038270398027352709027389273920739037937960379637893607893607893670530278200795207952702873892786172916728961783907893607418973587857386079679267926737520730925372983782793652793
+-1
+-203
+-57
+-18586
+-31378682943772818461924738352952347258
+-823945628745673589495067238723986520375698237620834674509627345273096287563846592384526349872634895763257893467523987578690283762897568459072348758071071087813501875908127359018715023841710239872301387278
+.123521346523546
+0.1245923756273856
+-.1024678456387
+-0.8735863475634587
+4.0
+-6.0
+234237468293576.000000000000000000000000000000
+23987623568943567.00000000000000000005677834650000000000000
+23856934568940675.000000000000000435676782300000000000000456784
+77567648698496.000000000000000000587674750000000000458563800000000000000
+2348672354968723.2374823546000000000003256987394502346892435623870000000034578
+-2354768.000000000000000000000000000000000000
+-96739874567.000000000347683456
+-3764568345.000000000004573845000000347683460
+-356784356.934568495770004586495678300000000
+74325437345273852773827101738273127312738521733017537073520735207307570358738257390761276072160719802671980267018728630178.7082681027680521760217867841276127681270867827821768173178207830710978017738178678012767377058785378278207385237085237803278203782037237582795870
+-756752732785273851273728537852738257837283678965738527385272983678372867327835672967385278372637862738627836279863782673862783670.71738178361738718367186378610738617836781603760178367018603760178107735278372832783728367826738627836278378260736270367362073867097307925
+9812734012837410982345719208345712908357412903587192048571920458712.23957182459817249058172945781
diff --git a/tests/fuzzing/bc_inputs1/divide.txt b/tests/fuzzing/bc_inputs1/divide.txt
new file mode 100644
index 000000000000..4d0caddc9b52
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/divide.txt
@@ -0,0 +1,31 @@
+0 / 1
+0 / 321566
+0 / 0.3984567238456
+1 / 1
+1 / 1287469297356
+1 / 0.2395672438567234
+1 / 237586239856.0293596728392360
+1249687284356 / 3027949207835207
+378617298617396719 / 35748521
+9348576237845624358 / 0.9857829375461
+35768293846193284 / 2374568947.045762839567823
+-78987234567812345 / 876542837618936
+-356789237555535468 / 0.3375273860984786903
+-5203475364850390 / 435742903748307.70869378534043296404530458
+-0.37861723347576903 / 7385770896
+-0.399454682043962 / 0.34824389304
+-0.6920414523873204 / 356489645223.76076045304879030
+-35872917389671.7573280963748 / 73924708
+-78375896314.4836709876983 / 0.78356798637817
+-2374123896417.143789621437581 / 347821469423789.1473856783960
+-896729350238549726 / -34976289345762
+-2374568293458762348596 / -0.8792370647234987679
+-237584692306721845726038 / -21783910782374529637.978102738746189024761
+-0.23457980123576298375682 / -1375486293874612
+-0.173897061862478951264 / -0.8179327486017634987516298745
+-0.9186739823576829347586 / -0.235678293458756239846
+-0.9375896183746982374568 / -13784962873546.0928729395476283745
+-2930754618923467.12323745862937465 / -734869238465
+-23745861923467.874675129834675 / -0.23542357869124756
+-3878923750692883.7238596702834756902 / -7384192674957215364986723.9738461923487621983
+1 / 0.00000000000000000000000000000000000000000002346728372937352457354204563027
diff --git a/tests/fuzzing/bc_inputs1/engineering.txt b/tests/fuzzing/bc_inputs1/engineering.txt
new file mode 100644
index 000000000000..cf9c0c1b0117
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/engineering.txt
@@ -0,0 +1,19 @@
+obase=1
+0
+1
+-34
+298
+-8933
+29488
+-148232
+8927559
+.2
+-.02
+.002
+-.0003
+.0000209310
+-.00000289362
+.000000859289
+-.02983672
+.20201296
+-.8907210897000000000000000000
diff --git a/tests/fuzzing/bc_inputs1/exponent.txt b/tests/fuzzing/bc_inputs1/exponent.txt
new file mode 100644
index 000000000000..40bcf3c5a585
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/exponent.txt
@@ -0,0 +1,22 @@
+e(0)
+e(0.5)
+e(1)
+e(1.5)
+e(1.74)
+e(2)
+e(3.2345)
+e(5.283957)
+e(13.23857)
+e(100)
+e(283.238957)
+e(-0.5)
+e(-1)
+e(-1.5)
+e(-1.74)
+e(-2)
+e(-3.2345)
+e(-5.283957)
+e(-13.23857)
+e(-100)
+e(-283.238957)
+e(142.749502399)
diff --git a/tests/fuzzing/bc_inputs1/functions.bc b/tests/fuzzing/bc_inputs1/functions.bc
new file mode 100644
index 000000000000..80d6d1623d8d
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/functions.bc
@@ -0,0 +1,7 @@
+e(0.5)
+
+define e(x) {
+ return x
+}
+
+e(0.5)
diff --git a/tests/fuzzing/bc_inputs1/functions.txt b/tests/fuzzing/bc_inputs1/functions.txt
new file mode 100644
index 000000000000..5e540ed66a11
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/functions.txt
@@ -0,0 +1,13 @@
+define x(x, y) {
+ return x - y + 5
+}
+
+define y(y, x) {
+ return x(y, x) + x(x, y)
+}
+
+y(1, 4)
+y(2, 4)
+y(3, 4)
+y(4, 3)
+y(3, 2)
diff --git a/tests/fuzzing/bc_inputs1/globals.txt b/tests/fuzzing/bc_inputs1/globals.txt
new file mode 100644
index 000000000000..4b20f5725864
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/globals.txt
@@ -0,0 +1,21 @@
+define i(x) {
+ ibase=x
+ return ibase
+}
+
+define o(x) {
+ obase=x
+ return obase
+}
+
+define r(x) {
+ scale=x
+ return scale
+}
+
+i(11)
+ibase
+o(12)
+obase
+r(15)
+scale
diff --git a/tests/fuzzing/bc_inputs1/len.bc b/tests/fuzzing/bc_inputs1/len.bc
new file mode 100644
index 000000000000..ec931f2386a5
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/len.bc
@@ -0,0 +1,48 @@
+define fast_gcd(a, b) {
+
+ if (a == b) return a;
+ if (a > b) return fast_gcd(a - b, b)
+
+ return fast_gcd(a, b - a);
+}
+
+define void r_reduce(*r[]) {
+
+ auto g,s;
+
+ if (length(r[]) != 2) sqrt(-1);
+ if (scale(r[0])) 2^r[0];
+ if (scale(r[1])) 2^r[1];
+
+ if (r[0] >= 0 && r[1] >= 0) g = fast_gcd(r[0], r[1]);
+ else g = gcd(r[0], r[1]);
+
+ s = scale;
+ scale = 0;
+
+ r[0] /= g;
+ r[1] /= g;
+
+ scale = s;
+}
+
+define void r_init(*r[], a, b) {
+ r[0] = a;
+ r[1] = b;
+ r_reduce(r[]);
+}
+
+define void r_initi(*r[], i, a, b) {
+
+ length(r[]);
+
+ r[0] = i * b + a;
+ r[1] = b;
+
+ length(r[]);
+
+ r_reduce(r[]);
+}
+
+length(a[])
+r_initi(a[], 5, 63, 94);
diff --git a/tests/fuzzing/bc_inputs1/length.txt b/tests/fuzzing/bc_inputs1/length.txt
new file mode 100644
index 000000000000..48f83c95cf55
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/length.txt
@@ -0,0 +1,59 @@
+length(0)
+length(1)
+length(12)
+length(123)
+length(1234)
+length(12345)
+length(123456)
+length(1234567)
+length(12345678)
+length(123456789)
+length(1234567890)
+length(1.0)
+length(12.0)
+length(123.0)
+length(1234.0)
+length(12345.0)
+length(123456.0)
+length(1234567.0)
+length(12345678.0)
+length(123456789.0)
+length(1234567890.0)
+length(.1)
+length(.12)
+length(.123)
+length(.1234)
+length(.12345)
+length(.123456)
+length(.1234567)
+length(.12345678)
+length(.123456789)
+length(.1234567890)
+length(.01)
+length(.012)
+length(.0123)
+length(.01234)
+length(.012345)
+length(.0123456)
+length(.01234567)
+length(.012345678)
+length(.0123456789)
+length(.01234567890)
+length(.0000000001)
+length(.00000000012)
+length(.000000000123)
+length(.0000000001234)
+length(.00000000012345)
+length(.000000000123456)
+length(.0000000001234567)
+length(.00000000012345678)
+length(.000000000123456789)
+length(.0000000001234567890)
+length(289.29837)
+length(2893.00000)
+length(289.0)
+length(1802973.0000000238)
+length(.000000000000000093182394080000000000)
+a[0] = 0
+a[5] = 0
+length(a[])
diff --git a/tests/fuzzing/bc_inputs1/lib10.txt b/tests/fuzzing/bc_inputs1/lib10.txt
new file mode 100644
index 000000000000..7aa3fda19cc7
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/lib10.txt
@@ -0,0 +1,4 @@
+l10(0)
+l10(99)
+l10(100)
+l10(-100)
diff --git a/tests/fuzzing/bc_inputs1/lib11.txt b/tests/fuzzing/bc_inputs1/lib11.txt
new file mode 100644
index 000000000000..5bb262bd2668
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/lib11.txt
@@ -0,0 +1,4 @@
+perm(10, 2)
+comb(10, 2)
+perm(6, 2)
+comb(6, 2)
diff --git a/tests/fuzzing/bc_inputs1/lib12.txt b/tests/fuzzing/bc_inputs1/lib12.txt
new file mode 100644
index 000000000000..7d70e1ccdd5e
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/lib12.txt
@@ -0,0 +1 @@
+uint(0)
diff --git a/tests/fuzzing/bc_inputs1/lib2.txt b/tests/fuzzing/bc_inputs1/lib2.txt
new file mode 100644
index 000000000000..f345bd1669cb
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/lib2.txt
@@ -0,0 +1,15 @@
+r(0, 0)
+r(0, 1)
+r(0, 100)
+r(1, 0)
+r(1, 3)
+r(1.4, 0)
+r(1.5, 0)
+r(34.45, 2)
+r(64.1223, 4)
+r(-1, 0)
+r(-1, 3)
+r(-1.4, 0)
+r(-1.5, 0)
+r(-34.45, 2)
+r(-64.1223, 4)
diff --git a/tests/fuzzing/bc_inputs1/lib3.txt b/tests/fuzzing/bc_inputs1/lib3.txt
new file mode 100644
index 000000000000..1da42385ea44
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/lib3.txt
@@ -0,0 +1,6 @@
+f(0)
+f(1)
+f(2)
+f(3)
+f(4)
+f(5)
diff --git a/tests/fuzzing/bc_inputs1/lib4.txt b/tests/fuzzing/bc_inputs1/lib4.txt
new file mode 100644
index 000000000000..9f5323375d30
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/lib4.txt
@@ -0,0 +1,10 @@
+binary(0)
+hex(0)
+binary(1)
+hex(1)
+binary(2)
+hex(2)
+binary(15)
+hex(15)
+binary(16)
+hex(16)
diff --git a/tests/fuzzing/bc_inputs1/lib5.txt b/tests/fuzzing/bc_inputs1/lib5.txt
new file mode 100644
index 000000000000..c69a49167292
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/lib5.txt
@@ -0,0 +1,2 @@
+uint32(2147483647)
+int32(2147483647)
diff --git a/tests/fuzzing/bc_inputs1/lib6.txt b/tests/fuzzing/bc_inputs1/lib6.txt
new file mode 100644
index 000000000000..260e159f9fb6
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/lib6.txt
@@ -0,0 +1,5 @@
+pi(5)
+p=pi(scale)
+r2d(-p)
+d2r(180)
+d2r(-180)
diff --git a/tests/fuzzing/bc_inputs1/lib7.txt b/tests/fuzzing/bc_inputs1/lib7.txt
new file mode 100644
index 000000000000..edd66a40e83a
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/lib7.txt
@@ -0,0 +1,12 @@
+ubytes(0)
+ubytes(1)
+ubytes(2)
+sbytes(0)
+sbytes(1)
+sbytes(-1)
+sbytes(2)
+sbytes(127)
+sbytes(128)
+sbytes(254)
+sbytes(255)
+sbytes(256)
diff --git a/tests/fuzzing/bc_inputs1/lib8.txt b/tests/fuzzing/bc_inputs1/lib8.txt
new file mode 100644
index 000000000000..a4cc720c4754
--- /dev/null
+++ b/tests/fuzzing/bc_inputs1/lib8.txt
@@ -0,0 +1,3 @@
+l2(0)
+l2(8)
+l2(-8)
diff --git a/tests/fuzzing/bc_inputs2/lib13.txt b/tests/fuzzing/bc_inputs2/lib13.txt
new file mode 100644
index 000000000000..f7957ddc81fb
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/lib13.txt
@@ -0,0 +1 @@
+uint(-3)
diff --git a/tests/fuzzing/bc_inputs2/lib14.txt b/tests/fuzzing/bc_inputs2/lib14.txt
new file mode 100644
index 000000000000..a07d4730c269
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/lib14.txt
@@ -0,0 +1 @@
+uint64(2147483647)
diff --git a/tests/fuzzing/bc_inputs2/lib15.txt b/tests/fuzzing/bc_inputs2/lib15.txt
new file mode 100644
index 000000000000..13be33145ba3
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/lib15.txt
@@ -0,0 +1 @@
+uint(1)
diff --git a/tests/fuzzing/bc_inputs2/lib16.txt b/tests/fuzzing/bc_inputs2/lib16.txt
new file mode 100644
index 000000000000..de8dff5e7fee
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/lib16.txt
@@ -0,0 +1 @@
+uint(2147483647)
diff --git a/tests/fuzzing/bc_inputs2/lib19.txt b/tests/fuzzing/bc_inputs2/lib19.txt
new file mode 100644
index 000000000000..95fdd40264fa
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/lib19.txt
@@ -0,0 +1 @@
+int(4294967296)
diff --git a/tests/fuzzing/bc_inputs2/lib20.txt b/tests/fuzzing/bc_inputs2/lib20.txt
new file mode 100644
index 000000000000..8872f9b5f8e1
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/lib20.txt
@@ -0,0 +1 @@
+int(-4294967296)
diff --git a/tests/fuzzing/bc_inputs2/lib21.txt b/tests/fuzzing/bc_inputs2/lib21.txt
new file mode 100644
index 000000000000..82693695945d
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/lib21.txt
@@ -0,0 +1 @@
+int(1)
diff --git a/tests/fuzzing/bc_inputs2/lib22.txt b/tests/fuzzing/bc_inputs2/lib22.txt
new file mode 100644
index 000000000000..438575ef5b7c
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/lib22.txt
@@ -0,0 +1 @@
+int(-1)
diff --git a/tests/fuzzing/bc_inputs2/lib23.txt b/tests/fuzzing/bc_inputs2/lib23.txt
new file mode 100644
index 000000000000..df3d64009e79
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/lib23.txt
@@ -0,0 +1 @@
+uint(3.928375)
diff --git a/tests/fuzzing/bc_inputs2/lib24.txt b/tests/fuzzing/bc_inputs2/lib24.txt
new file mode 100644
index 000000000000..01c7181e5133
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/lib24.txt
@@ -0,0 +1 @@
+int(4.000000)
diff --git a/tests/fuzzing/bc_inputs2/log.txt b/tests/fuzzing/bc_inputs2/log.txt
new file mode 100644
index 000000000000..54115e380ec7
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/log.txt
@@ -0,0 +1,22 @@
+l(0)
+l(0.5)
+l(1)
+l(1.5)
+l(1.74)
+l(2)
+l(3.2345)
+l(5.283957)
+l(13.23857)
+l(100)
+l(283.238957)
+l(-0.5)
+l(-1)
+l(-1.5)
+l(-1.74)
+l(-2)
+l(-3.2345)
+l(-5.283957)
+l(-13.23857)
+l(-100)
+l(-283.238957)
+l(10430710.3325472917)
diff --git a/tests/fuzzing/bc_inputs2/misc.txt b/tests/fuzzing/bc_inputs2/misc.txt
new file mode 100644
index 000000000000..571f4a87e262
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/misc.txt
@@ -0,0 +1,13 @@
+4.1*1.-13^ - 74 - 1284597623841*1.-13^ - 757
+4.1*1.\
+-1\
+3^ - 74 - 1284597623841*1.\
+-1\
+3^ - 757
+obase = 9
+4.1*1.-13^ - 74 - 1284597623841*1.-13^ - 757
+4.1*1.\
+-1\
+3^ - 74 - 1284597623841*1.\
+-1\
+3^ - 757
diff --git a/tests/fuzzing/bc_inputs2/misc1.txt b/tests/fuzzing/bc_inputs2/misc1.txt
new file mode 100644
index 000000000000..7e9d9660457f
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/misc1.txt
@@ -0,0 +1,76 @@
+define x(x) {
+ return(x)
+}
+define y() {
+ return;
+}
+define z() {
+ return ();
+}
+scale = 0
+x=2
+x[0]=3
+x
+x[0]
+scale
+ibase
+obase
+x ( 7 )
+x + x( 8 )
+x - x[0]
+321 * x
+2 ^ x[0]
+x++
+--x
+x += 9
+x
+length(2381)
+sqrt(9)
+scale(238.1)
+x=2
+x[0]=3
+(x)
+(x[0])
+(scale)
+(ibase)
+(obase)
+(x ( 7 ))
+(x + x( 8 ))
+(x - x[0])
+(321 * x)
+(2 ^ x[0])
+(x++)
+(--x)
+(x += 9)
+(length(2381))
+(sqrt(9))
+(scale(238.1))
+(scale = 0)
+(x = 10)
+(x += 100)
+(x -= 10)
+(x *= 10)
+(x /= 100)
+(x ^= 10)
+(x = sqrt(x))
+(x[1 - 1])
+x[(1 - 1)]
+2 + \
+3
+++ibase
+--ibase
+++obase
+--obase
+++last
+--last
+last
+last = 100
+last
+. = 150
+.
+++scale
+--scale
+y()
+z()
+2 + /*
+*/3
diff --git a/tests/fuzzing/bc_inputs2/misc2.txt b/tests/fuzzing/bc_inputs2/misc2.txt
new file mode 100644
index 000000000000..3b3aa683402c
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/misc2.txt
@@ -0,0 +1,110 @@
+define w() { auto z; return 1; }
+define x() {
+ "x"
+ return (1)
+}
+define y() {
+ "y"
+ return (2)
+}
+define z() {
+ "z"
+ return (3)
+}
+
+define v() { return }
+
+v()
+
+w()
+
+if (x() == y()) { 1 }
+1
+if (x() <= y()) { 2 }
+if (y() >= x()) { 3 }
+if (x() != y()) { 4 }
+if (x() < y()) { 5 }
+if (y() > x()) { 6 }
+
+if (x() == z()) { 11 }
+11
+if (x() <= z()) { 12 }
+if (z() >= x()) { 13 }
+if (x() != z()) { 14 }
+if (x() < z()) { 15 }
+if (z() > x()) { 16 }
+
+x = -10
+while (x <= 0) {
+ x
+ if (x == -5) break;
+ x += 1
+}
+
+define u() {
+ auto a[];
+ return a[0]
+}
+
+u()
+
+if (x == -4) x
+else x - 4
+
+x = 1
+
+if (x == 1) 1 else 2
+if (x == 0) 1 else 2
+
+if (x == 1) 1 else if (x == 0) 2 else 3
+if (x == 0) 1 else if (x == 1) 2 else 3
+if (x == -1) 1 else if (x == 0) 2 else 3
+
+if (x == 1) if (x != 0) 1 else 2 else 3
+if (x == 1) if (x == 0) 1 else 2 else 3
+if (x != 1) if (x == 0) 1 else 2 else 3
+
+if (x == 1) while (x > 0) { x ; x -= 1 } else 0
+x = 1
+if (x == 0) while (x > 0) { x ; x -= 1 } else 0
+
+if(x == 1) {
+ 11
+ while(x == 1) {
+ 21
+ while(x == 1) {
+ 31
+ break
+ 32
+ }
+ 22
+ break
+ 23
+ }
+ 12
+}
+99
+
+for (;;) { 123 ; break; }
+for (i = 0;; ++i) { i ; if (i == 2) break; else i; }
+for (i = 0;;!++i) { i ; if (i == 2) break; else i; }
+for (i = 0;; ++i) { i ; if (i != 2) i else break }
+
+while (i > 0) if (i == 1) break else i--
+while (i < 3) if (i != 2) i++ else break
+
+for(i=1; i<=3; i++) { i; if(i==2) continue; print i,i,"\n" }
+
+print 1,2,3
+print "\n"
+
+ifz = 1
+ifz
+++ifz
+ifz++
+ifz
+
+{
+ 4
+ 5
+}
diff --git a/tests/fuzzing/bc_inputs2/misc3.txt b/tests/fuzzing/bc_inputs2/misc3.txt
new file mode 100644
index 000000000000..7aad374c4ef6
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/misc3.txt
@@ -0,0 +1,12 @@
+for (i = 0; i < A; ++i)
+{print "n"
+if(1)if(1){3
+}
+if(0)if(1){3
+}
+else 4
+if(0){if(1){3
+}}
+else 5
+{i}
+}
diff --git a/tests/fuzzing/bc_inputs2/modulus.txt b/tests/fuzzing/bc_inputs2/modulus.txt
new file mode 100644
index 000000000000..965600c18a1d
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/modulus.txt
@@ -0,0 +1,69 @@
+1 % 1
+2 % 1
+16 % 4
+15 % 4
+17 % 4
+2389473 % 5
+39240687239 % 1
+346728934 % 23958
+3496723859067234 % 298375462837546928347623059375486
+-1 % 1
+-2 % 1
+-47589634875689345 % 37869235
+-1274852934765 % 2387628935486273546
+-6324758963 % 237854962
+1 % -1
+2 % -1
+2 % -2
+2 % -3
+16 % 5
+15 % 5
+14 % 5
+89237423 % -237856923854
+123647238946 % -12467
+-1 % -1
+-2 % -1
+-2 % -2
+-2 % -3
+-13 % -7
+-14 % -7
+-15 % -7
+-12784956 % -32746
+-127849612 % -23712347682193
+scale = 0
+1 % 1
+2 % 1
+16 % 4
+15 % 4
+17 % 4
+2389473 % 5
+39240687239 % 1
+346728934 % 23958
+3496723859067234 % 298375462837546928347623059375486
+-1 % 1
+-2 % 1
+-47589634875689345 % 37869235
+-1274852934765 % 2387628935486273546
+-6324758963 % 237854962
+1 % -1
+2 % -1
+2 % -2
+2 % -3
+16 % 5
+15 % 5
+14 % 5
+89237423 % -237856923854
+123647238946 % -12467
+-1 % -1
+-2 % -1
+-2 % -2
+-2 % -3
+-13 % -7
+-14 % -7
+-15 % -7
+-12784956 % -32746
+-127849612 % -23712347682193
+-3191280681 % 641165986
+scale = 0; -899510228 % -2448300078.40314
+scale = 0; -7424863 % -207.2609738667
+scale = 0; 3769798918 % 0.6
diff --git a/tests/fuzzing/bc_inputs2/multiply.txt b/tests/fuzzing/bc_inputs2/multiply.txt
new file mode 100644
index 000000000000..f5efed91b17f
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/multiply.txt
@@ -0,0 +1,40 @@
+0 * 0
+1 * 0
+0 * 1
+0 * 2498752389672835476
+873246913745129084576134 * 0
+1 * 472638590273489273456
+12374861230476103672835496 * 1
+1 * 1
+2 * 1
+1 * 2
+2 * 2
+3 * 14
+17 * 8
+1892467513846753 * 1872439821374591038746
+328962735862.2973546835638947635 * 1728465791348762356
+38745962374538.387427384672934867234 * 0.1932476528394672837568923754
+9878894576289457634856.2738627161689017387608947567654 * 37842939768237596237854203.29874372139852739126739621793162
+-1 * 1
+-1 * 2
+78893457 * -34876238956
+235678324957634 * -0.2349578349672389576
+-12849567821934 * 12738462937681
+1274861293467.927843682937462 * -28935678239
+2936077239872.12937462836 * -0.012842357682435762
+2387692387566.2378569237546 * -272189345628.123875629835876
+0.012348629356782835962 * -23487692356
+0.4768349567348675934 * -0.23756834576934857638495
+0.98748395367485962735486 * -4675839462354867.376834956738456
+-321784627934586 * -235762378596
+-32578623567892356 * -0.32567384579638456
+-35768232346876 * -2348672935602387620.28375682349576237856
+-0.2356728394765234 * -238759624356978
+-0.2345768212346780 * -0.235768124697074385948943532045
+-0.370873860736785306278630 * -7835678398607.7086378076867096270
+-78365713707.7089637863786730 * -738580798679306780
+-73867038956790490258249 * -0.7379862716391723672803679
+-378621971598721837710387 * -98465373878350798.09743896037963078560
+37164201 * 2931559660
+679468076118972457796560530571.46287161642138401685 * 93762.2836
+.000000000000000000000000001 * .0000000000000000000000001
diff --git a/tests/fuzzing/bc_inputs2/pi.txt b/tests/fuzzing/bc_inputs2/pi.txt
new file mode 100644
index 000000000000..775545c873a8
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/pi.txt
@@ -0,0 +1,4 @@
+for (i = 0; i <= 20; ++i) {
+ scale = i
+ 4 * a(1)
+}
diff --git a/tests/fuzzing/bc_inputs2/places.txt b/tests/fuzzing/bc_inputs2/places.txt
new file mode 100644
index 000000000000..d6f20a46462f
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/places.txt
@@ -0,0 +1,19 @@
+0 @ 0
+1 @ 0
+2 @ 0
+0.0023896 @ 0
+1.298346 @ 0
+2.00000000 @ 0
+0.0023896 @ 3
+1.298346 @ 4
+2.00000000 @ 5
+289 @ 3
+18.34 @ 6
+-183.1 @ 0
+-23.238 @ 8
+-343.23 @ 2
+x = 89136.892348976
+x @= 7
+x
+-.1897263 @ 0
+.1982365 @ 0
diff --git a/tests/fuzzing/bc_inputs2/power.txt b/tests/fuzzing/bc_inputs2/power.txt
new file mode 100644
index 000000000000..5657cdd7b7d9
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/power.txt
@@ -0,0 +1,44 @@
+0 ^ 0
+0 ^ 1
+0 ^ 1894
+1 ^ 0
+39746823 ^ 0
+0.238672983047682 ^ 0
+18394762374689237468.97354862973846 ^ 0
+1 ^ 1
+2 ^ 1
+18927361346 ^ 1
+0.23523785962738592635777 ^ 1
+328956734869213746.89782398457234 ^ 1
+8937 ^ 98
+0.124876812394 ^ 2396
+93762.2836 ^ 13
+1 ^ -1
+2 ^ -1
+10 ^ -1
+683734768 ^ -1
+38579623756.897937568235 ^ -1
+1 ^ -32467
+2 ^ -53
+23897 ^ -213
+-1 ^ 1
+-1 ^ 2
+-2 ^ 1
+-2 ^ 2
+-237 ^ 294
+-3746 ^ 28
+-0.3548 ^ 35
+-4267.234 ^ 37
+-326.3246 ^ 78
+-1 ^ -1
+-1 ^ -2
+-2 ^ -1
+-2 ^ -2
+-237 ^ -293
+-784 ^ -23
+-86 ^ -7
+-0.23424398 ^ -781
+-178.234786 ^ -879
+-1274.346 ^ -768
+0 ^ -251
+-0.2959371298 ^ 227
diff --git a/tests/fuzzing/bc_inputs2/print2.txt b/tests/fuzzing/bc_inputs2/print2.txt
new file mode 100644
index 000000000000..7f65fbe4c106
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/print2.txt
@@ -0,0 +1,194 @@
+define prnt(i) {
+
+ obase = i - 1
+ a
+ b
+ c
+
+ obase = i
+ a
+ b
+ c
+
+ return i
+}
+
+define prnt2(i) {
+
+ obase = i + 1
+ a
+ b
+ c
+
+ print "\n"
+
+ return i * 10
+}
+
+a = 999999999999999999999999999999999999
+b = a + 1
+c = b + 1
+
+i = 100
+i = prnt(i)
+
+if (i + 1 <= maxobase()) {
+ i = prnt2(i)
+}
+else {
+ print " 084 044 021 047 096 073 015 052 088 014 072 097 047 021 094 051 083\e\n 000\n"
+ print " 084 044 021 047 096 073 015 052 088 014 072 097 047 021 094 051 083\e\n 001\n"
+ print " 084 044 021 047 096 073 015 052 088 014 072 097 047 021 094 051 083\e\n 002\n"
+ print "\n"
+ i *= 10
+}
+
+if (i <= maxobase()) {
+ i = prnt(i)
+}
+else {
+ print " 001 012 066 220 495 792 924 792 495 220 066 012 000\n"
+ print " 001 012 066 220 495 792 924 792 495 220 066 012 001\n"
+ print " 001 012 066 220 495 792 924 792 495 220 066 012 002\n"
+ print " 999 999 999 999 999 999 999 999 999 999 999 999\n"
+ print " 001 000 000 000 000 000 000 000 000 000 000 000 000\n"
+ print " 001 000 000 000 000 000 000 000 000 000 000 000 001\n"
+}
+
+if (i + 1 <= maxobase()) {
+ i = prnt2(i)
+}
+else {
+ print " 0989 0065 0781 0494 0209 0923 0209 0494 0781 0065 0989 0000\n"
+ print " 0989 0065 0781 0494 0209 0923 0209 0494 0781 0065 0989 0001\n"
+ print " 0989 0065 0781 0494 0209 0923 0209 0494 0781 0065 0989 0002\n"
+ print "\n"
+ i *= 10
+}
+
+if (i <= maxobase()) {
+ i = prnt(i)
+}
+else {
+ print " 0001 0009 0036 0084 0126 0126 0084 0036 0009 0000\n"
+ print " 0001 0009 0036 0084 0126 0126 0084 0036 0009 0001\n"
+ print " 0001 0009 0036 0084 0126 0126 0084 0036 0009 0002\n"
+ print " 9999 9999 9999 9999 9999 9999 9999 9999 9999\n"
+ print " 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000\n"
+ print " 0001 0000 0000 0000 0000 0000 0000 0000 0000 0001\n"
+}
+
+if (i + 1 <= maxobase()) {
+ i = prnt2(i)
+}
+else {
+ print " 09992 00035 09917 00125 09875 00083 09965 00008 09999\n"
+ print " 09992 00035 09917 00125 09875 00083 09965 00008 10000\n"
+ print " 09992 00035 09917 00125 09875 00083 09965 00009 00000\n"
+ print "\n"
+ i *= 10
+}
+
+if (i <= maxobase()) {
+ i = prnt(i)
+}
+else {
+ print " 00010 00070 00210 00350 00350 00210 00070 00009\n"
+ print " 00010 00070 00210 00350 00350 00210 00070 00010\n"
+ print " 00010 00070 00210 00350 00350 00210 00070 00011\n"
+ print " 00009 99999 99999 99999 99999 99999 99999 99999\n"
+ print " 00010 00000 00000 00000 00000 00000 00000 00000\n"
+ print " 00010 00000 00000 00000 00000 00000 00000 00001\n"
+}
+
+if (i + 1 <= maxobase()) {
+ i = prnt2(i)
+}
+else {
+ print " 000009 099931 000209 099651 000349 099791 000069 099990\n"
+ print " 000009 099931 000209 099651 000349 099791 000069 099991\n"
+ print " 000009 099931 000209 099651 000349 099791 000069 099992\n"
+ print "\n"
+ i *= 10
+}
+
+if (i <= maxobase()) {
+ i = prnt(i)
+}
+else {
+ print " 000001 000006 000015 000020 000015 000006 000000\n"
+ print " 000001 000006 000015 000020 000015 000006 000001\n"
+ print " 000001 000006 000015 000020 000015 000006 000002\n"
+ print " 999999 999999 999999 999999 999999 999999\n"
+ print " 000001 000000 000000 000000 000000 000000 000000\n"
+ print " 000001 000000 000000 000000 000000 000000 000001\n"
+}
+
+if (i + 1 <= maxobase()) {
+ i = prnt2(i)
+}
+else {
+ print " 0999995 0000014 0999981 0000014 0999995 0000000\n"
+ print " 0999995 0000014 0999981 0000014 0999995 0000001\n"
+ print " 0999995 0000014 0999981 0000014 0999995 0000002\n"
+ print "\n"
+ i *= 10
+}
+
+if (i <= maxobase()) {
+ i = prnt(i)
+}
+else {
+ print " 0000010 0000050 0000100 0000100 0000050 0000009\n"
+ print " 0000010 0000050 0000100 0000100 0000050 0000010\n"
+ print " 0000010 0000050 0000100 0000100 0000050 0000011\n"
+ print " 0000009 9999999 9999999 9999999 9999999 9999999\n"
+ print " 0000010 0000000 0000000 0000000 0000000 0000000\n"
+ print " 0000010 0000000 0000000 0000000 0000000 0000001\n"
+}
+
+if (i + 1 <= maxobase()) {
+ i = prnt2(i)
+}
+else {
+ print " 00000009 09999951 00000099 09999901 00000049 09999990\n"
+ print " 00000009 09999951 00000099 09999901 00000049 09999991\n"
+ print " 00000009 09999951 00000099 09999901 00000049 09999992\n"
+ print "\n"
+ i *= 10
+}
+
+if (i <= maxobase()) {
+ i = prnt(i)
+}
+else {
+ print " 00010000 00040000 00060000 00040000 00009999\n"
+ print " 00010000 00040000 00060000 00040000 00010000\n"
+ print " 00010000 00040000 00060000 00040000 00010001\n"
+ print " 00009999 99999999 99999999 99999999 99999999\n"
+ print " 00010000 00000000 00000000 00000000 00000000\n"
+ print " 00010000 00000000 00000000 00000000 00000001\n"
+}
+
+if (i + 1 <= maxobase()) {
+ i = prnt2(i)
+}
+else {
+ print " 000009999 099960001 000059999 099960001 000009999\n"
+ print " 000009999 099960001 000059999 099960001 000010000\n"
+ print " 000009999 099960001 000059999 099960001 000010001\n"
+ print "\n"
+ i *= 10
+}
+
+if (i <= maxobase()) {
+ i = prnt(i)
+}
+else {
+ print " 000000001 000000004 000000006 000000004 000000000\n"
+ print " 000000001 000000004 000000006 000000004 000000001\n"
+ print " 000000001 000000004 000000006 000000004 000000002\n"
+ print " 999999999 999999999 999999999 999999999\n"
+ print " 000000001 000000000 000000000 000000000 000000000\n"
+ print " 000000001 000000000 000000000 000000000 000000001\n"
+}
diff --git a/tests/fuzzing/bc_inputs2/references.bc b/tests/fuzzing/bc_inputs2/references.bc
new file mode 100755
index 000000000000..8188f17aa017
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/references.bc
@@ -0,0 +1,408 @@
+#! /usr/bin/bc -q
+
+define printarray(a[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a[i]
+ }
+}
+
+define a2(a[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a[i] = a[i] * a[i]
+ }
+
+ printarray(a[], len)
+}
+
+define a4(a__[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a__[i] = a__[i] * a__[i]
+ }
+
+ printarray(a__[], len)
+}
+
+define a6(*a__[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a__[i] = a__[i] * a__[i]
+ }
+
+ printarray(a__[], len)
+}
+
+define a1(*a[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a[i] = i
+ }
+
+ a2(a[], len)
+
+ printarray(a[], len)
+}
+
+define a3(*a__[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a__[i] = i
+ }
+
+ a4(a__[], len)
+
+ printarray(a__[], len)
+}
+
+define a5(*a__[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a__[i] = i
+ }
+
+ a2(a__[], len)
+
+ printarray(a__[], len)
+}
+
+define a7(*a__[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a__[i] = i
+ }
+
+ a6(a__[], len)
+
+ printarray(a__[], len)
+}
+
+len = 16
+
+a1(a[], len)
+printarray(a[], len)
+a3(a[], len)
+printarray(a[], len)
+a5(a[], len)
+printarray(a[], len)
+a7(a[], len)
+printarray(a[], len)
+
+a1(b[], len)
+printarray(b[], len)
+a3(b[], len)
+printarray(b[], len)
+a5(b[], len)
+printarray(b[], len)
+a7(b[], len)
+printarray(b[], len)
+
+a1[0] = 0
+a2[0] = 0
+a3[0] = 0
+a4[0] = 0
+a5[0] = 0
+a6[0] = 0
+a7[0] = 0
+a8[0] = 0
+a9[0] = 0
+a10[0] = 0
+a11[0] = 0
+a12[0] = 0
+a13[0] = 0
+a14[0] = 0
+a15[0] = 0
+a16[0] = 0
+a17[0] = 0
+a18[0] = 0
+a19[0] = 0
+a20[0] = 0
+a21[0] = 0
+a22[0] = 0
+a23[0] = 0
+a24[0] = 0
+a25[0] = 0
+a26[0] = 0
+a27[0] = 0
+a28[0] = 0
+a29[0] = 0
+a30[0] = 0
+a31[0] = 0
+a32[0] = 0
+a33[0] = 0
+a34[0] = 0
+a35[0] = 0
+a36[0] = 0
+a37[0] = 0
+a38[0] = 0
+a39[0] = 0
+a40[0] = 0
+a41[0] = 0
+a42[0] = 0
+a43[0] = 0
+a44[0] = 0
+a45[0] = 0
+a46[0] = 0
+a47[0] = 0
+a48[0] = 0
+a49[0] = 0
+a50[0] = 0
+a51[0] = 0
+a52[0] = 0
+a53[0] = 0
+a54[0] = 0
+a55[0] = 0
+a56[0] = 0
+a57[0] = 0
+a58[0] = 0
+a59[0] = 0
+a60[0] = 0
+a61[0] = 0
+a62[0] = 0
+a63[0] = 0
+a64[0] = 0
+a65[0] = 0
+a66[0] = 0
+a67[0] = 0
+a68[0] = 0
+a69[0] = 0
+a70[0] = 0
+a71[0] = 0
+a72[0] = 0
+a73[0] = 0
+a74[0] = 0
+a75[0] = 0
+a76[0] = 0
+a77[0] = 0
+a78[0] = 0
+a79[0] = 0
+a80[0] = 0
+a81[0] = 0
+a82[0] = 0
+a83[0] = 0
+a84[0] = 0
+a85[0] = 0
+a86[0] = 0
+a87[0] = 0
+a88[0] = 0
+a89[0] = 0
+a90[0] = 0
+a91[0] = 0
+a92[0] = 0
+a93[0] = 0
+a94[0] = 0
+a95[0] = 0
+a96[0] = 0
+a97[0] = 0
+a98[0] = 0
+a99[0] = 0
+a100[0] = 0
+a101[0] = 0
+a102[0] = 0
+a103[0] = 0
+a104[0] = 0
+a105[0] = 0
+a106[0] = 0
+a107[0] = 0
+a108[0] = 0
+a109[0] = 0
+a110[0] = 0
+a111[0] = 0
+a112[0] = 0
+a113[0] = 0
+a114[0] = 0
+a115[0] = 0
+a116[0] = 0
+a117[0] = 0
+a118[0] = 0
+a119[0] = 0
+a120[0] = 0
+a121[0] = 0
+a122[0] = 0
+a123[0] = 0
+a124[0] = 0
+a125[0] = 0
+a126[0] = 0
+a127[0] = 0
+a128[0] = 0
+a129[0] = 0
+a130[0] = 0
+a131[0] = 0
+a132[0] = 0
+a133[0] = 0
+a134[0] = 0
+a135[0] = 0
+a136[0] = 0
+a137[0] = 0
+a138[0] = 0
+a139[0] = 0
+a140[0] = 0
+a141[0] = 0
+a142[0] = 0
+a143[0] = 0
+a144[0] = 0
+a145[0] = 0
+a146[0] = 0
+a147[0] = 0
+a148[0] = 0
+a149[0] = 0
+a150[0] = 0
+a151[0] = 0
+a152[0] = 0
+a153[0] = 0
+a154[0] = 0
+a155[0] = 0
+a156[0] = 0
+a157[0] = 0
+a158[0] = 0
+a159[0] = 0
+a160[0] = 0
+a161[0] = 0
+a162[0] = 0
+a163[0] = 0
+a164[0] = 0
+a165[0] = 0
+a166[0] = 0
+a167[0] = 0
+a168[0] = 0
+a169[0] = 0
+a170[0] = 0
+a171[0] = 0
+a172[0] = 0
+a173[0] = 0
+a174[0] = 0
+a175[0] = 0
+a176[0] = 0
+a177[0] = 0
+a178[0] = 0
+a179[0] = 0
+a180[0] = 0
+a181[0] = 0
+a182[0] = 0
+a183[0] = 0
+a184[0] = 0
+a185[0] = 0
+a186[0] = 0
+a187[0] = 0
+a188[0] = 0
+a189[0] = 0
+a190[0] = 0
+a191[0] = 0
+a192[0] = 0
+a193[0] = 0
+a194[0] = 0
+a195[0] = 0
+a196[0] = 0
+a197[0] = 0
+a198[0] = 0
+a199[0] = 0
+a200[0] = 0
+a201[0] = 0
+a202[0] = 0
+a203[0] = 0
+a204[0] = 0
+a205[0] = 0
+a206[0] = 0
+a207[0] = 0
+a208[0] = 0
+a209[0] = 0
+a210[0] = 0
+a211[0] = 0
+a212[0] = 0
+a213[0] = 0
+a214[0] = 0
+a215[0] = 0
+a216[0] = 0
+a217[0] = 0
+a218[0] = 0
+a219[0] = 0
+a220[0] = 0
+a221[0] = 0
+a222[0] = 0
+a223[0] = 0
+a224[0] = 0
+a225[0] = 0
+a226[0] = 0
+a227[0] = 0
+a228[0] = 0
+a229[0] = 0
+a230[0] = 0
+a231[0] = 0
+a232[0] = 0
+a233[0] = 0
+a234[0] = 0
+a235[0] = 0
+a236[0] = 0
+a237[0] = 0
+a238[0] = 0
+a239[0] = 0
+a240[0] = 0
+a241[0] = 0
+a242[0] = 0
+a243[0] = 0
+a244[0] = 0
+a245[0] = 0
+a246[0] = 0
+a247[0] = 0
+a248[0] = 0
+a249[0] = 0
+a250[0] = 0
+a251[0] = 0
+a252[0] = 0
+a253[0] = 0
+a254[0] = 0
+a255[0] = 0
+a256[0] = 0
+
+a1(a253[], len)
+printarray(a253[], len)
+a3(a253[], len)
+printarray(a253[], len)
+a5(a253[], len)
+printarray(a253[], len)
+a7(a253[], len)
+printarray(a253[], len)
+
+a1(a254[], len)
+printarray(a254[], len)
+a3(a254[], len)
+printarray(a254[], len)
+a5(a254[], len)
+printarray(a254[], len)
+a7(a254[], len)
+printarray(a254[], len)
+
+a1(a255[], len)
+printarray(a255[], len)
+a3(a255[], len)
+printarray(a255[], len)
+a5(a255[], len)
+printarray(a255[], len)
+a7(a255[], len)
+printarray(a255[], len)
+
+a1(a256[], len)
+printarray(a256[], len)
+a3(a256[], len)
+printarray(a256[], len)
+a5(a256[], len)
+printarray(a256[], len)
+a7(a256[], len)
+printarray(a256[], len)
diff --git a/tests/fuzzing/bc_inputs2/scale.txt b/tests/fuzzing/bc_inputs2/scale.txt
new file mode 100644
index 000000000000..e8bee791bce7
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/scale.txt
@@ -0,0 +1,57 @@
+scale(0)
+scale(1)
+scale(12)
+scale(123)
+scale(1234)
+scale(12345)
+scale(123456)
+scale(1234567)
+scale(12345678)
+scale(123456789)
+scale(1234567890)
+scale(1.0)
+scale(12.0)
+scale(123.0)
+scale(1234.0)
+scale(12345.0)
+scale(123456.0)
+scale(1234567.0)
+scale(12345678.0)
+scale(123456789.0)
+scale(1234567890.0)
+scale(.1)
+scale(.12)
+scale(.123)
+scale(.1234)
+scale(.12345)
+scale(.123456)
+scale(.1234567)
+scale(.12345678)
+scale(.123456789)
+scale(.1234567890)
+scale(.01)
+scale(.012)
+scale(.0123)
+scale(.01234)
+scale(.012345)
+scale(.0123456)
+scale(.01234567)
+scale(.012345678)
+scale(.0123456789)
+scale(.01234567890)
+scale(.0000000001)
+scale(.00000000012)
+scale(.000000000123)
+scale(.0000000001234)
+scale(.00000000012345)
+scale(.000000000123456)
+scale(.0000000001234567)
+scale(.00000000012345678)
+scale(.000000000123456789)
+scale(.0000000001234567890)
+scale(289.29837)
+scale(2893.00000)
+scale(289.0)
+scale(1802973.0000000238)
+scale(.000000000000000093182394080000000000)
+scale(0.00000000000000000000)
diff --git a/tests/fuzzing/bc_inputs2/scientific.txt b/tests/fuzzing/bc_inputs2/scientific.txt
new file mode 100644
index 000000000000..bd04562a8df3
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/scientific.txt
@@ -0,0 +1,51 @@
+0e0
+0e1
+0e5
+0e-2
+0e-100
+1e0
+-1e1
+1e9
+-1e21
+1e-1
+-1e-2
+1e-5
+4.92837e5
+-3.28971028e20
+6.2e3
+-8.289371e2
+5.9817280937e8
+-3.28977e-1
+8.8927891e-20
+-7.98239e-4
+4.4892e-4
+-18937e0
+198273e10
+-18927e-4
+28937e-5
+-891072e-7
+.28972e0
+-.891273e-1
+.8928397e1
+-.0002983172e5
+.00022e3
+-.00022e4
+.0000328937e8
+obase=0
+0
+1
+10
+-289
+2894
+-89434
+894370
+-1239839
+28931708
+-8052098.8029731809
+.1
+-.01
+.001
+-.00038
+.0000483
+-.0002894378190
+.2893712083
diff --git a/tests/fuzzing/bc_inputs2/shift.txt b/tests/fuzzing/bc_inputs2/shift.txt
new file mode 100644
index 000000000000..0b4d07b5bfd0
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/shift.txt
@@ -0,0 +1,281 @@
+0 << 0
+1 << 0
+2 << 0
+0.0023896 << 0
+1.298346 << 0
+2.00000000 << 0
+0.0023896 << 3
+1.298346 << 4
+2.00000000 << 5
+x = 89136.892348976
+x <<= 7
+x
+x = 1892634051829351283289298
+x <<= 24
+x
+0 >> 0
+1 >> 0
+2 >> 0
+0.0023896 >> 0
+1.298346 >> 0
+2.00000000 >> 0
+0.0023896 >> 3
+1.298346 >> 4
+2.00000000 >> 5
+x = 89136.892348976
+x >>= 7
+x
+x = 1892634051829351283289298
+x >>= 24
+x
+-1 << 0
+-2 << 0
+-0.0023896 << 0
+-1.298346 << 0
+-2.00000000 << 0
+-0.0023896 << 3
+-1.298346 << 4
+-2.00000000 << 5
+x = -89136.892348976
+x <<= 7
+x
+x = -1892634051829351283289298
+x <<= 24
+x
+-1 >> 0
+-2 >> 0
+-0.0023896 >> 0
+-1.298346 >> 0
+-2.00000000 >> 0
+-0.0023896 >> 3
+-1.298346 >> 4
+-2.00000000 >> 5
+x = -89136.892348976
+x >>= 7
+x
+-x
+x = -1892634051829351283289298
+x >>= 24
+x
+-x
+(0 >> 12) / 2
+10000000000 >> 0
+10000000000 >> 1
+10000000000 >> 2
+10000000000 >> 3
+10000000000 >> 4
+10000000000 >> 5
+10000000000 >> 6
+10000000000 >> 7
+10000000000 >> 8
+10000000000 >> 9
+10000000000 >> 10
+10000000000 >> 11
+10000000000 >> 12
+10000000000 >> 13
+10000000000 >> 14
+10000000000 >> 15
+10000000000 >> 16
+10000000000 >> 17
+10000000000 >> 18
+10000000000 >> 19
+10000000000.1 >> 0
+10000000000.1 >> 1
+10000000000.1 >> 2
+10000000000.1 >> 3
+10000000000.1 >> 4
+10000000000.1 >> 5
+10000000000.1 >> 6
+10000000000.1 >> 7
+10000000000.1 >> 8
+10000000000.1 >> 9
+10000000000.1 >> 10
+10000000000.1 >> 11
+10000000000.1 >> 12
+10000000000.1 >> 13
+10000000000.1 >> 14
+10000000000.1 >> 15
+10000000000.1 >> 16
+10000000000.1 >> 17
+10000000000.1 >> 18
+10000000000.1 >> 19
+10000000000.01 >> 0
+10000000000.01 >> 1
+10000000000.01 >> 2
+10000000000.01 >> 3
+10000000000.01 >> 4
+10000000000.01 >> 5
+10000000000.01 >> 6
+10000000000.01 >> 7
+10000000000.01 >> 8
+10000000000.01 >> 9
+10000000000.01 >> 10
+10000000000.01 >> 11
+10000000000.01 >> 12
+10000000000.01 >> 13
+10000000000.01 >> 14
+10000000000.01 >> 15
+10000000000.01 >> 16
+10000000000.01 >> 17
+10000000000.01 >> 18
+10000000000.01 >> 19
+10000000000.001 >> 0
+10000000000.001 >> 1
+10000000000.001 >> 2
+10000000000.001 >> 3
+10000000000.001 >> 4
+10000000000.001 >> 5
+10000000000.001 >> 6
+10000000000.001 >> 7
+10000000000.001 >> 8
+10000000000.001 >> 9
+10000000000.001 >> 10
+10000000000.001 >> 11
+10000000000.001 >> 12
+10000000000.001 >> 13
+10000000000.001 >> 14
+10000000000.001 >> 15
+10000000000.001 >> 16
+10000000000.001 >> 17
+10000000000.001 >> 18
+10000000000.001 >> 19
+10000000000.0001 >> 0
+10000000000.0001 >> 1
+10000000000.0001 >> 2
+10000000000.0001 >> 3
+10000000000.0001 >> 4
+10000000000.0001 >> 5
+10000000000.0001 >> 6
+10000000000.0001 >> 7
+10000000000.0001 >> 8
+10000000000.0001 >> 9
+10000000000.0001 >> 10
+10000000000.0001 >> 11
+10000000000.0001 >> 12
+10000000000.0001 >> 13
+10000000000.0001 >> 14
+10000000000.0001 >> 15
+10000000000.0001 >> 16
+10000000000.0001 >> 17
+10000000000.0001 >> 18
+10000000000.0001 >> 19
+10000000000.00001 >> 0
+10000000000.00001 >> 1
+10000000000.00001 >> 2
+10000000000.00001 >> 3
+10000000000.00001 >> 4
+10000000000.00001 >> 5
+10000000000.00001 >> 6
+10000000000.00001 >> 7
+10000000000.00001 >> 8
+10000000000.00001 >> 9
+10000000000.00001 >> 10
+10000000000.00001 >> 11
+10000000000.00001 >> 12
+10000000000.00001 >> 13
+10000000000.00001 >> 14
+10000000000.00001 >> 15
+10000000000.00001 >> 16
+10000000000.00001 >> 17
+10000000000.00001 >> 18
+10000000000.00001 >> 19
+10000000000.000001 >> 0
+10000000000.000001 >> 1
+10000000000.000001 >> 2
+10000000000.000001 >> 3
+10000000000.000001 >> 4
+10000000000.000001 >> 5
+10000000000.000001 >> 6
+10000000000.000001 >> 7
+10000000000.000001 >> 8
+10000000000.000001 >> 9
+10000000000.000001 >> 10
+10000000000.000001 >> 11
+10000000000.000001 >> 12
+10000000000.000001 >> 13
+10000000000.000001 >> 14
+10000000000.000001 >> 15
+10000000000.000001 >> 16
+10000000000.000001 >> 17
+10000000000.000001 >> 18
+10000000000.000001 >> 19
+10000000000.0000001 >> 0
+10000000000.0000001 >> 1
+10000000000.0000001 >> 2
+10000000000.0000001 >> 3
+10000000000.0000001 >> 4
+10000000000.0000001 >> 5
+10000000000.0000001 >> 6
+10000000000.0000001 >> 7
+10000000000.0000001 >> 8
+10000000000.0000001 >> 9
+10000000000.0000001 >> 10
+10000000000.0000001 >> 11
+10000000000.0000001 >> 12
+10000000000.0000001 >> 13
+10000000000.0000001 >> 14
+10000000000.0000001 >> 15
+10000000000.0000001 >> 16
+10000000000.0000001 >> 17
+10000000000.0000001 >> 18
+10000000000.0000001 >> 19
+10000000000.00000001 >> 0
+10000000000.00000001 >> 1
+10000000000.00000001 >> 2
+10000000000.00000001 >> 3
+10000000000.00000001 >> 4
+10000000000.00000001 >> 5
+10000000000.00000001 >> 6
+10000000000.00000001 >> 7
+10000000000.00000001 >> 8
+10000000000.00000001 >> 9
+10000000000.00000001 >> 10
+10000000000.00000001 >> 11
+10000000000.00000001 >> 12
+10000000000.00000001 >> 13
+10000000000.00000001 >> 14
+10000000000.00000001 >> 15
+10000000000.00000001 >> 16
+10000000000.00000001 >> 17
+10000000000.00000001 >> 18
+10000000000.00000001 >> 19
+10000000000.000000001 >> 0
+10000000000.000000001 >> 1
+10000000000.000000001 >> 2
+10000000000.000000001 >> 3
+10000000000.000000001 >> 4
+10000000000.000000001 >> 5
+10000000000.000000001 >> 6
+10000000000.000000001 >> 7
+10000000000.000000001 >> 8
+10000000000.000000001 >> 9
+10000000000.000000001 >> 10
+10000000000.000000001 >> 11
+10000000000.000000001 >> 12
+10000000000.000000001 >> 13
+10000000000.000000001 >> 14
+10000000000.000000001 >> 15
+10000000000.000000001 >> 16
+10000000000.000000001 >> 17
+10000000000.000000001 >> 18
+10000000000.000000001 >> 19
+10000000000.0000000001 >> 0
+10000000000.0000000001 >> 1
+10000000000.0000000001 >> 2
+10000000000.0000000001 >> 3
+10000000000.0000000001 >> 4
+10000000000.0000000001 >> 5
+10000000000.0000000001 >> 6
+10000000000.0000000001 >> 7
+10000000000.0000000001 >> 8
+10000000000.0000000001 >> 9
+10000000000.0000000001 >> 10
+10000000000.0000000001 >> 11
+10000000000.0000000001 >> 12
+10000000000.0000000001 >> 13
+10000000000.0000000001 >> 14
+10000000000.0000000001 >> 15
+10000000000.0000000001 >> 16
+10000000000.0000000001 >> 17
+10000000000.0000000001 >> 18
+10000000000.0000000001 >> 19
diff --git a/tests/fuzzing/bc_inputs2/sine.txt b/tests/fuzzing/bc_inputs2/sine.txt
new file mode 100644
index 000000000000..d3a547bcd796
--- /dev/null
+++ b/tests/fuzzing/bc_inputs2/sine.txt
@@ -0,0 +1,207 @@
+scale = 25
+p = 4 * a(1)
+scale = 20
+s(0)
+s(0.5)
+s(1)
+s(2)
+s(3)
+s(-0.5)
+s(-1)
+s(-2)
+s(-3)
+s(p / 7)
+s(-p / 7)
+s(p / 4)
+s(-p / 4)
+s(p / 3)
+s(-p / 3)
+s(p / 2)
+s(-p / 2)
+s(3 * p / 4)
+s(3 * -p / 4)
+s(p)
+s(-p)
+s(3 * p / 2)
+s(3 * -p / 2)
+s(7 * p / 4)
+s(7 * -p / 4)
+s(13 * p / 4)
+s(13 * -p / 4)
+s(2 * p)
+s(2 * -p)
+s(131231)
+s(-131231)
+s(69.1967507777)
+s(10828)
+s(-16248506.847013148)
+s(2050281000)
+s(8224939)
+s(11334231.1154662464)
+s(-4109411249.2986954846)
+s(-2395915402.13984)
+s(-2795874313)
+s(-2262647256)
+s(3323158182.1239222084)
+s(99901384)
+s(-4202726050.2780080957)
+s(2870000621.3228830588)
+s(-4230239450.981045150)
+s(-1517506941.2678857223)
+s(4004582176)
+s(-4193724543.1108508063)
+s(-3432511261)
+s(1804484812)
+s(3229084127)
+s(-3565317246.583937244)
+s(3503281621)
+s(-3469146313.1766891244)
+s(-2257308049.307721068)
+s(-3978441809)
+s(3431564304.3752537)
+s(1249644440.2464914559)
+s(2395558891.1188487974)
+s(-2607820706.4079280116)
+s(1208310007)
+s(-3758597557.863203175)
+s(1186920672)
+s(-3988103872)
+s(-4280635328.4194857577)
+s(1051748072)
+s(-1884006279)
+s(-1046568719.2698663389)
+s(2482991410)
+s(-2106101268.1154045959)
+s(3530359346.77217900)
+s(-3373362543)
+s(2601598062)
+s(2987020862)
+s(-12033356.2057140648)
+s(-3721760707)
+s(2842387705.4145759704)
+s(3515832681.1808393297)
+s(-3658522034.16149)
+s(3963658030.2860423992)
+s(2977802215.597946655)
+s(-4271392570.4091498761)
+s(2378692585)
+s(-3545193743.629374782)
+s(-1762458738)
+s(-1174277828.4264040126)
+s(-1724994857)
+s(2802750230.1783499408)
+s(-3068133550)
+s(3324811474.621822235)
+s(2873024984)
+s(-3509056632.3888206298)
+s(1772903162.647192879)
+s(2836543102)
+s(4117858580.186)
+s(2988632386.4063754522)
+s(-4256784971.1770067447)
+s(2280820447)
+s(-2865200306)
+s(-3329592486)
+s(519126268)
+s(-2452430452)
+s(-2693220186.62104082)
+s(-3796811992.14485798)
+s(3619792326)
+s(2697791049.3038381550)
+s(3751267834.2808166557)
+s(-3761719074)
+s(-3824087631)
+s(2119301150)
+s(1398148974)
+s(-3386564819.1351816969)
+s(-3171483098)
+s(3688944941.3273318162)
+s(3060521119)
+s(-3527110404)
+s(3699631193)
+s(3872838898)
+s(3880350192)
+s(-4109411249.2986954846)
+s(-2395915402.13984)
+s(-2795874313)
+s(-2262647256)
+s(3323158182.1239222084)
+s(99901384)
+s(-4202726050.2780080957)
+s(2870000621.3228830588)
+s(-4230239450.981045150)
+s(-1517506941.2678857223)
+s(4004582176)
+s(-4193724543.1108508063)
+s(-3432511261)
+s(1804484812)
+s(3229084127)
+s(-3565317246.583937244)
+s(3503281621)
+s(-3469146313.1766891244)
+s(-2257308049.307721068)
+s(-3978441809)
+s(3431564304.3752537)
+s(1249644440.2464914559)
+s(2395558891.1188487974)
+s(-2607820706.4079280116)
+s(1208310007)
+s(-3758597557.863203175)
+s(1186920672)
+s(-3988103872)
+s(-4280635328.4194857577)
+s(1051748072)
+s(-1884006279)
+s(-1046568719.2698663389)
+s(2482991410)
+s(-2106101268.1154045959)
+s(3530359346.77217900)
+s(-3373362543)
+s(2601598062)
+s(2576349783.2446436039)
+s(2987020862)
+s(-12033356.2057140648)
+s(-3721760707)
+s(2842387705.4145759704)
+s(3515832681.1808393297)
+s(-3658522034.16149)
+s(3963658030.2860423992)
+s(2977802215.597946655)
+s(-4271392570.4091498761)
+s(2378692585)
+s(-3545193743.629374782)
+s(-1762458738)
+s(-1174277828.4264040126)
+s(-1724994857)
+s(2802750230.1783499408)
+s(-3068133550)
+s(3324811474.621822235)
+s(2873024984)
+s(-3509056632.3888206298)
+s(1772903162.647192879)
+s(2836543102)
+s(4117858580.186)
+s(2988632386.4063754522)
+s(-4256784971.1770067447)
+s(2280820447)
+s(-2865200306)
+s(-3329592486)
+s(519126268)
+s(-2452430452)
+s(-2693220186.62104082)
+s(-3796811992.14485798)
+s(3619792326)
+s(2697791049.3038381550)
+s(3751267834.2808166557)
+s(-3761719074)
+s(-3824087631)
+s(2119301150)
+s(1398148974)
+s(-3386564819.1351816969)
+s(-3171483098)
+s(3688944941.3273318162)
+s(3060521119)
+s(-3527110404)
+s(3699631193)
+s(3872838898)
+s(3880350192)
diff --git a/tests/fuzzing/bc_inputs3/01.txt b/tests/fuzzing/bc_inputs3/01.txt
new file mode 100644
index 000000000000..c016263a9381
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/01.txt
@@ -0,0 +1,339 @@
+a(s001020001l[ba])
+scal[ ca]
+a
+a
+e
+cs
+c
+
+a
+s(scal[ ba])
+scal[ ca]
+u
+a
+e
+cs
+c
+
+a
+s(scal[ ba])
+scal[ ca]
+u
+a
+s
+c = l[ ca]
+a
+a
+sa
+e
+cs
+c
+
+a(s001020001l[ ba])
+scal[ ca]
+a
+a
+e
+cs
+c
+
+a
+s(scal[ ba])
+scal[ ca]
+a
+a
+s
+c = l[ ca]
+a
+s
+c = l[ ca]
+a(s001020001l[ ba])
+a
+e
+cs
+c
+
+a
+s(scal[ ba])
+scal[ ca]
+u
+a
+s
+c = l[ ca]
+a
+a
+sa
+e
+cs
+c
+
+a(s001020001l[ ba])
+scal[ ca]
+a
+a*e
+cs
+c
+
+a
+s(scal[ ba])
+scal[ ca]
+a
+a
+s
+c = l[ ca]
+a
+a
+sa
+e
+css
+c = c[ ca]
+a
+a
+sa
+e
+cs
+a
+a
+sa
+e
+cs
+c
+
+a(s001020001l[ ba])
+ cs
+c = l[ ca]
+a
+a
+sa
+e
+cs
+c
+
+a(s001020001l[ ba])
+scal[ ca]
+a
+a
+e
+cs
+c
+
+a
+s(scal[ ba])
+scal[ ca]
+a
+a
+s
+c = l[ ca]
+a
+a
+sa
+e
+css
+c = l[ ca]
+a
+a
+sa
+e
+cs
+a
+b
+sa
+e
+cs
+c
+
+a(s001020001l[ ba])
+scal[ ca]
+a
+a
+e
+cs
+
+scal[ ca]
+a
+a
+e
+cs
+c
+
+a
+s(scal[ ba])
+scal[ ca]
+u
+a
+s
+c = l[ ca]
+a
+a
+sa
+e
+cs
+c
+
+a(s001020001l[ ba])
+scal[ ca]
+a
+a
+e
+cs
+c
+
+a
+s(scal[ ba])
+scal[ ca]
+a
+a
+s
+c = l[ ca]
+a
+a
+sa
+e
+css
+c = l[ ca]
+a
+a
+sa
+e
+cs
+a
+a
+sa
+e
+cs
+c
+
+a(s001020001l[ ba])
+sc0
+c = l[ ca]
+a
+a
+sa
+e
+cs
+c
+
+a(s001020001l[ ba])
+scal[ ca]
+a
+a
+e
+cs
+c
+
+a
+s(scal[ ba])
+s(1)
+sd= 20
+a(0)
+a=i-=se-=as0-=se-=as0-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+s0000^aaaaaaaaaaaaaaa20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=a00-=se-=as-=se-=axse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=as=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscales=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==se-=a(1)
+sd= 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scale ==se-=a(1)
+scale = 20
+a(0)
+a==se-=as+=ase-=se8=as-=se-=a(1)
+s ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=a0=as-=ase-=se-=se0=ase-=se-=as-=e-=as=ae-=a(1)
+sc= 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==se-=a(1)
+sd= 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=s-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=a0=as-=ase-=se-=se0=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=a0=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scale ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=as*=e-=as=aaaaaaaaaaaaaaaaaaaaaaa^aaaaaaaaaaaaaaa20
+a(0)
+a=i-=se-=ase-=se-=as0-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=as0-=se-=as-=se-=axse!=e-=ase-=i-=se-=as0-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=a0-=a0=i-=se-=as0-=se-=se-=ase-=se-=as-=e-=as=as0-=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==ss0-=ase-=s-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=as-=ase-=se-=se0=ase-=se-=as-=e-=as=a000=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=as0-=se-=as0-=i-=s-=se-=xse!=e-=a0=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scale ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=a0-=e-=as=aaaaaaaaaaaaaaaaaaaaaaa^aaaaaaaaaaaaaaa20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=ase-=se-=as-=se-=axse!=e-=ase-=i-=se-=as0-=se-=se-=ase-=se-=as-=e-=as=as0-=se-=as-=as=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=as0-=se-=ase-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scale ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=as0-=as-=as0-=se-=as-=as0
+a(0)
+a=i-=se-=as0-=se-=as0-=i-=s-=se-=xse!=e-=as=as0-=se-=as-=ase-=se-=as-=se-=a(1)
+scale ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=as0-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=as0-=se-=se-=as0-=a0a^aaaaaaaaaaaaaaa20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=ase-=se-=as-=se-=axse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=a0-=e-=as=ase-=se-=as-=as=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscales=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==se-=a(1)
+sd= 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+de ==se-=a(1)
+scale = 20
+a(0)
+a==se-=as-=ase-=se0=as-=se-=a(1)
+s ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=as-=ase-=se-=se0=ase-=se-=as-=e-=as=ae-=a(1)
+sc= 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==se-=a(1)
+sd= 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase = 20
+a(0)
+a0i-=se-=ase-=se-=ase-=s-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
+scscale ==se-=a(1)
+scale = 20
+a(0)
+a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=c-=a0=as-se-=se-=se0=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1)
diff --git a/tests/fuzzing/bc_inputs3/02.txt b/tests/fuzzing/bc_inputs3/02.txt
new file mode 100644
index 000000000000..8cf0f3e6fec1
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/02.txt
@@ -0,0 +1 @@
+obase^= 20-f-b-4^-f-4-4^-f-4^-d
diff --git a/tests/fuzzing/bc_inputs3/03.txt b/tests/fuzzing/bc_inputs3/03.txt
new file mode 100644
index 000000000000..d0fc50564b6d
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/03.txt
@@ -0,0 +1,2 @@
+for (i = 0; ; )
+for (i = 0; ;(ssqrt()-p(srt(0-s(t(0-p(sstss(ssqrt()-p(ssssq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s()-p(sq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s(ssqrt()-p(t()-p(sstp(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-v(qrt(ssqrt()-p(ssqrt()-s(ssqrt()-p(ssssq(ssqrt()-p(ssq(ssqrt()-p(t()-sst(prt()-s(ssqrt()-p(q(ssqrt()-p(ssqrt()-sst()-ssqrt()-t(ss(s()-p(srt()-s(ssqrt()-p(s(ssqrtt()-p(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(qr (itt()-p(q(s(ssqrt()-t(ss(ssqrt()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(sstsq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(sstsq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s(ssqrt()-p(t()-p(sstp(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(qr (itt()-p(q(s(ssqrt()-t(ss(ssqrt()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(sstsq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-p(sstss(osqrt()-p(sstsq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s(ssqrt()-p(ssqrt()-sstfor (itt()-p(q(s(ssqrt()-t(ss(ssqrt()-p(srt()-s(ssqrt()-p(sstss(sssq(ssqrt()-p(ssqrt()-sst()-prt()-s(ssqrt()-p(q(ssqrt()-ssqrt(qrt()-p(s()-p(srt(s(ssqrt()-p(q(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s(ssqrt()-p(ssqrt()-sst()-p(ssqrt()-ssq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s-t()-s(ssurt()-p(sstss(ssqrt()-p(qr (itt()-p(q(s(ssqrt()-t(ss(ssqrt()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(sstsq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-p(sstss(osqrt()-p(sstsq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s(ssqrt()-p(ssqrt()-sstfor (itt()-p(q(s(ssqrt()-t(ss(ssqrt()-p(srt()-s(ssqrt()-p(sstss(sssq(ssqrt()-p(ssqrt()-sst()-prt()-s(ssqrt()-p(q(ssqrt()-ssqrt(qrt()-p(s()-p(srt(s(ssqrt()-p(q(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s(ssqrt()-p(ssqrt()-sst()-p(ssqrt()-ssq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s-p(ssqrt()-sst()-p(qrt()-p(s(st()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(ssssq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(ssssq(ssqrt()-p(ssqrt()-sst()-p(qrtrrrrr()-p(s(ssqrt()-p(ssqrt()-sst()-p(ssqrt(qrt(ssqrt()-p(ssqrt()-s(ssqrt()-p(ssssq(ssqrt()-p(ssq(ssqrt()-p(ssqrt()-sst()-prt()-s(ssqrt()-p(q(ssqrt()-p(ssqrt()-sst()-ssqrt()-t(ss(s()-p(srt()-s(ssqrt()-p(s(ssqrtt()-p()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000#000
diff --git a/tests/fuzzing/bc_inputs3/04.txt b/tests/fuzzing/bc_inputs3/04.txt
new file mode 100644
index 000000000000..c0965de53faf
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/04.txt
@@ -0,0 +1 @@
+"000000
diff --git a/tests/fuzzing/bc_inputs3/05.txt b/tests/fuzzing/bc_inputs3/05.txt
new file mode 100644
index 000000000000..99148974ea07
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/05.txt
@@ -0,0 +1 @@
+/*00000000
diff --git a/tests/fuzzing/bc_inputs3/06.txt b/tests/fuzzing/bc_inputs3/06.txt
new file mode 100644
index 000000000000..29fe6be37021
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/06.txt
@@ -0,0 +1 @@
+while (i == 0) {
diff --git a/tests/fuzzing/bc_inputs3/07.txt b/tests/fuzzing/bc_inputs3/07.txt
new file mode 100644
index 000000000000..e899d8547868
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/07.txt
@@ -0,0 +1,8 @@
+for(q=F;i<=020; ++i) #00
+{print "0"
+if(6)if(6){3
+ }
+{pr0n}
+"" }
+{pr0n}
+{print "" ""
diff --git a/tests/fuzzing/bc_inputs3/08.txt b/tests/fuzzing/bc_inputs3/08.txt
new file mode 100644
index 000000000000..8c5afd789bfa
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/08.txt
@@ -0,0 +1,3 @@
+define i(x){
+c0
+if(6)}
diff --git a/tests/fuzzing/bc_inputs3/09.txt b/tests/fuzzing/bc_inputs3/09.txt
new file mode 100644
index 000000000000..f7a347557d83
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/09.txt
@@ -0,0 +1,11 @@
+e
+-1\
+#00000
+{print"0"
+if(1)if(1)#0
+}
+if(0)if(0){3
+}
+else 4\
+#00000000000000000000000000
+}
diff --git a/tests/fuzzing/bc_inputs3/10.txt b/tests/fuzzing/bc_inputs3/10.txt
new file mode 100644
index 000000000000..23fb8689f598
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/10.txt
@@ -0,0 +1 @@
+d000$++
diff --git a/tests/fuzzing/bc_inputs3/11.txt b/tests/fuzzing/bc_inputs3/11.txt
new file mode 100644
index 000000000000..19e7e87b2d65
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/11.txt
@@ -0,0 +1,99 @@
+#0000000000000000
+
+define printarray(a[],len){
+
+auto i
+
+for(i=0; i < n; ++i) {
+ a[i]
+ }
+}
+
+define a2(a[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a[i] = a[i] * a[i]
+ }
+
+ printarray(len, n)
+}
+
+define a4(a00[], l) {
+
+ auto i
+
+ for (i = 0; i < l; ++i) {
+ a[i] = a00[i] * a[i]
+ }
+
+ printarray(a00[], l)
+}
+
+define a6(*a00[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a00[i] = a00[i] * a00[i]
+ }
+
+ printarray(a00[], len)
+}
+
+define a1(*a[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a[i] = i
+ }
+
+ a2(a[], len)
+
+ printarray(a[], len)
+}
+
+define a0(*a00[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a00[i] = i
+ }
+
+ a0(a00[], len)
+
+ printarray(a00[], len)
+}
+
+define a5(*a00[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a00[i] = i
+ }
+
+ a0(a00[], len)
+
+ printarray(a, len)
+}
+
+define a7(*a00[], len) {
+
+ auto i
+
+ for (i = 0; i < len; ++i) {
+ a00[i] = i
+ }
+
+ a0(a00[], len)
+
+ printarray(a00[], len)
+}
+
+len = 16
+
+a1(a[], len)
diff --git a/tests/fuzzing/bc_inputs3/12.txt b/tests/fuzzing/bc_inputs3/12.txt
new file mode 100644
index 000000000000..143bb71deeda
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/12.txt
@@ -0,0 +1,2 @@
+for (v ;!j -90-90; ++i)
+a= ibase ++;0
diff --git a/tests/fuzzing/bc_inputs3/13.txt b/tests/fuzzing/bc_inputs3/13.txt
new file mode 100644
index 000000000000..5628ba703cde
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/13.txt
@@ -0,0 +1,56 @@
+#0
+
+define z(a[]) {for (i = 0; i < l; ++i) {
+ a[i]
+ }
+}
+
+define x(a[]) {
+
+ #00000000000000000000000000000000000
+ auto a
+
+ for (a = 0; a < l; ++a) {
+ a[a] = -a
+ }
+
+ z(a[])
+}
+
+define g(x[], y[]) {
+ return x[0] - y[0]
+}
+
+define h(u000 x[]) {
+ return g(x[], y[])
+}
+
+define m(*x[], *y[]) {
+ return x[0] / y[0]
+}
+
+define n(*y[], *x[]) {
+ return m(x[], y[])
+}
+
+for (i = 0; i < 101; ++i) {
+ a[i] = i
+}
+
+a[104] = 200
+
+l = length(a[])
+
+for (i = 0; i <= l; ++i) {
+ a[i]
+}
+
+z(a[])
+x(a[])
+z(a[])
+l
+
+x[0] = 5
+y[0] = 4
+
+h(x[], y[])
diff --git a/tests/fuzzing/bc_inputs3/14.txt b/tests/fuzzing/bc_inputs3/14.txt
new file mode 100644
index 000000000000..2487d82acd48
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/14.txt
@@ -0,0 +1 @@
+a(int32(O100000000))
diff --git a/tests/fuzzing/bc_inputs3/15.txt b/tests/fuzzing/bc_inputs3/15.txt
new file mode 100644
index 000000000000..cf1f81dfb005
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/15.txt
@@ -0,0 +1,3 @@
+for (i = 0; int32(29834); ++i) {
+ i
+}
diff --git a/tests/fuzzing/bc_inputs3/16.txt b/tests/fuzzing/bc_inputs3/16.txt
new file mode 100644
index 000000000000..977569bda330
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/16.txt
@@ -0,0 +1 @@
+"0 \ No newline at end of file
diff --git a/tests/fuzzing/bc_inputs3/17.txt b/tests/fuzzing/bc_inputs3/17.txt
new file mode 100644
index 000000000000..f158be7e5f48
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/17.txt
@@ -0,0 +1,11 @@
+print "000000000000000000\n"
+
+s = s0
+
+m = 0
+
+for (i = 0; i < 100; ++i) {
+ a[i] =d()
+ s= a[i]
+ b[i] = irand(u0)
+}
diff --git a/tests/fuzzing/bc_inputs3/18.txt b/tests/fuzzing/bc_inputs3/18.txt
new file mode 100644
index 000000000000..9f338c1f5a65
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/18.txt
@@ -0,0 +1,3 @@
+while(0){
+
+define
diff --git a/tests/fuzzing/bc_inputs3/19.txt b/tests/fuzzing/bc_inputs3/19.txt
new file mode 100644
index 000000000000..1edb8c62d49a
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/19.txt
@@ -0,0 +1,5 @@
+define i(x){
+
+i(10)
+ibase
+o(10)`0000
diff --git a/tests/fuzzing/bc_inputs3/20.txt b/tests/fuzzing/bc_inputs3/20.txt
new file mode 100644
index 000000000000..465146d458fd
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/20.txt
@@ -0,0 +1,51 @@
+define w() { auto z; return 1; }
+define x() {
+"0"
+return (1)
+}
+define y() {
+"0"
+ return (2)
+}
+define z() {
+ "0"
+ return (3)
+}
+define v() { return }
+
+v()
+
+w()
+
+if (x() == y()) { 0 }
+1
+if (x() <= y()) { 2 }
+if (y() >= x()) { 3 }
+if (x() != y()) { 4 }
+if (x() < y()) { 5 }
+if (y() > x()) { 6 }
+
+if (x() == z()) { 100}
+10
+if (x() <= z()) { 10 }
+if (z() >= x()) { 10 }
+if (x() != z()) { 10 }
+if (x() < z()) { 10 }
+if (z() > x()) { 10 }
+
+x = -10
+while (x <= 0) {
+ x
+ if (x == -5) break;
+ x += 1
+}
+
+define u() {
+ auto a[];
+ return a[H]
+}
+
+u()
+
+if (x == -4) x
+000000000000000000000000ÿ
diff --git a/tests/fuzzing/bc_inputs3/21.txt b/tests/fuzzing/bc_inputs3/21.txt
new file mode 100644
index 000000000000..531705b29237
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/21.txt
@@ -0,0 +1,10 @@
+define i(x) {
+ ibase=x
+ s0=x
+ return 74; b=100.000000000000;e
+}
+
+i(11)
+ibase
+o0
+0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
diff --git a/tests/fuzzing/bc_inputs3/22.txt b/tests/fuzzing/bc_inputs3/22.txt
new file mode 100644
index 000000000000..f7a91f0b7774
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/22.txt
@@ -0,0 +1,2 @@
+#00000000000000 0
+ for(i = 0; i < M; ++i) l000000000000= length(a00000000iii= l[]0
diff --git a/tests/fuzzing/bc_inputs3/23.txt b/tests/fuzzing/bc_inputs3/23.txt
new file mode 100644
index 000000000000..15045f277e00
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/23.txt
Binary files differ
diff --git a/tests/fuzzing/bc_inputs3/24.txt b/tests/fuzzing/bc_inputs3/24.txt
new file mode 100644
index 000000000000..25f98c159d4f
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/24.txt
@@ -0,0 +1,4 @@
+perm(10,2)
+comb(10,2)
+perm(6,2)
+b(6,++i[]
diff --git a/tests/fuzzing/bc_inputs3/sqrt.txt b/tests/fuzzing/bc_inputs3/sqrt.txt
new file mode 100644
index 000000000000..07cdee66492c
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/sqrt.txt
@@ -0,0 +1,14 @@
+scale = 20
+sqrt(0)
+sqrt(2)
+sqrt(4)
+sqrt(9)
+sqrt(16)
+sqrt(25)
+sqrt(121)
+sqrt(48765)
+sqrt(9287356207356)
+sqrt(0.189274385967238956872354)
+sqrt(12389467137496823.134567829387456283946)
+sqrt(.0000000000000000000000000000123)
+sqrt(1)
diff --git a/tests/fuzzing/bc_inputs3/strings.txt b/tests/fuzzing/bc_inputs3/strings.txt
new file mode 100644
index 000000000000..1cb7d6a61c54
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/strings.txt
@@ -0,0 +1,12 @@
+"string"
+"another string"
+"yet
+another
+string"
+"noescapes\n"
+"newline
+"
+print "string"
+print "newline\n"
+
+print "\\\e\n"
diff --git a/tests/fuzzing/bc_inputs3/subtract.txt b/tests/fuzzing/bc_inputs3/subtract.txt
new file mode 100644
index 000000000000..e3ea1ced9ec5
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/subtract.txt
@@ -0,0 +1,153 @@
+0 - 0
+0 - 1
+1 - 0
+1 - 1
+5 - 2
+2 - 9
+321974 - 12845976238457
+2874519803456710938465 - 384723854
+10000000000000000000000000000000000000000 - 999999999999999999999999999999999999999
+10000000000000000000000000000000000000000 - 9999999999999999999999999999999999999999
+10000000000000000000000000000000000000000 - 999999999999999999999999999999999999999.99999999999999999999999999999999999
+10000000000000000000000000000000000000000 - 9999999999999999999999999999999999999999.9999999999999999999999999999999999
+10000000000000000000000000000000000000000 - 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+10000000000000000000000000000000000000001 - 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000001
+10000000000000000000000000000000000000000.0000000001 - 0.0000000000000000000000000000000000000000000000000000000000000000000000000001
+-2 - 6
+-23784692345 - 182934721309467230894628735496027345
+-224352354962873059862 - -1245723576829456278354960278345
+-3468273598 - -12354243
+-0.92345768293 - -2354768923
+-712384634.123476823 - -24768293376
+-1879234638 - -0.917234869234
+-0.9172438692134 - -0.971284967124
+-0.1283475123465 - -0.937462346
+-124765829346.2837468293562 - -0.923467829346
+-12476829385769 - -1928476259034.8378629356
+-0.38476284395876345 - -94875394587623.2357869324857
+-4674596708467.34754789403674343567 - -48672394852354698.237548629345
+979519669 - 3018100865
+929002449 - 3280677283
+0 - -525898
+3- - -3
+18297034019823741908237410928374.81920734712098347109281029873 - 182907.12809
+182039471029834 - 282039471029834
+282039471029834 - 182039471029834
+182039471029834.2801722893 - 282039471029834
+282039471029834.2801722893 - 182039471029834
+182039471029834.2801722893 - 282039471029834.2838
+282039471029834.2801722893 - 182039471029834.2838
+182039471029834 - 282039471029834.2801722893
+282039471029834 - 182039471029834.2801722893
+182039471029834.8297282893 - 282039471029834.2801722893
+282039471029834.8297282893 - 182039471029834.2801722893
+471029834 - 282039471029834
+471029834 - 182039471029834
+471029834.2801722893 - 282039471029834
+471029834.2801722893 - 182039471029834
+471029834.2801722893 - 282039471029834.2838
+471029834.2801722893 - 182039471029834.2838
+471029834 - 282039471029834.2801722893
+471029834 - 182039471029834.2801722893
+471029834.8297282893 - 282039471029834.2801722893
+471029834.8297282893 - 182039471029834.2801722893
+182039471029834 - 471029834
+282039471029834 - 471029834
+182039471029834.2801722893 - 471029834
+282039471029834.2801722893 - 471029834
+182039471029834.2801722893 - 471029834.2838
+282039471029834.2801722893 - 471029834.2838
+182039471029834 - 471029834.2801722893
+282039471029834 - 471029834.2801722893
+182039471029834.8297282893 - 471029834.2801722893
+282039471029834.8297282893 - 471029834.2801722893
+-182039471029834 - 282039471029834
+-282039471029834 - 182039471029834
+-182039471029834.2801722893 - 282039471029834
+-282039471029834.2801722893 - 182039471029834
+-182039471029834.2801722893 - 282039471029834.2838
+-282039471029834.2801722893 - 182039471029834.2838
+-182039471029834 - 282039471029834.2801722893
+-282039471029834 - 182039471029834.2801722893
+-182039471029834.8297282893 - 282039471029834.2801722893
+-282039471029834.8297282893 - 182039471029834.2801722893
+-471029834 - 282039471029834
+-471029834 - 182039471029834
+-471029834.2801722893 - 282039471029834
+-471029834.2801722893 - 182039471029834
+-471029834.2801722893 - 282039471029834.2838
+-471029834.2801722893 - 182039471029834.2838
+-471029834 - 282039471029834.2801722893
+-471029834 - 182039471029834.2801722893
+-471029834.8297282893 - 282039471029834.2801722893
+-471029834.8297282893 - 182039471029834.2801722893
+-182039471029834 - 471029834
+-282039471029834 - 471029834
+-182039471029834.2801722893 - 471029834
+-282039471029834.2801722893 - 471029834
+-182039471029834.2801722893 - 471029834.2838
+-282039471029834.2801722893 - 471029834.2838
+-182039471029834 - 471029834.2801722893
+-282039471029834 - 471029834.2801722893
+-182039471029834.8297282893 - 471029834.2801722893
+-282039471029834.8297282893 - 471029834.2801722893
+182039471029834 - -282039471029834
+282039471029834 - -182039471029834
+182039471029834.2801722893 - -282039471029834
+282039471029834.2801722893 - -182039471029834
+182039471029834.2801722893 - -282039471029834.2838
+282039471029834.2801722893 - -182039471029834.2838
+182039471029834 - -282039471029834.2801722893
+282039471029834 - -182039471029834.2801722893
+182039471029834.8297282893 - -282039471029834.2801722893
+282039471029834.8297282893 - -182039471029834.2801722893
+471029834 - -282039471029834
+471029834 - -182039471029834
+471029834.2801722893 - -282039471029834
+471029834.2801722893 - -182039471029834
+471029834.2801722893 - -282039471029834.2838
+471029834.2801722893 - -182039471029834.2838
+471029834 - -282039471029834.2801722893
+471029834 - -182039471029834.2801722893
+471029834.8297282893 - -282039471029834.2801722893
+471029834.8297282893 - -182039471029834.2801722893
+182039471029834 - -471029834
+282039471029834 - -471029834
+182039471029834.2801722893 - -471029834
+282039471029834.2801722893 - -471029834
+182039471029834.2801722893 - -471029834.2838
+282039471029834.2801722893 - -471029834.2838
+182039471029834 - -471029834.2801722893
+282039471029834 - -471029834.2801722893
+182039471029834.8297282893 - -471029834.2801722893
+282039471029834.8297282893 - -471029834.2801722893
+-182039471029834 - -282039471029834
+-282039471029834 - -182039471029834
+-182039471029834.2801722893 - -282039471029834
+-282039471029834.2801722893 - -182039471029834
+-182039471029834.2801722893 - -282039471029834.2838
+-282039471029834.2801722893 - -182039471029834.2838
+-182039471029834 - -282039471029834.2801722893
+-282039471029834 - -182039471029834.2801722893
+-182039471029834.8297282893 - -282039471029834.2801722893
+-282039471029834.8297282893 - -182039471029834.2801722893
+-471029834 - -282039471029834
+-471029834 - -182039471029834
+-471029834.2801722893 - -282039471029834
+-471029834.2801722893 - -182039471029834
+-471029834.2801722893 - -282039471029834.2838
+-471029834.2801722893 - -182039471029834.2838
+-471029834 - -282039471029834.2801722893
+-471029834 - -182039471029834.2801722893
+-471029834.8297282893 - -282039471029834.2801722893
+-471029834.8297282893 - -182039471029834.2801722893
+-182039471029834 - -471029834
+-282039471029834 - -471029834
+-182039471029834.2801722893 - -471029834
+-282039471029834.2801722893 - -471029834
+-182039471029834.2801722893 - -471029834.2838
+-282039471029834.2801722893 - -471029834.2838
+-182039471029834 - -471029834.2801722893
+-282039471029834 - -471029834.2801722893
+-182039471029834.8297282893 - -471029834.2801722893
+-282039471029834.8297282893 - -471029834.2801722893
diff --git a/tests/fuzzing/bc_inputs3/trunc.txt b/tests/fuzzing/bc_inputs3/trunc.txt
new file mode 100644
index 000000000000..364bb224a2e3
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/trunc.txt
@@ -0,0 +1,15 @@
+0$
+1$
+2$
+0.8249167203486$
+1.28937150237$
+2.0$
+28937.92837605126$
+2890.000000000$
+-1$
+-1.128973$
+-9812387.28910273$
+x = 83.298
+x$
+x = -1893.19
+(x)$
diff --git a/tests/fuzzing/bc_inputs3/void.txt b/tests/fuzzing/bc_inputs3/void.txt
new file mode 100644
index 000000000000..b85d70c8590a
--- /dev/null
+++ b/tests/fuzzing/bc_inputs3/void.txt
@@ -0,0 +1,20 @@
+define void stuff(x) {
+ print "x: ", x, "\n"
+}
+
+define void(x) {
+ return x
+}
+
+stuff(0)
+stuff(1)
+stuff(2.2839)
+stuff(-9.9289389)
+
+void(0)
+void(1)
+void(2.9823)
+void(-3.5982)
+
+void = .198389
+void + 10
diff --git a/tests/fuzzing/dc_inputs/01.txt b/tests/fuzzing/dc_inputs/01.txt
new file mode 100644
index 000000000000..9622de95a241
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/01.txt
@@ -0,0 +1,2 @@
+[[000000000
+00000]
diff --git a/tests/fuzzing/dc_inputs/02.txt b/tests/fuzzing/dc_inputs/02.txt
new file mode 100644
index 000000000000..79565935cf23
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/02.txt
@@ -0,0 +1,5 @@
+0 R
+2 1
+1 0+pRpp
+30.x
+[00000000]ip1+pR
diff --git a/tests/fuzzing/dc_inputs/03.txt b/tests/fuzzing/dc_inputs/03.txt
new file mode 100644
index 000000000000..ecede2e05629
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/03.txt
@@ -0,0 +1,2 @@
+0 lip1-si0l0+200sx_9lq+pR 30.x
+[li100L0dp1+s+sX10lM<0]sL0sJlLx
diff --git a/tests/fuzzing/dc_inputs/04.txt b/tests/fuzzing/dc_inputs/04.txt
new file mode 100644
index 000000000000..209f50c16d52
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/04.txt
@@ -0,0 +1,9 @@
+zp100000000.000004p1+pR
+0 1 1+kpR
+1 1+pR
+1 0IpR
+2 9+iR
+037 483+pR
+999 999+pR
+237467456283846vpR
+.0000000ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddsdddddddddddddddddddddddddddddddddddddddddddddddddddddsdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd/ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddfddddddddddddddddddddddddddddddddddddddddddddddddddddddcdddddddddddd9000000000000000000
diff --git a/tests/fuzzing/dc_inputs/05.txt b/tests/fuzzing/dc_inputs/05.txt
new file mode 100644
index 000000000000..bf2ca982ed2b
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/05.txt
@@ -0,0 +1,3 @@
+04000000000000300sx_9000.00000syzpRlxlq+pR
+30.x
+[li1000000sxL0LLLL900000.00000sLLL]sL0s0lLx
diff --git a/tests/fuzzing/dc_inputs/06.txt b/tests/fuzzing/dc_inputs/06.txt
new file mode 100644
index 000000000000..eff417eb55b4
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/06.txt
@@ -0,0 +1 @@
+00Q;pd60 p d9S06+00I;pd60Q2 0^pR
diff --git a/tests/fuzzing/dc_inputs/07.txt b/tests/fuzzing/dc_inputs/07.txt
new file mode 100644
index 000000000000..8a09152faf58
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/07.txt
@@ -0,0 +1,3 @@
+1 0 1|dR
+1 [li0L]SL10sildR
+1 [li0L]sL10|Lx
diff --git a/tests/fuzzing/dc_inputs/08.txt b/tests/fuzzing/dc_inputs/08.txt
new file mode 100644
index 000000000000..156de2f536b6
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/08.txt
@@ -0,0 +1 @@
+0 2+p[lip1-si0li!=0^di>0]S098sil0x
diff --git a/tests/fuzzing/dc_inputs/09.txt b/tests/fuzzing/dc_inputs/09.txt
new file mode 100644
index 000000000000..ffc3a08908d4
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/09.txt
@@ -0,0 +1,9 @@
+#00000
+0sm[Nx]0s0[]0s0x[]zs0x[]0s0[]zs0c
+0s0[Nx]0s0[]zs0x[]zs0x[Nx]0s0[]zs0#000000000
+0s0[Nx]0s_[]zs0x[li]zs^x[l0000000]0sm[]zs0x[liNx]zs0x[li;0lilix]
+x[liN]zsWx[liN]zs0x[li;0lilix]
+x[liNzs0x#000000000
+*sm[Nx]0sm[]zs0x[li]zs0x[Nx]0sm[]zsdc
+0sm[Nx]0sm[]zs0x[li]zs0x[Nx]0sm[]x]zsxx#000000000
+*s0[Nx]0sm[]0s00[00]zs0x[Nx]0sm[]z0dc
diff --git a/tests/fuzzing/dc_inputs/10.txt b/tests/fuzzing/dc_inputs/10.txt
new file mode 100644
index 000000000000..0fade4bb899f
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/10.txt
@@ -0,0 +1,11 @@
+#0000
+0sm[Nx]0sm[]0s0x[li]0s0x[Nfvfff[]0sm[]zs0x[li]zs0x[Nx]0sm[]zs0c
+0sm[Nx]0sm[]x[li]zs0x[Nx]0sm[]zs0c
+0sm[Nx]0sm[]zs0x[li]zs0x[Nx]0sm[]zs0c
+0sm[Nx]0sm[]zs0x[li]zs0x[Nx]0sm[]zs0#000000000
+0sm[Nx]0s0[]zs0x[li]zs0x[0000000000]0sm[]zs0x[liNx]zs0x[li;0l0l0x]
+x[liNx]zs0x#000000000
+0sm[Nx]0sm[]zs0x[li]zs0x[000]0sm[]x[li]zs0x[Nx]0sm[]zs0c
+0sm[Nx]0sm[]zs0x[li]zs0x[Nx]0sm[]zs0#0000
+0sm[Nx]0sm[]zs0x[li]zs0x[Nx]0sm[]zs0#000000000
+0sm[Nx]0s_@]zs0x[li]s^x[0000000000]0s0[]zsW[0000]zsxx[000000000]
diff --git a/tests/fuzzing/dc_inputs/11.txt b/tests/fuzzing/dc_inputs/11.txt
new file mode 100644
index 000000000000..73bbc7d88f1c
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/11.txt
@@ -0,0 +1,4 @@
+#00000000
+[[00000]aa]sM[lip1-si0li>0eM]s010sil0x
+[[0000]00]sM[]s010sil0x
+[R]sM[lip=000]s0;0
diff --git a/tests/fuzzing/dc_inputs/12.txt b/tests/fuzzing/dc_inputs/12.txt
new file mode 100644
index 000000000000..aff25e7381cd
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/12.txt
@@ -0,0 +1,2 @@
+1;09R0si[lii000000000000000000000000000000000000000000]li1000 2346dvdddd;ddddddddddddd?-sdddddddddd0+dd0 1+pR
+0dvdddd;ddSddddddddddd 0si[lid1+sil0sili10li?-s0]dsxx[00000000]li1000 2000dvddddddddddddddddddddddddd0 0+ddd 1+pR
diff --git a/tests/fuzzing/dc_inputs/13.txt b/tests/fuzzing/dc_inputs/13.txt
new file mode 100644
index 000000000000..e6af9463e38c
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/13.txt
@@ -0,0 +1,7 @@
+zp10[00000000\00]pppppppppppppppR
+_1 _1(pR
+_1 _2(pR
+2 1{pR
+_1 1{pR 990+pR
+2000000 300000300000000+pR
+2070000000aaaaaaaaaaaaaaxaaaaaaaaaaaaR
diff --git a/tests/fuzzing/dc_inputs/14.txt b/tests/fuzzing/dc_inputs/14.txt
new file mode 100644
index 000000000000..741f3bfd7704
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/14.txt
@@ -0,0 +1,7 @@
+0bpR
+1bpR
+.200000bpR
+100000.0000600bpR
+_10bpR
+_.1000000bpR
+_30000.00bpR: \ No newline at end of file
diff --git a/tests/fuzzing/dc_inputs/15.txt b/tests/fuzzing/dc_inputs/15.txt
new file mode 100644
index 000000000000..828e8204a2aa
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/15.txt
@@ -0,0 +1,11 @@
+0bpax1bpR
+1bpR
+.30b900pR
+_10bp/90
+_30_.1/10bp30_.1/90
+_300.1/90/90
+_30_.1/90
+_30000.1/90
+90
+_30000.1/90
+70.000 70u
diff --git a/tests/fuzzing/dc_inputs/16.txt b/tests/fuzzing/dc_inputs/16.txt
new file mode 100644
index 000000000000..b021dd66d7ff
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/16.txt
@@ -0,0 +1 @@
+0 0;^dddddRps0R@s016dddRRd^2ddRZ(b-P;;$p;;;;;;9;;;;;;$ppppppppppppp30
diff --git a/tests/fuzzing/dc_inputs/17.txt b/tests/fuzzing/dc_inputs/17.txt
new file mode 100644
index 000000000000..fb46510fc3e3
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/17.txt
@@ -0,0 +1,20 @@
+0 1(pR
+1;;;;;pR
+1
+0 18d[0000000
+000000000000000000000000000000]sM[liv1-si0li!<0pR
+_1 0{pR
+_1 _1{pR
+_1 f0070000000000.0000000000000_10000000000006.00000000000005~pRpR
+_23745860900000.070000000000000 _0.20542357869124050~pRpR
+_3000000000000000.0000000700000006002 _7000000000000005000000000.000F000000000000003~pRpR20000000 300000000003.00000000000000030~pRpR
+_30000000000000000000000000
+1 0.001.00000000030
+1 0.000000000000000000000000000000000000000000000000000000000000000000002x30000000000000000000000000000000000000$80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000<0800000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000.000F000000000000003~pRpR20000000 300000000003.00000000000000030~pRpR
+_30000000000000.00000000000
+1 0.070.70000000000
+1 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000$80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000<080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000S8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z800000000000
+_10pR
+=390NpR
+_2000
+40000 5000C 2i>0eM]s01@sil0x
diff --git a/tests/fuzzing/dc_inputs/18.txt b/tests/fuzzing/dc_inputs/18.txt
new file mode 100644
index 000000000000..ed2659d097c2
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/18.txt
@@ -0,0 +1,3 @@
+1oVVf[li;WORli1S0Zli1;rORli1dH|2li@d-NliO+rK28729@9547628O745/pR
+_29307546189299999999999999999999999999999999999995 0.00000000000000000000000000009999999999999999999+99$9999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999995 0.0000000000000000000000000000000000R0000000000000000000000000000000000000+0000000000000000-0000000000000000000005+pR
+99999999999999999999999999999999999999999999999999999999999.999999999999999999999.99999999999999999999999999999999999999999900000000000000000000000R0000000000000000000000000000000000000+0000000000000000-0000000000000000000005+pR999999999999999999999999999999999999999999 0.00000000000000000000000000000000000000000000000000000000000C0020P00000000000000000000000000000000000007fli1+7fli1+si;d7dli1+si;0=Rls1d:0li +i100>x]dsxx[0000000]dsxx[p000]l010000000 00000000000pR
diff --git a/tests/fuzzing/dc_inputs/19.txt b/tests/fuzzing/dc_inputs/19.txt
new file mode 100644
index 000000000000..df417b4ab6d3
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/19.txt
@@ -0,0 +1 @@
+þ0000000000000000000000000000000
diff --git a/tests/fuzzing/dc_inputs/20.txt b/tests/fuzzing/dc_inputs/20.txt
new file mode 100644
index 000000000000..aa7752a85c67
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/20.txt
@@ -0,0 +1,3 @@
+#0000
+I20PPrP PPPP PPs0daP1:0pR
+ PPP1d:0pRR
diff --git a/tests/fuzzing/dc_inputs/21.txt b/tests/fuzzing/dc_inputs/21.txt
new file mode 100644
index 000000000000..01707d8256b6
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/21.txt
@@ -0,0 +1,5 @@
+0bpR
+1bpR
+.200000bpR
+100000.0000600bpR
+S09bpR
diff --git a/tests/fuzzing/dc_inputs/22.txt b/tests/fuzzing/dc_inputs/22.txt
new file mode 100644
index 000000000000..898184649926
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/22.txt
@@ -0,0 +1,36 @@
+[0000000000000]ZpR
+[He00
+[0000000\00000000]00
+[0000000\00000000]000
+[0000000\00000000]00
+[0000]
+00000]
+[28pR]
+[27pR]
+[26pR]
+[25pR]
+[24pR]
+[23pR]
+[22pR]
+[21pR]
+[20pR]
+[19pR]
+[18pR]
+[17pR]
+[16pR]
+[15pR]
+[14pR]
+[13pR]
+[12pR]
+[11pR]
+[10pR]
+[9pR]
+[8pR]
+[7pR]
+[6pR]
+[5pR]
+[4pR]
+[3pR]
+[2pR]
+[1pR]
+[xz0<x]dsxx
diff --git a/tests/fuzzing/dc_inputs/23.txt b/tests/fuzzing/dc_inputs/23.txt
new file mode 100644
index 000000000000..1897dfbbb0aa
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/23.txt
@@ -0,0 +1,2 @@
+#00000000
+[[0000 ]00]SM[l0p1-s00l0`000]s010sil0x
diff --git a/tests/fuzzing/dc_inputs/24.txt b/tests/fuzzing/dc_inputs/24.txt
new file mode 100644
index 000000000000..fb9b04f7f5b8
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/24.txt
@@ -0,0 +1 @@
+ [] 0:xX:0 0:0X:0n/dc.000C00}pR
diff --git a/tests/fuzzing/dc_inputs/25.txt b/tests/fuzzing/dc_inputs/25.txt
new file mode 100644
index 000000000000..d48a9b2e83fd
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/25.txt
@@ -0,0 +1,6 @@
+#00000000
+0s0[l0d:0l01;0d:0l01;0pRl01+s0l010>x]dsxx0sx0s0
+1 2
+s0[l0d:0l01;0d:0l01;0pRl01+s0l010>x]dsxx0sx0s0
+1 2
+€
diff --git a/tests/fuzzing/dc_inputs/26.txt b/tests/fuzzing/dc_inputs/26.txt
new file mode 100644
index 000000000000..731d3969ac3b
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/26.txt
@@ -0,0 +1,155 @@
+0bpR
+1bp0
+.20bpR
+100000.0000005bpR
+_10bpR
+_.1000[l0;0;rpRl01+s0l010>x]dsxx0sx0s0
+1 2+p+p
+3+p
+4+p
+5+p
+6+p
+7+p
+8+p
+9+p
+10+p
+11+p
+12+p
+13+p
+14+p
+15+p
+16+p
+17+p
+18+p
+19+p
+20+p
+21+0+p
+71+o
+70+p
+70+p
+70+p
+70+p
+22+p
+20+p
+20+p
+20+p
+20+p
+20+p
+20+p
+20+p
+30+p
+30+p
+30+p
+30+p
+30+p
+30+p
+30+p
+30+p
+30+p
+30+p
+40+1+p
+40+p
+40+p
+40+p
+40+p
+40+p
+40+p
+40+p
+40+p
+50+p
+50+p
+50+p
+50+p
+50+p
+50+p
+50+p
+50+p
+50+p
+50+p
+60+p
+60+p
+60bpR
+1bp0
+.20bpR
+100000.0070000bpR
+_10bpR
+_.1000[l0;0;rpRl01+s0l010>x]dsxx0sx0s0
+1 2+p+p
+3+p
+4+p
+5+p
+6+p
+7+p
+8+p
+9+p
+10+p
+11+p
+12+p
+13+p
+14+p
+15+p
+16+p
+17+p
+18+p
+19+p
+20+p
+21+0+p
+71+o
+70+p
+70+p
+70+p
+70+p
+22+p
+20+p
+20+p
+20+p
+20+p
+20+p
+20+p
+20+p
+30+p
+30+p
+30+p
+30+p
+30+p
+30+p
+30+p
+30+p
+30+p
+30+p
+40+1+p
+40+p
+40+p
+40+p
+40+p
+40+p
+40+p
+40+p
+40+p
+50+p
+50+p
+50+p
+50+p
+50+p
+50+p
+50+p
+50+p
+50+p
+50+p
+60+p
+60+p
+60+p
+60+p
+60+p
+60+p
+60+p
+60
+70+p
+70+p
+70+p
+70+p
+70+p
+70+p
+70+p
+80+p
diff --git a/tests/fuzzing/dc_inputs/27.txt b/tests/fuzzing/dc_inputs/27.txt
new file mode 100644
index 000000000000..69745b952afc
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/27.txt
@@ -0,0 +1,2 @@
+"0000000\
+
diff --git a/tests/fuzzing/dc_inputs/28.txt b/tests/fuzzing/dc_inputs/28.txt
new file mode 100644
index 000000000000..fe81732b3e38
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/28.txt
@@ -0,0 +1 @@
+10 4%0:i[000] 1:b 0;0 p 1;b0:b [000] 1:b 0;b p 1;b~b 0;b p 0;b~~~0k
diff --git a/tests/fuzzing/dc_inputs/29.txt b/tests/fuzzing/dc_inputs/29.txt
new file mode 100644
index 000000000000..886eb8ee0a8e
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/29.txt
@@ -0,0 +1,13 @@
+10 4%0:b [200] 1:b 0;b 1;b X
+ 2000 1%p0
+3460:b [200] 1:b 0;b p bp0
+.2 1%pR
+6 4%pR
+10 4%0:b [200] 1:b 0;b p 1;b X
+ 20000 1%pR
+b 0;b p 0;b2
+1bpb [200] 1:u 0;b p 1;b X
+ 2
+[000] 0:b [200] 0:b 0;b p S0b p
+[s0]XpR
+
diff --git a/tests/fuzzing/dc_inputs/30.txt b/tests/fuzzing/dc_inputs/30.txt
new file mode 100644
index 000000000000..e072e71617d8
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/30.txt
@@ -0,0 +1 @@
+0;0[]0:b;bs0l0x;0
diff --git a/tests/fuzzing/dc_inputs/31.txt b/tests/fuzzing/dc_inputs/31.txt
new file mode 100644
index 000000000000..9bada9d07d0e
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/31.txt
@@ -0,0 +1 @@
+0;0[]0:b;bS0l0x;0
diff --git a/tests/fuzzing/dc_inputs/abs.txt b/tests/fuzzing/dc_inputs/abs.txt
new file mode 100644
index 000000000000..9907dfc6679d
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/abs.txt
@@ -0,0 +1,7 @@
+0bpR
+1bpR
+.218933bpR
+138963.9873645bpR
+_19bpR
+_.1298376bpR
+_3892173.289375bpR
diff --git a/tests/fuzzing/dc_inputs/add.txt b/tests/fuzzing/dc_inputs/add.txt
new file mode 100644
index 000000000000..42da2f1f309c
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/add.txt
@@ -0,0 +1,33 @@
+0 0+pR
+0 0 0++pR
+0 1+pR
+0 1 1++pR
+1 1+pR
+1 0+pR
+2 5+pR
+237 483+pR
+999 999+pR
+2374623 324869356734856+pR
+2378639084586723980562 23468729367839+pR
+37298367203972395108367910823465293084561329084561390845613409516734503870691837451 785621394067928346918023476190834672198467134908618723249671349062187346898241093486139046139084613490817356023871869102746182749061872609129847+pR
+1.1 0+pR
+0 1.1+pR
+457283.731284923576 37842934672834.3874629385672354+pR
+1.0 0.1+pR
+3746289134067138046 0.138375863945672398456712389456273486293+pR
+_1 _1+pR
+_4 _15+pR
+_1346782 _1287904651762468913476+pR
+99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+pR
+99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999995 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005+pR
+99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+pR
+99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999899999999999999999999999999999999999999999999999999999999999999 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+pR
+99999999999999999999999999999999999989999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+pR
+_1889985797 2012747315+pR
+0 _14338.391079082+pR
+_2422297 1.3134942556+pR
+_1289374 1289374.2893417 0.238971 28937.28971+++pR
+1289374 1289374.2893417 _0.238971 28937.28971+++pR
+1289374 1289374.2893417 0.238971 _28937.28971+++pR
+1289374 1289374.2893417 _0.238971 _28937.28971+++pR
+1289374 _1289374.2893417 _0.238971 _28937.28971+++pR
diff --git a/tests/fuzzing/dc_inputs/array.dc b/tests/fuzzing/dc_inputs/array.dc
new file mode 100644
index 000000000000..970f29a68768
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/array.dc
@@ -0,0 +1,2 @@
+#! /usr/bin/dc
+0si[lid:rli1+sili100>x]dsxx[li;rpRli1-sili100!>x]li1+[li;rpRli1+sili100>x]
diff --git a/tests/fuzzing/dc_inputs/boolean.txt b/tests/fuzzing/dc_inputs/boolean.txt
new file mode 100644
index 000000000000..815100f0d085
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/boolean.txt
@@ -0,0 +1,80 @@
+0 1(pR
+1 1(pR
+2 1(pR
+_1 1(pR
+_1 0(pR
+_1 _1(pR
+_1 _2(pR
+0 1{pR
+1 1{pR
+2 1{pR
+_1 1{pR
+_1 0{pR
+_1 _1{pR
+_1 _2{pR
+0 1)pR
+1 1)pR
+2 1)pR
+_1 1)pR
+_1 0)pR
+_1 _1)pR
+_1 _2)pR
+0 1}pR
+1 1}pR
+2 1}pR
+_1 1}pR
+_1 0}pR
+_1 _1}pR
+_1 _2}pR
+0 0GpR
+0 1GpR
+1 0GpR
+_1 _1GpR
+0 _1GpR
+_1 0GpR
+1 1GpR
+238 2GpR
+0NpR
+1NpR
+_1NpR
+2398NpR
+_2983.2389NpR
+0 0MpR
+1 0MpR
+0 1MpR
+1 1MpR
+128973240 0MpR
+0 2893712MpR
+1982 28937MpR
+_2938 0MpR
+0 _1023.298037MpR
+0.283917 0MpR
+2389 _1208.28937MpR
+0 289.289372MpR
+_298.29387 0MpR
+_2983.28973 82937MpR
+0 _2938.320837MpR
+_2089.2308 0MpR
+_0.2893 _2938.28973MpR
+0.00000 1892MpR
+1289.023 .0000MpR
+0 0mpR
+1 0mpR
+0 1mpR
+1 1mpR
+128973240 0mpR
+0 2893712mpR
+1982 28937mpR
+_2938 0mpR
+0 _1023.298037mpR
+0.283917 0mpR
+2389 _1208.28937mpR
+0 289.289372mpR
+_298.29387 0mpR
+_2983.28973 82937mpR
+0 _2938.320837mpR
+_2089.2308 0mpR
+_0.2893 _2938.28973mpR
+0.00000 1892mpR
+1289.023 .0000mpR
+0.0000 .00000mpR
diff --git a/tests/fuzzing/dc_inputs/decimal.txt b/tests/fuzzing/dc_inputs/decimal.txt
new file mode 100644
index 000000000000..ebbb2dc91b3a
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/decimal.txt
@@ -0,0 +1,36 @@
+0pR
+0.0pR
+.0000pR
+000000000000000000000000.00000000000000000000000pR
+000000000000000000000000000135482346782356pR
+000000000000000000000000002pR
+1pR
+11pR
+123pR
+7505pR
+1023468723275435238491972521917846pR
+4343472432431705867392073517038270398027352709027389273920739037937960379637893607893607893670530278200795207952702873892786172916728961783907893607418973587857386079679267926737520730925372983782793652793pR
+_1pR
+_203pR
+_57pR
+_18586pR
+_31378682943772818461924738352952347258pR
+_823945628745673589495067238723986520375698237620834674509627345273096287563846592384526349872634895763257893467523987578690283762897568459072348758071071087813501875908127359018715023841710239872301387278pR
+.123521346523546pR
+0.1245923756273856pR
+_.1024678456387pR
+_0.8735863475634587pR
+4.0pR
+_6.0pR
+234237468293576.000000000000000000000000000000pR
+23987623568943567.00000000000000000005677834650000000000000pR
+23856934568940675.000000000000000435676782300000000000000456784pR
+77567648698496.000000000000000000587674750000000000458563800000000000000pR
+2348672354968723.2374823546000000000003256987394502346892435623870000000034578pR
+_2354768.000000000000000000000000000000000000pR
+_96739874567.000000000347683456pR
+_3764568345.000000000004573845000000347683460pR
+_356784356.934568495770004586495678300000000pR
+74325437345273852773827101738273127312738521733017537073520735207307570358738257390761276072160719802671980267018728630178.7082681027680521760217867841276127681270867827821768173178207830710978017738178678012767377058785378278207385237085237803278203782037237582795870pR
+_756752732785273851273728537852738257837283678965738527385272983678372867327835672967385278372637862738627836279863782673862783670.71738178361738718367186378610738617836781603760178367018603760178107735278372832783728367826738627836278378260736270367362073867097307925pR
+9812734012837410982345719208345712908357412903587192048571920458712.23957182459817249058172945781pR
diff --git a/tests/fuzzing/dc_inputs/divide.txt b/tests/fuzzing/dc_inputs/divide.txt
new file mode 100644
index 000000000000..38b874e9f175
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/divide.txt
@@ -0,0 +1,33 @@
+20k
+0 1/pR
+0 321566/pR
+0 0.3984567238456/pR
+1 1/pR
+1 1287469297356/pR
+1 0.2395672438567234/pR
+1 237586239856.0293596728392360/pR
+1249687284356 3027949207835207/pR
+378617298617396719 35748521/pR
+9348576237845624358 0.9857829375461/pR
+35768293846193284 2374568947.045762839567823/pR
+_78987234567812345 876542837618936/pR
+_356789237555535468 0.3375273860984786903/pR
+_5203475364850390 435742903748307.70869378534043296404530458/pR
+_0.37861723347576903 7385770896/pR
+_0.399454682043962 0.34824389304/pR
+_0.6920414523873204 356489645223.76076045304879030/pR
+_35872917389671.7573280963748 73924708/pR
+_78375896314.4836709876983 0.78356798637817/pR
+_2374123896417.143789621437581 347821469423789.1473856783960/pR
+_896729350238549726 _34976289345762/pR
+_2374568293458762348596 _0.8792370647234987679/pR
+_237584692306721845726038 _21783910782374529637.978102738746189024761/pR
+_0.23457980123576298375682 _1375486293874612/pR
+_0.173897061862478951264 _0.8179327486017634987516298745/pR
+_0.9186739823576829347586 _0.235678293458756239846/pR
+_0.9375896183746982374568 _13784962873546.0928729395476283745/pR
+_2930754618923467.12323745862937465 _734869238465/pR
+_23745861923467.874675129834675 _0.23542357869124756/pR
+_3878923750692883.7238596702834756902 _7384192674957215364986723.9738461923487621983/pR
+1 0.00000000000000000000000000000000000000000002346728372937352457354204563027/pR
+239854711289345712 2891374 182 .2893 ///pR
diff --git a/tests/fuzzing/dc_inputs/divmod.txt b/tests/fuzzing/dc_inputs/divmod.txt
new file mode 100644
index 000000000000..1633203ff99f
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/divmod.txt
@@ -0,0 +1,64 @@
+20k
+0 1~pRpR
+0 321566~pRpR
+0 0.3984567238456~pRpR
+1 1~pRpR
+1 1287469297356~pRpR
+1 0.2395672438567234~pRpR
+1 237586239856.0293596728392360~pRpR
+1249687284356 3027949207835207~pRpR
+378617298617396719 35748521~pRpR
+9348576237845624358 0.9857829375461~pRpR
+35768293846193284 2374568947.045762839567823~pRpR
+_78987234567812345 876542837618936~pRpR
+_356789237555535468 0.3375273860984786903~pRpR
+_5203475364850390 435742903748307.70869378534043296404530458~pRpR
+_0.37861723347576903 7385770896~pRpR
+_0.399454682043962 0.34824389304~pRpR
+_0.6920414523873204 356489645223.76076045304879030~pRpR
+_35872917389671.7573280963748 73924708~pRpR
+_78375896314.4836709876983 0.78356798637817~pRpR
+_2374123896417.143789621437581 347821469423789.1473856783960~pRpR
+_896729350238549726 _34976289345762~pRpR
+_2374568293458762348596 _0.8792370647234987679~pRpR
+_237584692306721845726038 _21783910782374529637.978102738746189024761~pRpR
+_0.23457980123576298375682 _1375486293874612~pRpR
+_0.173897061862478951264 _0.8179327486017634987516298745~pRpR
+_0.9186739823576829347586 _0.235678293458756239846~pRpR
+_0.9375896183746982374568 _13784962873546.0928729395476283745~pRpR
+_2930754618923467.12323745862937465 _734869238465~pRpR
+_23745861923467.874675129834675 _0.23542357869124756~pRpR
+_3878923750692883.7238596702834756902 _7384192674957215364986723.9738461923487621983~pRpR
+1 0.00000000000000000000000000000000000000000002346728372937352457354204563027~pRpR
+0k
+0 1~pRpR
+0 321566~pRpR
+0 0.3984567238456~pRpR
+1 1~pRpR
+1 1287469297356~pRpR
+1 0.2395672438567234~pRpR
+1 237586239856.0293596728392360~pRpR
+1249687284356 3027949207835207~pRpR
+378617298617396719 35748521~pRpR
+9348576237845624358 0.9857829375461~pRpR
+35768293846193284 2374568947.045762839567823~pRpR
+_78987234567812345 876542837618936~pRpR
+_356789237555535468 0.3375273860984786903~pRpR
+_5203475364850390 435742903748307.70869378534043296404530458~pRpR
+_0.37861723347576903 7385770896~pRpR
+_0.399454682043962 0.34824389304~pRpR
+_0.6920414523873204 356489645223.76076045304879030~pRpR
+_35872917389671.7573280963748 73924708~pRpR
+_78375896314.4836709876983 0.78356798637817~pRpR
+_2374123896417.143789621437581 347821469423789.1473856783960~pRpR
+_896729350238549726 _34976289345762~pRpR
+_2374568293458762348596 _0.8792370647234987679~pRpR
+_237584692306721845726038 _21783910782374529637.978102738746189024761~pRpR
+_0.23457980123576298375682 _1375486293874612~pRpR
+_0.173897061862478951264 _0.8179327486017634987516298745~pRpR
+_0.9186739823576829347586 _0.235678293458756239846~pRpR
+_0.9375896183746982374568 _13784962873546.0928729395476283745~pRpR
+_2930754618923467.12323745862937465 _734869238465~pRpR
+_23745861923467.874675129834675 _0.23542357869124756~pRpR
+_3878923750692883.7238596702834756902 _7384192674957215364986723.9738461923487621983~pRpR
+1 0.00000000000000000000000000000000000000000002346728372937352457354204563027~pRpR
diff --git a/tests/fuzzing/dc_inputs/else.dc b/tests/fuzzing/dc_inputs/else.dc
new file mode 100644
index 000000000000..84deb8754e9f
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/else.dc
@@ -0,0 +1,4 @@
+#! /usr/bin/dc
+[[Done!]pR]sM[lip1-si0li>LeM]sL10silLx
+[[Done!]pR]sM[lip1-si0li!<LeM]sL10silLx
+[[Done!]pR]sM[lip1-si0li!=LeM]sL10silLx
diff --git a/tests/fuzzing/dc_inputs/engineering.txt b/tests/fuzzing/dc_inputs/engineering.txt
new file mode 100644
index 000000000000..90a35052b3cb
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/engineering.txt
@@ -0,0 +1,19 @@
+1o
+0pR
+1pR
+_34pR
+298pR
+_8933pR
+29488pR
+_148232pR
+8927559pR
+.2pR
+_.02pR
+.002pR
+_.0003pR
+.0000209310pR
+_.00000289362pR
+.000000859289pR
+_.02983672pR
+.20201296pR
+_.8907210897000000000000000000pR
diff --git a/tests/fuzzing/dc_inputs/loop.dc b/tests/fuzzing/dc_inputs/loop.dc
new file mode 100644
index 000000000000..26cec23818df
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/loop.dc
@@ -0,0 +1,3 @@
+#! /usr/bin/dc
+[lip1-si0li>L]sL10silLx
+[lip1+si10li<L]sL0silLx
diff --git a/tests/fuzzing/dc_inputs/misc.txt b/tests/fuzzing/dc_inputs/misc.txt
new file mode 100644
index 000000000000..222a3ad265d2
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/misc.txt
@@ -0,0 +1 @@
+zp198202389.289374pzp[Hello, World!]pzpzpfrfczpfR
diff --git a/tests/fuzzing/dc_inputs/modexp.txt b/tests/fuzzing/dc_inputs/modexp.txt
new file mode 100644
index 000000000000..a6afb998558e
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/modexp.txt
@@ -0,0 +1,103 @@
+0 0 1|pR
+1 0 1|pR
+1 0 2|pR
+0 10 1|pR
+1 293 1|pR
+1 2789365 2|pR
+100 8 7|pR
+10922384 15031007 201|pR
+3346529 189 254|pR
+4113416930 197 14|pR
+7709 5887 111|pR
+5487406 3252 128|pR
+2080527 2279453822 219|pR
+48895 50678 232|pR
+1535808383 2902995144 18|pR
+8437837 2882198 69|pR
+35363 25806 2|pR
+3221177403 1560419989 189|pR
+227 42775 163|pR
+2811398069 37500 173|pR
+15046850 3859895697 195|pR
+15770756 3621999893 119|pR
+6937927 3719297189 183|pR
+12573 43819 209|pR
+42098463 7584603 136|pR
+8656683 1328292415 226|pR
+209 81 157|pR
+141 13317429 26|pR
+809485795 60745 101|pR
+4882 1388217898 38|pR
+750704 78 119|pR
+668879580 2888860497 179|pR
+1152725844 15295742 154|pR
+16160694 8981529 154|pR
+216 102 3|pR
+3691227289 5344109 232|pR
+2195559299 61 222|pR
+2478990626 13007440 30|pR
+45083 44 117|pR
+224 55824 53|pR
+1372700133 89 94|pR
+205 10422 48|pR
+11887 12 73|pR
+5955 24353 114|pR
+1201697310 789722419 6|pR
+56577 231 229|pR
+96 38841 189|pR
+6529661 5636520 209|pR
+11005 15955685 27|pR
+9709 231 132|pR
+59790 1034579699 166|pR
+47892 14536879 79|pR
+48 208 21|pR
+33036 3877 65|pR
+164 6527085 249|pR
+12146850 224 37|pR
+218 16425679 62|pR
+51 27641 95|pR
+3076735605 49154 32|pR
+515652717 4117874315 143|pR
+300672671 720768884 110|pR
+9422066 206 5|pR
+43 97 13|pR
+545174510 65319 126|pR
+3317462730 704990271 51|pR
+47316 23231 202|pR
+7236571 4379567 106|pR
+2584584521 2459274189 29|pR
+61562 5035178 178|pR
+65302 112 151|pR
+63040 2168854052 213|pR
+9039611 2370306559 62|pR
+16414384 1020652061 83|pR
+7491 3853569905 172|pR
+1180322494 46670 84|pR
+3823343557 3865107254 127|pR
+6240872 55335 39|pR
+2281401897 1098411 251|pR
+61 2949190429 231|pR
+8981024 162 43|pR
+1 3568883218 212|pR
+4217100969 3471787779 8|pR
+3232237 13 243|pR
+29280 3972452706 100|pR
+13077 6431923 216|pR
+104 3098510775 140|pR
+9503298 174 242|pR
+3424695712 12184 23|pR
+184 15066347 151|pR
+2935856 14003205 184|pR
+1386637762 2128151420 71|pR
+154 11960656 12|pR
+743976432 4004778779 136|pR
+3909160595 3575680922 21|pR
+26133 3580 147|pR
+409154 170 68|pR
+149 55629 40|pR
+5753 13776176 32|pR
+3831447473 658273178 98|pR
+1527252003 2300622 207|pR
+3363824553 8244645 215|pR
+20 145 101|pR
+4005077294 2196555621 94|pR
diff --git a/tests/fuzzing/dc_inputs/modulus.txt b/tests/fuzzing/dc_inputs/modulus.txt
new file mode 100644
index 000000000000..613944b2001a
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/modulus.txt
@@ -0,0 +1,70 @@
+20k
+1 1%pR
+2 1%pR
+16 4%pR
+15 4%pR
+17 4%pR
+2389473 5%pR
+39240687239 1%pR
+346728934 23958%pR
+3496723859067234 298375462837546928347623059375486%pR
+_1 1%pR
+_2 1%pR
+_47589634875689345 37869235%pR
+_1274852934765 2387628935486273546%pR
+_6324758963 237854962%pR
+1 _1%pR
+2 _1%pR
+2 _2%pR
+2 _3%pR
+16 5%pR
+15 5%pR
+14 5%pR
+89237423 _237856923854%pR
+123647238946 _12467%pR
+_1 _1%pR
+_2 _1%pR
+_2 _2%pR
+_2 _3%pR
+_13 _7%pR
+_14 _7%pR
+_15 _7%pR
+_12784956 _32746%pR
+_127849612 _23712347682193%pR
+0k
+1 1%pR
+2 1%pR
+16 4%pR
+15 4%pR
+17 4%pR
+2389473 5%pR
+39240687239 1%pR
+346728934 23958%pR
+3496723859067234 298375462837546928347623059375486%pR
+_1 1%pR
+_2 1%pR
+_47589634875689345 37869235%pR
+_1274852934765 2387628935486273546%pR
+_6324758963 237854962%pR
+1 _1%pR
+2 _1%pR
+2 _2%pR
+2 _3%pR
+16 5%pR
+15 5%pR
+14 5%pR
+89237423 _237856923854%pR
+123647238946 _12467%pR
+_1 _1%pR
+_2 _1%pR
+_2 _2%pR
+_2 _3%pR
+_13 _7%pR
+_14 _7%pR
+_15 _7%pR
+_12784956 _32746%pR
+_127849612 _23712347682193%pR
+_3191280681 641165986%pR
+0k _899510228 _2448300078.40314%pR
+0k _7424863 _207.2609738667%pR
+0k 3769798918 0.6%pR
diff --git a/tests/fuzzing/dc_inputs/multiply.txt b/tests/fuzzing/dc_inputs/multiply.txt
new file mode 100644
index 000000000000..1f9041d06ea7
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/multiply.txt
@@ -0,0 +1,42 @@
+0 0*pR
+0.000 0*pR
+1 0*pR
+0 1*pR
+0 2498752389672835476*pR
+873246913745129084576134 0*pR
+1 472638590273489273456*pR
+12374861230476103672835496 1*pR
+1 1*pR
+2 1*pR
+1 2*pR
+2 2*pR
+3 14*pR
+17 8*pR
+1892467513846753 1872439821374591038746*pR
+328962735862.2973546835638947635 1728465791348762356*pR
+38745962374538.387427384672934867234 0.1932476528394672837568923754*pR
+9878894576289457634856.2738627161689017387608947567654 37842939768237596237854203.29874372139852739126739621793162*pR
+_1 1*pR
+_1 2*pR
+78893457 _34876238956*pR
+235678324957634 _0.2349578349672389576*pR
+_12849567821934 12738462937681*pR
+1274861293467.927843682937462 _28935678239*pR
+2936077239872.12937462836 _0.012842357682435762*pR
+2387692387566.2378569237546 _272189345628.123875629835876*pR
+0.012348629356782835962 _23487692356*pR
+0.4768349567348675934 _0.23756834576934857638495*pR
+0.98748395367485962735486 _4675839462354867.376834956738456*pR
+_321784627934586 _235762378596*pR
+_32578623567892356 _0.32567384579638456*pR
+_35768232346876 _2348672935602387620.28375682349576237856*pR
+_0.2356728394765234 _238759624356978*pR
+_0.2345768212346780 _0.235768124697074385948943532045*pR
+_0.370873860736785306278630 _7835678398607.7086378076867096270*pR
+_78365713707.7089637863786730 _738580798679306780*pR
+_73867038956790490258249 _0.7379862716391723672803679*pR
+_378621971598721837710387 _98465373878350798.09743896037963078560*pR
+37164201 2931559660*pR
+679468076118972457796560530571.46287161642138401685 93762.2836*pR
+.000000000000000000000000001 .0000000000000000000000001*pR
+239 289 _98 .8937 _.1893 28937*****pR
diff --git a/tests/fuzzing/dc_inputs/places.txt b/tests/fuzzing/dc_inputs/places.txt
new file mode 100644
index 000000000000..308ff1373d64
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/places.txt
@@ -0,0 +1,14 @@
+0 0@pR
+1 0@pR
+2 0@pR
+0.0023896 0@pR
+1.298346 0@pR
+2.00000000 0@pR
+0.0023896 3@pR
+1.298346 4@pR
+2.00000000 5@pR
+289 3@pR
+18.34 6@pR
+_183.1 0@pR
+_23.238 8@pR
+_343.23 2@pR
diff --git a/tests/fuzzing/dc_inputs/power.txt b/tests/fuzzing/dc_inputs/power.txt
new file mode 100644
index 000000000000..955e42557a15
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/power.txt
@@ -0,0 +1,36 @@
+20k
+0 0^pR
+0 1^pR
+0 1894^pR
+1 0^pR
+39746823 0^pR
+0.238672983047682 0^pR
+18394762374689237468.97354862973846 0^pR
+1 1^pR
+2 1^pR
+18927361346 1^pR
+0.23523785962738592635777 1^pR
+328956734869213746.89782398457234 1^pR
+8937 8^pR
+93762.2836 3^pR
+1 _1^pR
+2 _1^pR
+10 _1^pR
+683734768 _1^pR
+38579623756.897937568235 _1^pR
+1 _32467^pR
+2 _53^pR
+_1 1^pR
+_1 2^pR
+_2 1^pR
+_2 2^pR
+_237 294^pR
+_3746 28^pR
+_0.3548 35^pR
+_1 _1^pR
+_1 _2^pR
+_2 _1^pR
+_2 _2^pR
+_86 _7^pR
+0 _251^pR
+_0.2959371298 27^pR
diff --git a/tests/fuzzing/dc_inputs/quit.dc b/tests/fuzzing/dc_inputs/quit.dc
new file mode 100644
index 000000000000..81e6289af25b
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/quit.dc
@@ -0,0 +1,2 @@
+1se [li p 1+si le li !=lem]sl [lk p 1+sk le lk !=o]so [0sk lox leQ 0sk lox le 3*1+Q 0sk lox]sm [0si llx le 1+se 10 le !=n]dsnx
+1si [li p 1+si 10 li !=set]ss [1000Q]st lsx
diff --git a/tests/fuzzing/dc_inputs/scientific.txt b/tests/fuzzing/dc_inputs/scientific.txt
new file mode 100644
index 000000000000..59a78dbb3a6c
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/scientific.txt
@@ -0,0 +1,51 @@
+0e0pR
+0e1pR
+0e5pR
+0e_2pR
+0e_100pR
+1e0pR
+_1e1pR
+1e9pR
+_1e21pR
+1e_1pR
+_1e_2pR
+1e_5pR
+4.92837e5pR
+_3.28971028e20pR
+6.2e3pR
+_8.289371e2pR
+5.9817280937e8pR
+_3.28977e_1pR
+8.8927891e_20pR
+_7.98239e_4pR
+4.4892e_4pR
+_18937e0pR
+198273e10pR
+_18927e_4pR
+28937e_5pR
+_891072e_7pR
+.28972e0pR
+_.891273e_1pR
+.8928397e1pR
+_.0002983172e5pR
+.00022e3pR
+_.00022e4pR
+.0000328937e8pR
+0o
+0pR
+1pR
+10pR
+_289pR
+2894pR
+_89434pR
+894370pR
+_1239839pR
+28931708pR
+_8052098.8029731809pR
+.1pR
+_.01pR
+.001pR
+_.00038pR
+.0000483pR
+_.0002894378190pR
+.2893712083pR
diff --git a/tests/fuzzing/dc_inputs/shift.txt b/tests/fuzzing/dc_inputs/shift.txt
new file mode 100644
index 000000000000..628b0a5bf6fe
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/shift.txt
@@ -0,0 +1,42 @@
+0 0HpR
+1 0HpR
+2 0HpR
+0.0023896 0HpR
+1.298346 0HpR
+2.00000000 0HpR
+0.0023896 3HpR
+1.298346 4HpR
+2.00000000 5HpR
+89136.892348976 7HpR
+1892634051829351283289298 24HpR
+0 0hpR
+1 0hpR
+2 0hpR
+0.0023896 0hpR
+1.298346 0hpR
+2.00000000 0hpR
+0.0023896 3hpR
+1.298346 4hpR
+2.00000000 5hpR
+89136.892348976 7hpR
+1892634051829351283289298 24hpR
+_1 0HpR
+_2 0HpR
+_0.0023896 0HpR
+_1.298346 0HpR
+_2.00000000 0HpR
+_0.0023896 3HpR
+_1.298346 4HpR
+_2.00000000 5HpR
+_89136.892348976 7HpR
+_1892634051829351283289298 24HpR
+_1 0hpR
+_2 0hpR
+_0.0023896 0hpR
+_1.298346 0hpR
+_2.00000000 0hpR
+_0.0023896 3hpR
+_1.298346 4hpR
+_2.00000000 5hpR
+_89136.892348976 7hpR
+_1892634051829351283289298 24hpR
diff --git a/tests/fuzzing/dc_inputs/sqrt.txt b/tests/fuzzing/dc_inputs/sqrt.txt
new file mode 100644
index 000000000000..7c13fdd0bb5d
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/sqrt.txt
@@ -0,0 +1,14 @@
+20k
+0vpR
+2vpR
+4vpR
+9vpR
+16vpR
+25vpR
+121vpR
+48765vpR
+9287356207356vpR
+0.189274385967238956872354vpR
+12389467137496823.134567829387456283946vpR
+.0000000000000000000000000000123vpR
+1vpR
diff --git a/tests/fuzzing/dc_inputs/stdin.txt b/tests/fuzzing/dc_inputs/stdin.txt
new file mode 100644
index 000000000000..7bf8316b99af
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/stdin.txt
@@ -0,0 +1,205 @@
+0si[lid:rli1+sili10>x]dsxxli1-si[li;rpRli1-sili0!>x]dsxxli1+si[li;rpRli1+sili10>x]dsxx0sx0si
+1 2+p
+[foo]
+0
+1+p
+2+p
+3+p
+4+p
+5+p
+6+p
+7+p
+8+p
+9+p
+10+p
+11+p
+12+p
+13+p
+14+p
+15+p
+16+p
+17+p
+18+p
+19+p
+20+p
+21+p
+22+p
+23+p
+24+p
+25+p
+26+p
+27+p
+28+p
+29+p
+30+p
+31+p
+32+p
+33+p
+34+p
+35+p
+36+p
+37+p
+38+p
+39+p
+40+p
+41+p
+42+p
+43+p
+44+p
+45+p
+46+p
+47+p
+48+p
+49+p
+50+p
+51+p
+52+p
+53+p
+54+p
+55+p
+56+p
+57+p
+58+p
+59+p
+60+p
+61+p
+62+p
+63+p
+64+p
+65+p
+66+p
+67+p
+68+p
+69+p
+70+p
+71+p
+72+p
+73+p
+74+p
+75+p
+76+p
+77+p
+78+p
+79+p
+80+p
+81+p
+82+p
+83+p
+84+p
+85+p
+86+p
+87+p
+88+p
+89+p
+90+p
+91+p
+92+p
+93+p
+94+p
+95+p
+96+p
+97+p
+98+p
+99+p
+100+p
+101+p
+102+p
+103+p
+104+p
+105+p
+106+p
+107+p
+108+p
+109+p
+110+p
+111+p
+112+p
+113+p
+114+p
+115+p
+116+p
+117+p
+118+p
+119+p
+120+p
+121+p
+122+p
+123+p
+124+p
+125+p
+126+p
+127+p
+128+p
+129+p
+130+p
+131+p
+132+p
+133+p
+134+p
+135+p
+136+p
+137+p
+138+p
+139+p
+140+p
+141+p
+142+p
+143+p
+144+p
+145+p
+146+p
+147+p
+148+p
+149+p
+150+p
+151+p
+152+p
+153+p
+154+p
+155+p
+156+p
+157+p
+158+p
+159+p
+160+p
+161+p
+162+p
+163+p
+164+p
+165+p
+166+p
+167+p
+168+p
+169+p
+170+p
+171+p
+172+p
+173+p
+174+p
+175+p
+176+p
+177+p
+178+p
+179+p
+180+p
+181+p
+182+p
+183+p
+184+p
+185+p
+186+p
+187+p
+188+p
+189+p
+190+p
+191+p
+192+p
+193+p
+194+p
+195+p
+196+p
+197+p
+198+p
+199+p
+200+p
+p
diff --git a/tests/fuzzing/dc_inputs/stream.dc b/tests/fuzzing/dc_inputs/stream.dc
new file mode 100755
index 000000000000..5c61e7c931f9
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/stream.dc
@@ -0,0 +1,2 @@
+#! /usr/bin/dc
+0si[liPlid1+sili4096>x]ddsxPx
diff --git a/tests/fuzzing/dc_inputs/strings.txt b/tests/fuzzing/dc_inputs/strings.txt
new file mode 100644
index 000000000000..369d8e1dd842
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/strings.txt
@@ -0,0 +1,50 @@
+[Hello, World!]ZpR
+[Hello, World!]pR
+[Hello, \[ World!]ZpR
+[Hello, \[ World!]pR
+[Hello, \] World!]ZpR
+[Hello, \] World!]pR
+[30pR]
+[29pR]
+[28pR]
+[27pR]
+[26pR]
+[25pR]
+[24pR]
+[23pR]
+[22pR]
+[21pR]
+[20pR]
+[19pR]
+[18pR]
+[17pR]
+[16pR]
+[15pR]
+[14pR]
+[13pR]
+[12pR]
+[11pR]
+[10pR]
+[9pR]
+[8pR]
+[7pR]
+[6pR]
+[5pR]
+[4pR]
+[3pR]
+[2pR]
+[1pR]
+[xz0<x]dsxx
+[\\]pR
+[\[\]]pR
+1xpR
+[1st] 0:b [2nd] 1:b 0;b p 1;b p
+[string]XpR
+[3 4^pR]silix
+[[[q 1 3+pR]x]x]x4 5^pR
+4xpR
+5 112ax 90ax 112ax 82ax
+[\q] pR
+[q\\] pR
+[\\] pR
+92 a pR
diff --git a/tests/fuzzing/dc_inputs/subtract.txt b/tests/fuzzing/dc_inputs/subtract.txt
new file mode 100644
index 000000000000..2cb4104fb717
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/subtract.txt
@@ -0,0 +1,33 @@
+0 0-pR
+0 1-pR
+1 0-pR
+1 1-pR
+5 2-pR
+2 9-pR
+321974 12845976238457-pR
+2874519803456710938465 384723854-pR
+10000000000000000000000000000000000000000 999999999999999999999999999999999999999-pR
+10000000000000000000000000000000000000000 9999999999999999999999999999999999999999-pR
+10000000000000000000000000000000000000000 999999999999999999999999999999999999999.99999999999999999999999999999999999-pR
+10000000000000000000000000000000000000000 9999999999999999999999999999999999999999.9999999999999999999999999999999999-pR
+10000000000000000000000000000000000000000 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000001-pR
+10000000000000000000000000000000000000001 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000001-pR
+10000000000000000000000000000000000000000.0000000001 0.0000000000000000000000000000000000000000000000000000000000000000000000000001-pR
+_2 6-pR
+_23784692345 182934721309467230894628735496027345-pR
+_224352354962873059862 _1245723576829456278354960278345-pR
+_3468273598 _12354243-pR
+_0.92345768293 _2354768923-pR
+_712384634.123476823 _24768293376-pR
+_1879234638 _0.917234869234-pR
+_0.9172438692134 _0.971284967124-pR
+_0.1283475123465 _0.937462346-pR
+_124765829346.2837468293562 _0.923467829346-pR
+_12476829385769 _1928476259034.8378629356-pR
+_0.38476284395876345 _94875394587623.2357869324857-pR
+_4674596708467.34754789403674343567 _48672394852354698.237548629345-pR
+979519669 3018100865-pR
+929002449 3280677283-pR
+0 _525898-pR
+3 _3-pR
+2 _1 2893714 _2189367411289 _.8921374 3.9201384----pR
diff --git a/tests/fuzzing/dc_inputs/trunc.txt b/tests/fuzzing/dc_inputs/trunc.txt
new file mode 100644
index 000000000000..684752e065dd
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/trunc.txt
@@ -0,0 +1,11 @@
+0$pR
+1$pR
+2$pR
+0.8249167203486$pR
+1.28937150237$pR
+2.0$pR
+28937.92837605126$pR
+2890.000000000$pR
+_1$pR
+_1.128973$pR
+_9812387.28910273$pR
diff --git a/tests/fuzzing/dc_inputs/vars.txt b/tests/fuzzing/dc_inputs/vars.txt
new file mode 100644
index 000000000000..bbe73b47d81f
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/vars.txt
@@ -0,0 +1,2 @@
+298734.8921702348sx_928374892.28937syzpRlxly+pR
+298734.8921702348S xotj _928374892.28937S yotp zpRl xotj l yotp-pRzpR L xotj L yotp-pR
diff --git a/tests/fuzzing/dc_inputs/weird.dc b/tests/fuzzing/dc_inputs/weird.dc
new file mode 100644
index 000000000000..391ec05d6282
--- /dev/null
+++ b/tests/fuzzing/dc_inputs/weird.dc
@@ -0,0 +1,2 @@
+#! /usr/bin/dc
+zp198202389.289374pzp[He World!]SzpzXfrfxzpfR
diff --git a/tests/other.sh b/tests/other.sh
new file mode 100755
index 000000000000..8c56e25d2395
--- /dev/null
+++ b/tests/other.sh
@@ -0,0 +1,271 @@
+#! /bin/sh
+#
+# SPDX-License-Identifier: BSD-2-Clause
+#
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice, this
+# list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+# POSSIBILITY OF SUCH DAMAGE.
+#
+
+set -e
+
+script="$0"
+testdir=$(dirname "$script")
+
+. "$testdir/../functions.sh"
+
+if [ "$#" -ge 1 ]; then
+ d="$1"
+ shift
+else
+ err_exit "usage: $script dir [exec args...]" 1
+fi
+
+if [ "$#" -lt 1 ]; then
+ exe="$testdir/../bin/$d"
+else
+ exe="$1"
+ shift
+fi
+
+if [ "$d" = "bc" ]; then
+ halt="quit"
+else
+ halt="q"
+fi
+
+num=100000000000000000000000000000000000000000000000000000000000000000000000000000
+numres="$num"
+num70="10000000000000000000000000000000000000000000000000000000000000000000\\
+0000000000"
+
+if [ "$d" = "bc" ]; then
+ halt="halt"
+ opt="x"
+ lopt="extended-register"
+ line_var="BC_LINE_LENGTH"
+else
+ halt="q"
+ opt="l"
+ lopt="mathlib"
+ line_var="DC_LINE_LENGTH"
+ num="$num pR"
+fi
+
+set +e
+
+printf '\nRunning %s quit test...' "$d"
+
+printf '%s\n' "$halt" | "$exe" "$@" > /dev/null 2>&1
+
+checktest_retcode "$d" "$?" "quit"
+
+if [ "$d" = bc ]; then
+
+ printf '%s\n' "quit" | "$exe" "$@" > /dev/null 2>&1
+
+ checktest_retcode "$d" "$?" quit
+
+ two=$("$exe" "$@" -e 1+1 -e quit)
+
+ checktest_retcode "$d" "$?" quit
+
+ if [ "$two" != "2" ]; then
+ err_exit "$d failed test quit" 1
+ fi
+fi
+
+printf 'pass\n'
+
+base=$(basename "$exe")
+
+if [ "$base" != "bc" -a "$base" != "dc" ]; then
+ exit 0
+fi
+
+printf 'Running %s environment var tests...' "$d"
+
+if [ "$d" = "bc" ]; then
+
+ export BC_ENV_ARGS=" '-l' '' -q"
+ export BC_EXPR_EXIT="1"
+
+ printf 's(.02893)\n' | "$exe" "$@" > /dev/null
+
+ checktest_retcode "$d" "$?" "environment var"
+
+ "$exe" -e 4 "$@" > /dev/null
+
+ err="$?"
+ checktest_retcode "$d" "$?" "environment var"
+else
+
+ export DC_ENV_ARGS="'-x'"
+ export DC_EXPR_EXIT="1"
+
+ printf '4s stuff\n' | "$exe" "$@" > /dev/null
+
+ checktest_retcode "$d" "$?" "environment var"
+
+ "$exe" -e 4pR "$@" > /dev/null
+
+ checktest_retcode "$d" "$?" "environment var"
+fi
+
+printf 'pass\n'
+
+out1="$testdir/../.log_$d.txt"
+out2="$testdir/../.log_${d}_test.txt"
+
+printf 'Running %s line length tests...' "$d"
+
+printf '%s\n' "$numres" > "$out1"
+
+export "$line_var"=80
+printf '%s\n' "$num" | "$exe" "$@" > "$out2"
+
+checktest "$d" "$?" "environment var" "$out1" "$out2"
+
+printf '%s\n' "$num70" > "$out1"
+
+export "$line_var"=2147483647
+printf '%s\n' "$num" | "$exe" "$@" > "$out2"
+
+checktest "$d" "$?" "environment var" "$out1" "$out2"
+
+printf 'pass\n'
+
+printf 'Running %s arg tests...' "$d"
+
+f="$testdir/$d/add.txt"
+exprs=$(cat "$f")
+results=$(cat "$testdir/$d/add_results.txt")
+
+printf '%s\n%s\n%s\n%s\n' "$results" "$results" "$results" "$results" > "$out1"
+
+"$exe" "$@" -e "$exprs" -f "$f" --expression "$exprs" --file "$f" -e "$halt" > "$out2"
+
+checktest "$d" "$?" "arg" "$out1" "$out2"
+
+printf '%s\n' "$halt" | "$exe" "$@" -- "$f" "$f" "$f" "$f" > "$out2"
+
+checktest "$d" "$?" "arg" "$out1" "$out2"
+
+if [ "$d" = "bc" ]; then
+ printf '%s\n' "$halt" | "$exe" "$@" -i > /dev/null 2>&1
+fi
+
+printf '%s\n' "$halt" | "$exe" "$@" -h > /dev/null
+checktest_retcode "$d" "$?" "arg"
+printf '%s\n' "$halt" | "$exe" "$@" -P > /dev/null
+checktest_retcode "$d" "$?" "arg"
+printf '%s\n' "$halt" | "$exe" "$@" -v > /dev/null
+checktest_retcode "$d" "$?" "arg"
+printf '%s\n' "$halt" | "$exe" "$@" -V > /dev/null
+checktest_retcode "$d" "$?" "arg"
+
+"$exe" "$@" -f "saotehasotnehasthistohntnsahxstnhalcrgxgrlpyasxtsaosysxsatnhoy.txt" > /dev/null 2> "$out2"
+err="$?"
+
+checkerrtest "$d" "$err" "invalid file argument" "$out2" "$d"
+
+"$exe" "$@" "-$opt" -e "$exprs" > /dev/null 2> "$out2"
+err="$?"
+
+checkerrtest "$d" "$err" "invalid option argument" "$out2" "$d"
+
+"$exe" "$@" "--$lopt" -e "$exprs" > /dev/null 2> "$out2"
+err="$?"
+
+checkerrtest "$d" "$err" "invalid long option argument" "$out2" "$d"
+
+"$exe" "$@" "-u" -e "$exprs" > /dev/null 2> "$out2"
+err="$?"
+
+checkerrtest "$d" "$err" "unrecognized option argument" "$out2" "$d"
+
+"$exe" "$@" "--uniform" -e "$exprs" > /dev/null 2> "$out2"
+err="$?"
+
+checkerrtest "$d" "$err" "unrecognized long option argument" "$out2" "$d"
+
+"$exe" "$@" -f > /dev/null 2> "$out2"
+err="$?"
+
+checkerrtest "$d" "$err" "missing required argument to short option" "$out2" "$d"
+
+"$exe" "$@" --file > /dev/null 2> "$out2"
+err="$?"
+
+checkerrtest "$d" "$err" "missing required argument to long option" "$out2" "$d"
+
+"$exe" "$@" --version=5 > /dev/null 2> "$out2"
+err="$?"
+
+checkerrtest "$d" "$err" "given argument to long option with no argument" "$out2" "$d"
+
+printf 'pass\n'
+
+printf 'Running %s directory test...' "$d"
+
+"$exe" "$@" "$testdir" > /dev/null 2> "$out2"
+err="$?"
+
+checkerrtest "$d" "$err" "directory" "$out2" "$d"
+
+printf 'pass\n'
+
+printf 'Running %s binary file test...' "$d"
+
+bin="/bin/sh"
+
+"$exe" "$@" "$bin" > /dev/null 2> "$out2"
+err="$?"
+
+checkerrtest "$d" "$err" "binary file" "$out2" "$d"
+
+printf 'pass\n'
+
+printf 'Running %s binary stdin test...' "$d"
+
+cat "$bin" | "$exe" "$@" > /dev/null 2> "$out2"
+err="$?"
+
+checkerrtest "$d" "$err" "binary stdin" "$out2" "$d"
+
+printf 'pass\n'
+
+if [ "$d" = "bc" ]; then
+
+ printf 'Running %s limits tests...' "$d"
+ printf 'limits\n' | "$exe" "$@" > "$out2" /dev/null 2>&1
+
+ checktest_retcode "$d" "$?" "limits"
+
+ if [ ! -s "$out2" ]; then
+ err_exit "$d did not produce output on the limits test" 1
+ fi
+
+ exec printf 'pass\n'
+
+fi
diff --git a/tests/radamsa.sh b/tests/radamsa.sh
index 537ee10255c3..236953ae888e 100755
--- a/tests/radamsa.sh
+++ b/tests/radamsa.sh
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
diff --git a/tests/randmath.py b/tests/randmath.py
index 7f14a345be3e..ca226324a8dc 100755
--- a/tests/randmath.py
+++ b/tests/randmath.py
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
diff --git a/tests/read.sh b/tests/read.sh
index 0440a078d36c..e9d306858ec3 100755
--- a/tests/read.sh
+++ b/tests/read.sh
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -57,7 +57,12 @@ name="$testdir/$d/read.txt"
results="$testdir/$d/read_results.txt"
errors="$testdir/$d/read_errors.txt"
-out="$testdir/../.log_${d}_test.txt"
+out="$testdir/${d}_outputs/read_results.txt"
+outdir=$(dirname "$out")
+
+if [ ! -d "$outdir" ]; then
+ mkdir -p "$outdir"
+fi
exebase=$(basename "$exe")
@@ -79,17 +84,17 @@ fi
printf 'Running %s read...' "$d"
+set +e
+
while read line; do
printf '%s\n%s\n' "$read_call" "$line" | "$exe" "$@" "$options" > "$out"
- diff "$results" "$out"
+ checktest "$d" "$?" 'read' "$results" "$out"
done < "$name"
printf 'pass\n'
-set +e
-
printf 'Running %s read errors...' "$d"
while read line; do
@@ -97,7 +102,7 @@ while read line; do
printf '%s\n%s\n' "$read_call" "$line" | "$exe" "$@" "$options" 2> "$out" > /dev/null
err="$?"
- checktest "$d" "$err" "$line" "$out" "$exebase"
+ checkerrtest "$d" "$err" "$line" "$out" "$exebase"
done < "$errors"
@@ -110,7 +115,7 @@ read_test=$(printf '%s\n' "$read_call")
printf '%s\n' "$read_test" | "$exe" "$@" "$opts" 2> "$out" > /dev/null
err="$?"
-checktest "$d" "$err" "$read_test" "$out" "$exebase"
+checkerrtest "$d" "$err" "$read_test" "$out" "$exebase"
printf 'pass\n'
@@ -121,6 +126,6 @@ read_test=$(printf '%s' "$read_call")
printf '%s' "$read_test" | "$exe" "$@" "$opts" 2> "$out" > /dev/null
err="$?"
-checktest "$d" "$err" "$read_test" "$out" "$exebase"
+checkerrtest "$d" "$err" "$read_test" "$out" "$exebase"
-printf 'pass\n'
+exec printf 'pass\n'
diff --git a/tests/script.sh b/tests/script.sh
index 279295829f75..acd68f6d9bc3 100755
--- a/tests/script.sh
+++ b/tests/script.sh
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -33,6 +33,8 @@ script="$0"
testdir=$(dirname "${script}")
+. "$testdir/../functions.sh"
+
if [ "$#" -lt 2 ]; then
printf 'usage: %s dir script [run_extra_tests] [run_stack_tests] [generate_tests] [time_tests] [exec args...]\n' "$script"
exit 1
@@ -79,8 +81,6 @@ else
exe="$testdir/../bin/$d"
fi
-out="$testdir/../.log_${d}_test.txt"
-
if [ "$d" = "bc" ]; then
if [ "$run_stack_tests" -ne 0 ]; then
@@ -120,6 +120,18 @@ if [ "$run_stack_tests" -eq 0 ]; then
fi
+out="$testdir/${d}_outputs/${name}_script_results.txt"
+outdir=$(dirname "$out")
+
+if [ ! -d "$outdir" ]; then
+ mkdir -p "$outdir"
+fi
+
+unset BC_ENV_ARGS
+unset BC_LINE_LENGTH
+unset DC_ENV_ARGS
+unset DC_LINE_LENGTH
+
s="$scriptdir/$f"
orig="$testdir/$name.txt"
results="$scriptdir/$name.txt"
@@ -138,18 +150,22 @@ else
res="$results"
fi
+set +e
+
printf 'Running %s script %s...' "$d" "$f"
if [ "$time_tests" -ne 0 ]; then
printf '\n'
printf '%s\n' "$halt" | /usr/bin/time -p "$exe" "$@" $options "$s" > "$out"
+ err="$?"
printf '\n'
else
printf '%s\n' "$halt" | "$exe" "$@" $options "$s" > "$out"
+ err="$?"
fi
-diff "$res" "$out"
+checktest "$d" "$err" "script $f" "$res" "$out"
rm -f "$out"
-printf 'pass\n'
+exec printf 'pass\n'
diff --git a/tests/scripts.sh b/tests/scripts.sh
index ff17260c909c..a0415ec7fffb 100755
--- a/tests/scripts.sh
+++ b/tests/scripts.sh
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -78,9 +78,12 @@ fi
scriptdir="$testdir/$d/scripts"
-for s in $scriptdir/*.$d; do
+scripts=$(cat "$scriptdir/all.txt")
+
+for s in $scripts; do
f=$(basename "$s")
- sh "$testdir/script.sh" "$d" "$f" "$run_extra_tests" "$run_stack_tests" "$generate" "$time_tests" "$exe" "$@"
+ sh "$testdir/script.sh" "$d" "$f" "$run_extra_tests" "$run_stack_tests" \
+ "$generate" "$time_tests" "$exe" "$@"
done
diff --git a/tests/stdin.sh b/tests/stdin.sh
index f66019d5ae65..581a6df52d73 100755
--- a/tests/stdin.sh
+++ b/tests/stdin.sh
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -33,6 +33,8 @@ script="$0"
testdir=$(dirname "$script")
+. "$testdir/../functions.sh"
+
if [ "$#" -lt 1 ]; then
printf 'usage: %s dir [exe [args...]]\n' "$0"
printf 'valid dirs are:\n'
@@ -52,7 +54,12 @@ else
exe="$testdir/../bin/$d"
fi
-out="$testdir/../.log_${d}_test.txt"
+out="$testdir/${d}_outputs/stdin_results.txt"
+outdir=$(dirname "$out")
+
+if [ ! -d "$outdir" ]; then
+ mkdir -p "$outdir"
+fi
if [ "$d" = "bc" ]; then
options="-ilq"
@@ -62,20 +69,22 @@ fi
rm -f "$out"
+set +e
+
printf 'Running %s stdin tests...' "$d"
cat "$testdir/$d/stdin.txt" | "$exe" "$@" "$options" > "$out" 2> /dev/null
-diff "$testdir/$d/stdin_results.txt" "$out"
+checktest "$d" "$?" "stdin" "$testdir/$d/stdin_results.txt" "$out"
if [ "$d" = "bc" ]; then
cat "$testdir/$d/stdin1.txt" | "$exe" "$@" "$options" > "$out" 2> /dev/null
- diff "$testdir/$d/stdin1_results.txt" "$out"
+ checktest "$d" "$?" "stdin" "$testdir/$d/stdin1_results.txt" "$out"
cat "$testdir/$d/stdin2.txt" | "$exe" "$@" "$options" > "$out" 2> /dev/null
- diff "$testdir/$d/stdin2_results.txt" "$out"
+ checktest "$d" "$?" "stdin" "$testdir/$d/stdin2_results.txt" "$out"
fi
-rm -f "$out1"
+rm -f "$out"
-printf 'pass\n'
+exec printf 'pass\n'
diff --git a/tests/test.sh b/tests/test.sh
index 20f95413597b..c6c4cc250ba3 100755
--- a/tests/test.sh
+++ b/tests/test.sh
@@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: BSD-2-Clause
#
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
@@ -33,6 +33,8 @@ script="$0"
testdir=$(dirname "$script")
+. "$testdir/../functions.sh"
+
if [ "$#" -lt 2 ]; then
printf 'usage: %s dir test [generate_tests] [time_tests] [exe [args...]]\n' "$0"
printf 'valid dirs are:\n'
@@ -71,7 +73,17 @@ else
exe="$testdir/../bin/$d"
fi
-out="$testdir/../.log_${d}_test.txt"
+out="$testdir/${d}_outputs/${t}_results.txt"
+outdir=$(dirname "$out")
+
+if [ ! -d "$outdir" ]; then
+ mkdir -p "$outdir"
+fi
+
+unset BC_ENV_ARGS
+unset BC_LINE_LENGTH
+unset DC_ENV_ARGS
+unset DC_LINE_LENGTH
if [ "$d" = "bc" ]; then
options="-lq"
@@ -83,14 +95,6 @@ else
halt="q"
fi
-if [ "${exe#*toybox}" != "$exe" -o "${exe#*busybox}" != "$exe" ]; then
- if [ "$t" = "print2" -o "$t" = "misc4" ]; then
- base=$(basename "$exe")
- printf 'Skipping %s test for %s...\n' "$t" "$base"
- exit 0
- fi
-fi
-
if [ ! -f "$name" ]; then
if [ "$generate_tests" -eq 0 ]; then
@@ -115,18 +119,22 @@ fi
export $var=string
+set +e
+
printf 'Running %s %s...' "$d" "$t"
if [ "$time_tests" -ne 0 ]; then
printf '\n'
printf '%s\n' "$halt" | /usr/bin/time -p "$exe" "$@" $options "$name" > "$out"
+ err="$?"
printf '\n'
else
printf '%s\n' "$halt" | "$exe" "$@" $options "$name" > "$out"
+ err="$?"
fi
-diff "$results" "$out"
+checktest "$d" "$err" "$t" "$results" "$out"
rm -f "$out"
-printf 'pass\n'
+exec printf 'pass\n'