summaryrefslogtreecommitdiff
path: root/src/test/java/com/seaofnodes/simple/spill/Chapter21AllocTest-testArray1.smp
blob: 6b10f92cb8067007b7552d655d0dd9e224ee13f5 (plain)
1
2
3
4
5
6
7
8
9
// -*- mode: java;  -*-
int[] !ary = new int[arg];
// Fill [0,1,2,3,4,...]
for( int i=0; i<ary#; i++ )
    ary[i] = i;
// Fill [0,1,3,6,10,...]
for( int i=0; i<ary#-1; i++ )
    ary[i+1] += ary[i];
return ary[1] * 1000 + ary[3]; // 1 * 1000 + 6