aboutsummaryrefslogtreecommitdiff
path: root/testsuite/bc_array.bc
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-12-12 21:41:40 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-12-12 21:41:40 +0100
commit9a23b07c4c0d06c40d7c0ce91c5fdf7c8449ac49 (patch)
tree9b1a85084b1e046b0a5b5eb06375334ef1eb2f56 /testsuite/bc_array.bc
parentd6ad3666dc51f475a6e76b07f2c59d039f69f2d4 (diff)
downloadbusybox-w32-9a23b07c4c0d06c40d7c0ce91c5fdf7c8449ac49.tar.gz
busybox-w32-9a23b07c4c0d06c40d7c0ce91c5fdf7c8449ac49.tar.bz2
busybox-w32-9a23b07c4c0d06c40d7c0ce91c5fdf7c8449ac49.zip
testsuite: add bc and dc tests
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite/bc_array.bc')
-rw-r--r--testsuite/bc_array.bc35
1 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/bc_array.bc b/testsuite/bc_array.bc
new file mode 100644
index 000000000..3bb680178
--- /dev/null
+++ b/testsuite/bc_array.bc
@@ -0,0 +1,35 @@
1#! /usr/bin/bc -q
2
3define z(a[]) {
4 for (i = 0; i < l; ++i) {
5 a[i]
6 }
7}
8
9define x(a[]) {
10
11 for (i = 0; i < l; ++i) {
12 a[i] = -i
13 }
14
15 z(a[])
16}
17
18for (i = 0; i < 101; ++i) {
19 a[i] = i
20}
21
22a[104] = 204
23
24l = length(a[])
25
26for (i = 0; i <= l; ++i) {
27 a[i]
28}
29
30z(a[])
31x(a[])
32z(a[])
33l
34
35halt