~dexter/parrot-pkg/maverick

« back to all changes in this revision

Viewing changes to t/compilers/imcc/reg/alloc.t

  • Committer: Piotr Roszatycki
  • Date: 2011-01-11 14:34:28 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: piotr.roszatycki@gmail.com-20110111143428-s7pa7qz38m61o4tw
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!perl
2
2
# Copyright (C) 2005-2008, Parrot Foundation.
3
 
# $Id: alloc.t 37201 2009-03-08 12:07:48Z fperrad $
4
3
 
5
4
use strict;
6
5
use warnings;
7
6
use lib qw( . lib ../lib ../../lib );
8
 
use Parrot::Test tests => 11;
 
7
use Parrot::Test tests => 10;
9
8
 
10
9
pir_output_is( <<'CODE', <<'OUT', "alligator" );
11
 
# if the side-effect of set_addr/continuation isn't
 
10
# if the side-effect of set_label/continuation isn't
12
11
# detected this program prints "Hi\nalligator\n"
13
12
 
14
13
.sub main :main
20
19
    dec $I0
21
20
    unless $I0 goto ex
22
21
    new $P1, 'Continuation'
23
 
    set_addr $P1, lab
 
22
    set_label $P1, lab
24
23
    $P2 = find_name "alligator"
25
24
    set_args "0", $P1
26
25
    invokecc $P2
63
62
def
64
63
OUT
65
64
 
66
 
pir_2_pasm_is( <<'CODE', <<'OUT', ":unique_reg" );
67
 
.sub main
68
 
    .param int i :unique_reg
69
 
    .local int j :unique_reg
70
 
    .local int k :unique_reg
71
 
    i = 5
72
 
    j = 2
73
 
    k = j * 2
74
 
.end
75
 
CODE
76
 
# IMCC does produce b0rken PASM files
77
 
# see http://guest@rt.perl.org/rt3/Ticket/Display.html?id=32392
78
 
main:
79
 
        get_params
80
 
        set I0, 5
81
 
        set I1, 2
82
 
        mul I2, I1, 2
83
 
        set_returns
84
 
        returncc
85
 
OUT
86
 
 
87
65
pir_output_is( <<'CODE', <<'OUT', "Explicit large register: S, PIR" );
88
66
.sub main
89
67
  $S32 = "ok\n"