diff options
Diffstat (limited to 'contrib/bc/Test/arrayp.b')
-rw-r--r-- | contrib/bc/Test/arrayp.b | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/contrib/bc/Test/arrayp.b b/contrib/bc/Test/arrayp.b new file mode 100644 index 0000000..3f3ca50 --- /dev/null +++ b/contrib/bc/Test/arrayp.b @@ -0,0 +1,30 @@ +"This tests arrays! +" +define p(a[],x,y) { + auto i; + for (i=x; i<y; i++) a[i]; +} + +define m(a[],x,y) { + auto i; + for (i=x; i<y; i++) a[i] = i; +} + +define m1(*a[],x,y) { + auto i; + print "m1\n" + for (i=x; i<y; i++) a[i] = i; +} + +for (i=0; i<10; i++) a[i] = i; +j = p(a[],0,10); + +j = m(b[],0,10); +j = p(b[],0,10); + +print "---\n"; +j = m1(b[],0,10); +j = p(b[],0,10); + +quit + |