aboutsummaryrefslogtreecommitdiff
path: root/contrib/bc/tests/bc/scripts/array2.bc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bc/tests/bc/scripts/array2.bc')
-rw-r--r--contrib/bc/tests/bc/scripts/array2.bc20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/bc/tests/bc/scripts/array2.bc b/contrib/bc/tests/bc/scripts/array2.bc
new file mode 100644
index 000000000000..34d88c3e276b
--- /dev/null
+++ b/contrib/bc/tests/bc/scripts/array2.bc
@@ -0,0 +1,20 @@
+#! /usr/bin/bc -q
+
+define z(x, a[]) {
+ return x + a[1]
+}
+
+define y(x, *b[]) {
+ return x + b[1]
+}
+
+a[0] = 5
+a[1] = 6
+
+b[0] = 8
+b[1] = 7
+
+z(a[0], b[])
+y(b[0], a[])
+
+halt