summaryrefslogtreecommitdiffstats
path: root/contrib/bc/Test/arrayp.b
blob: 3f3ca505c9587b915a4e5e9a8f37573510f7a3f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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

OpenPOWER on IntegriCloud