diff options
Diffstat (limited to 'testsuite/bc_array.bc')
-rw-r--r-- | testsuite/bc_array.bc | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/bc_array.bc b/testsuite/bc_array.bc new file mode 100644 index 0000000..3bb6801 --- /dev/null +++ b/testsuite/bc_array.bc @@ -0,0 +1,35 @@ +#! /usr/bin/bc -q + +define z(a[]) { + for (i = 0; i < l; ++i) { + a[i] + } +} + +define x(a[]) { + + for (i = 0; i < l; ++i) { + a[i] = -i + } + + z(a[]) +} + +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 + +halt |