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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
#!perl
# Copyright (C) 2005, Parrot Foundation.
use strict;
use warnings;
use lib qw( . lib ../lib ../../lib );
use Parrot::Test tests => 4;
# these tests are run with -O0 by TestCompiler and show
# generated PASM code for various optimizations at level 0
pir_2_pasm_is( <<'CODE', <<'OUT', "sub_n_ic_n" );
.sub _ :anon
sub $N0, 2, $N1
div $N0, 2, $N1
.end
CODE
# IMCC does produce b0rken PASM files
# see http://guest@rt.perl.org/rt3/Ticket/Display.html?id=32392
_:
sub N0, 2, N1
div N0, 2, N1
set_returns
returncc
OUT
##############################
pir_2_pasm_is( <<'CODE', <<'OUT', "added return - end" );
.sub _test
noop
end
.end
CODE
# IMCC does produce b0rken PASM files
# see http://guest@rt.perl.org/rt3/Ticket/Display.html?id=32392
_test:
noop
end
OUT
##############################
pir_2_pasm_is( <<'CODE', <<'OUT', "added return - exit" );
.sub _test
noop
exit 0
.end
CODE
# IMCC does produce b0rken PASM files
# see http://guest@rt.perl.org/rt3/Ticket/Display.html?id=32392
_test:
noop
exit 0
OUT
##############################
pir_2_pasm_is( <<'CODE', <<'OUT', "added return - nil" );
.sub _test
noop
.end
CODE
# IMCC does produce b0rken PASM files
# see http://guest@rt.perl.org/rt3/Ticket/Display.html?id=32392
_test:
noop
set_returns
returncc
OUT
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4:
|