Ticket #1399: array_unshift_test.pir

File array_unshift_test.pir, 0.5 KB (added by plobsing, 5 years ago)

simple PIR file demonstrating the issue

Line 
1# Copyright (C) 2006-2009, Parrot Foundation.
2# $Id$
3
4.sub 'main' :main
5    .local pmc array
6    .local pmc elt
7    .local int i
8    .local int max
9
10    max = 100000
11    array = new ['Array']
12    # array = max
13    i = 0
14  loop:
15    elt = new ['Integer']
16    elt = i
17    unshift array, elt
18    inc i
19    if i <= max goto loop
20
21    i = 0
22  loop2:
23    elt = array[i]
24    print i
25    print ": "
26    say elt
27    inc i
28    if i <= max goto loop2
29.end
30
31# Local Variables:
32#   mode: pir
33#   fill-column: 100
34# End:
35# vim: expandtab shiftwidth=4 ft=pir:
36