Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Some fiddling with test suite:

- imcc/t/harness removed, had been obsolete for some time
- Get rid of imcc/TestCompiler.pm, let Parrot::Test do the work
- PIR test code is now run with the 'pir_output_*' test functions
- No longer use the '##PIR##' preample for PIR test code
- Check generation of PASM from PIR with the 'pir_2_pasm_*' test functions.
- Add test functions 'pasm_output_*', the 'output_*' functions still work for PASM
- more often use pragma @MAIN in PIR test code
- add copyright notices
- add CVS $Id$ macros
- get started with support for "make testexec" in Parrot::Test.pm
- update 'docs/tests.pod'


git-svn-id: https://svn.parrot.org/parrot/trunk@7594 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit b38c8aa80da6dda324b883ae17afe5bd1989ff8e 1 parent 807a649
Bernhard Schmalhofer bschmalhofer authored
Showing with 1,360 additions and 1,416 deletions.
  1. +0 −2  MANIFEST
  2. +3 −9 docs/tests.pod
  3. +6 −0 imcc/ChangeLog
  4. +0 −128 imcc/TestCompiler.pm
  5. +0 −47 imcc/t/harness
  6. +7 −5 imcc/t/imcpasm/cfg.t
  7. +10 −9 imcc/t/imcpasm/opt0.t
  8. +53 −50 imcc/t/imcpasm/opt1.t
  9. +9 −6 imcc/t/imcpasm/opt2.t
  10. +10 −7 imcc/t/imcpasm/optc.t
  11. +15 −12 imcc/t/imcpasm/pcc.t
  12. +6 −3 imcc/t/imcpasm/sub.t
  13. +24 −20 imcc/t/reg/spill.t
  14. +31 −30 imcc/t/syn/bsr.t
  15. +35 −33 imcc/t/syn/clash.t
  16. +10 −11 imcc/t/syn/const.t
  17. +19 −16 imcc/t/syn/eval.t
  18. +19 −19 imcc/t/syn/file.t
  19. +7 −4 imcc/t/syn/keyed.t
  20. +14 −11 imcc/t/syn/labels.t
  21. +51 −50 imcc/t/syn/macro.t
  22. +8 −5 imcc/t/syn/namespace.t
  23. +27 −24 imcc/t/syn/objects.t
  24. +46 −43 imcc/t/syn/op.t
  25. +73 −69 imcc/t/syn/pcc.t
  26. +11 −8 imcc/t/syn/pod.t
  27. +7 −4 imcc/t/syn/scope.t
  28. +7 −4 imcc/t/syn/tail.t
  29. +310 −237 lib/Parrot/Test.pm
  30. +14 −16 t/dynclass/gdbmhash.t
  31. +10 −10 t/dynclass/pybuiltin.t
  32. +12 −12 t/dynclass/pyclass.t
  33. +2 −2 t/dynclass/pycomplex.t
  34. +5 −5 t/dynclass/pyfunc.t
  35. +50 −50 t/dynclass/pyint.t
  36. +14 −18 t/harness
  37. +32 −32 t/library/dumper.t
  38. +6 −7 t/library/parrotlib.t
  39. +6 −6 t/library/pge.t
  40. +18 −18 t/library/sort.t
  41. +26 −26 t/library/streams.t
  42. +8 −8 t/op/basic.t
  43. +4 −4 t/op/gc.t
  44. +2 −2 t/op/jitn.t
  45. +2 −2 t/op/string.t
  46. +2 −2 t/pmc/array.t
  47. +2 −2 t/pmc/bigint.t
  48. +2 −2 t/pmc/boolean.t
  49. +8 −8 t/pmc/complex.t
  50. +8 −8 t/pmc/coroutine.t
  51. +2 −2 t/pmc/env.t
  52. +8 −8 t/pmc/eval.t
  53. +2 −2 t/pmc/exception.t
  54. +2 −2 t/pmc/fixedbooleanarray.t
  55. +2 −2 t/pmc/fixedfloatarray.t
  56. +2 −2 t/pmc/fixedintegerarray.t
  57. +6 −6 t/pmc/fixedpmcarray.t
  58. +2 −2 t/pmc/fixedstringarray.t
  59. +14 −14 t/pmc/float.t
  60. +2 −2 t/pmc/floatvalarray.t
  61. +8 −8 t/pmc/hash.t
  62. +18 −18 t/pmc/integer.t
  63. +2 −2 t/pmc/intlist.t
  64. +6 −6 t/pmc/io.t
  65. +16 −16 t/pmc/iter.t
  66. +4 −4 t/pmc/managedstruct.t
  67. +14 −14 t/pmc/mmd.t
  68. +2 −2 t/pmc/multiarray.t
  69. +43 −43 t/pmc/nci.t
  70. +14 −14 t/pmc/object-meths.t
  71. +22 −22 t/pmc/objects.t
  72. +16 −16 t/pmc/orderedhash.t
  73. +2 −2 t/pmc/perlarray.t
  74. +8 −8 t/pmc/perlhash.t
  75. +4 −4 t/pmc/perlint.t
  76. +14 −14 t/pmc/perlnum.t
  77. +4 −4 t/pmc/perlstring.t
  78. +2 −2 t/pmc/ref.t
  79. +4 −4 t/pmc/resizablebooleanarray.t
  80. +4 −4 t/pmc/resizablefloatarray.t
  81. +4 −4 t/pmc/resizableintegerarray.t
  82. +12 −12 t/pmc/resizablepmcarray.t
  83. +4 −4 t/pmc/resizablestringarray.t
  84. +2 −2 t/pmc/sarray.t
  85. +2 −2 t/pmc/string.t
  86. +12 −13 t/pmc/sub.t
  87. +2 −2 t/pmc/sys.t
  88. +2 −2 t/pmc/threads.t
  89. +2 −2 t/pmc/timer.t
  90. +18 −18 t/pmc/undef.t
2  MANIFEST
View
@@ -1800,7 +1800,6 @@ icu/source/tools/toolutil/uperf.h [icu]
icu/source/tools/toolutil/utimer.h [icu]
imcc/ChangeLog [main]doc
imcc/README [main]doc
-imcc/TestCompiler.pm [devel]
imcc/cfg.c []
imcc/cfg.h []
imcc/class.c []
@@ -1850,7 +1849,6 @@ imcc/symbol.c []
imcc/symbol.h []
imcc/symreg.c []
imcc/symreg.h []
-imcc/t/harness []
imcc/t/imcpasm/cfg.t []
imcc/t/imcpasm/opt0.t []
imcc/t/imcpasm/opt1.t []
12 docs/tests.pod
View
@@ -1,4 +1,4 @@
-# Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
+# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved.
# $Id$
=head1 NAME
@@ -32,7 +32,7 @@ by:
2. Putting some code in like this:
- output_is(<<'CODE', <<'OUTPUT', "name for test");
+ pasm_output_is(<<'CODE', <<'OUTPUT', "name for test");
*** a big chunk of assembler, eg:
print 1
print "\n" # you can even comment it if it's obscure
@@ -44,13 +44,7 @@ by:
Tests in F<t/op/> or F<t/pmc/> are considered to be B<PASM> tests.
Tests in F<imcc/t/> are assumed to be B<PIR> tests. You can put B<PIR>
-tests into F<t/op/> or F<t/pmc/> by inserting the special comment B<##PIR##>
-in the test code:
-
- output_is(<<'CODE', <<'OUTPUT', "name for test");
- ##PIR##
- $P0 = new Integer
- ...
+tests into F<t/op/> or F<t/pmc/> by using functions like 'pir_output_is'.
=head2 C source tests
6 imcc/ChangeLog
View
@@ -1,3 +1,9 @@
+# Copyright: 2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
+- 2003-11-03 Bernhard Schmalhofer
+ * Migrate TestCompiler.pm to Parrot/Test.pm
+
- 2003-11-03 melvin
* move register allocation and spill related code to reg_alloc.c
* cleanup some routine names
128 imcc/TestCompiler.pm
View
@@ -1,128 +0,0 @@
-package TestCompiler;
-use strict;
-use vars qw(@EXPORT @ISA);
-use Parrot::Config;
-require Exporter;
-require Test::Builder;
-require Test::More;
-require Parrot::Test;
-
-@EXPORT = ( qw(skip) );
-@ISA = qw(Exporter);
-
-my $Builder = Test::Builder->new;
-
-$| = 1;
-
-*skip = \&Test::More::skip;
-
-sub import {
- my( $class, $plan, @args ) = @_;
- $Builder->plan( $plan, @args );
-
- __PACKAGE__->export_to_level( 2, __PACKAGE__ );
-}
-
-sub per_test {
- my ($ext,$count) = @_;
- my $t = $0;
- $t =~ s/\.t$/_$count$ext/;
- return $t;
-}
-# Map the Parrot::Test function to a Test::Builder method.
-my %Test_Map = ( output_is => 'is_eq',
- output_isnt => 'isnt_eq',
- output_like => 'like'
- );
-
-my $count = 0;
-
-sub generate_functions {
- my ($package) = @_;
-
- sub slurp_file {
- open SLURP, "< $_[0]";
- local $/ = undef;
- my $file = <SLURP> . '';
- $file =~ s/\cM\cJ/\n/g;
- $file =~ s/^\s*$//gm if ($_[1]);
- $file =~ s/[\t ]+/ /gm if ($_[1]);
- $file =~ s/[\t ]+$//gm if ($_[1]);
- close SLURP;
- return $file;
- }
-
- foreach my $func ( keys %Test_Map ) {
- no strict 'refs';
-
- *{$package.'::'.$func} = sub ($$;$) {
- my( $assembly, $output, $desc ) = @_;
-
- $count++;
-
- #set up default description
- (undef, my $file, my $line) = caller;
- unless ($desc) {
- $desc = "($file line $line)";
- }
-
- my $s = $PConfig{slash};
- my $rxs = $s;
- $rxs =~ s,\\,\\\\,;
-
- my $by_f = per_test('.imc',$count);
- my $gen_pasm;
- $gen_pasm = 1 if ($by_f =~ m!${rxs}imcpasm${rxs}!);
- my $opt = '';
- $opt = "-O$1" if ($by_f =~ m!${rxs}imcpasm${rxs}opt(.)!);
- $opt = "-O1" if ($by_f =~ m!${rxs}imcpasm${rxs}cfg!);
- $output =~ s/\cM\cJ/\n/g;
- if ($gen_pasm) {
- $output =~ s/^\s*$//gm;
- $output =~ s/[\t ]+/ /gm;
- $output =~ s/[\t ]+$//gm;
- }
-
- open IM, "> $by_f" or die "Unable to open '$by_f'";
- print IM $assembly;
- close IM;
-
- my $out_f = per_test('.out',$count);
-
- my $TEST_PROG_ARGS = $ENV{TEST_PROG_ARGS} || '';
- my $exe = $PConfig{exe};
- #my $PARROT = $ENV{PARROT} || "..${s}parrot$exe"; # XXX
- my $PARROT = $ENV{PARROT} || ".${s}parrot$exe"; # XXX
-
- if ($gen_pasm) {
- system("$PARROT $opt -o $out_f $by_f");
- }
- elsif ($TEST_PROG_ARGS =~ /-r /) {
- my $pbc_f = per_test('.pbc',$count);
- $TEST_PROG_ARGS =~ s/--run-pbc / /;
- $TEST_PROG_ARGS =~ s/-r/ /;
- Parrot::Test::_run_command("$PARROT ${TEST_PROG_ARGS} -o $pbc_f -r $by_f",
- STDOUT => $out_f, STDERR => $out_f);
- }
- else {
- Parrot::Test::_run_command("$PARROT ${TEST_PROG_ARGS} $by_f",
- STDOUT => $out_f, STDERR => $out_f);
- }
-
- my $meth = $Test_Map{$func};
- my $pass = $Builder->$meth( slurp_file($out_f, $gen_pasm),
- $output, $desc );
-
- unless($ENV{POSTMORTEM}) {
- unlink $out_f;
- }
-
- return $pass;
- }
- }
-}
-
-generate_functions(caller);
-
-# vim:set sw=4:
-1;
47 imcc/t/harness
View
@@ -1,47 +0,0 @@
-#! perl -w
-# $Id$
-
-#Blatantly stolen from parrot/t/harness by Mike Lambert
-#Then blatantly stolen from perl6/t/harness by leo ;-)
-
-use strict;
-use lib '../lib';
-use Test::Harness qw(runtests);
-
-#
-# Suck the switches into the TEST_PROG_ARGS evar:
-#
-
-die "This file was thought to be obsolete by Bernhard Schmalhofer";
-
-use Getopt::Std;
-my %opts;
-getopts('wgjPSbvdr?hO:', \%opts);
-if ($opts{'?'} || $opts{h}) {
- print <<"EOF";
-perl t/harness [options] [testfiles]
- -w ... warnings on
- -g ... disable CGoto
- -j ... run JIT
- -P ... run Prederef or CGP
- -S ... run Switched
- -b ... run bounds checked
- -v ... run verbose
- -d ... run debug
- -r ... assemble to PBC run PBC
- -O[012] optimize
-EOF
- exit;
-}
-
-my $args = join(' ', map { "-$_" } keys %opts );
-$args =~ s/-O/-O$opts{O}/ if ($opts{O});
-
-$ENV{TEST_PROG_ARGS} = $args;
-
-$ENV{PARROT_QUICKTEST} = grep $_ eq 'quick', @ARGV;
-@ARGV = grep $_ ne 'quick', @ARGV;
-
-# Pass in a list of tests to run on the command line, else run all the tests.
-my @tests = @ARGV ? @ARGV : glob( "t/*/*.t" );
-runtests(@tests);
12 imcc/t/imcpasm/cfg.t
View
@@ -1,9 +1,11 @@
#!perl
+# Copyright: 2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 3;
+use Parrot::Test tests => 3;
-##############################
-output_is(<<'CODE', <<'OUT', "unreachable 1");
+pir_2_pasm_is(<<'CODE', <<'OUT', "unreachable 1");
.sub _test
bsr L
print "ok\n"
@@ -23,7 +25,7 @@ L:
ret
OUT
-output_is(<<'CODE', <<'OUT', "unreachable 2");
+pir_2_pasm_is(<<'CODE', <<'OUT', "unreachable 2");
.sub _test
print "ok\n"
end
@@ -36,7 +38,7 @@ _test:
end
OUT
-output_is(<<'CODE', <<'OUT', "unreachable 3");
+pir_2_pasm_is(<<'CODE', <<'OUT', "unreachable 3");
.sub _test
goto L
print "ok\n"
19 imcc/t/imcpasm/opt0.t
View
@@ -1,12 +1,13 @@
#!perl
+# Copyright: 2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 6;
+use Parrot::Test tests => 6;
# these tests are run with -O0 by TestCompiler and show
# generated PASM code for various optimizations at level 0
-
-##############################
-output_like(<<'CODE', <<'OUT', "add_n_i_n");
+pir_2_pasm_like(<<'CODE', <<'OUT', "add_n_i_n");
.emit
add N0, I0, N1
mul N0, I0, N1
@@ -19,7 +20,7 @@ CODE
OUT
##############################
-output_is(<<'CODE', <<'OUT', "sub_n_ic_n");
+pir_2_pasm_is(<<'CODE', <<'OUT', "sub_n_ic_n");
.emit
sub N0, 2, N1
div N0, 2, N1
@@ -30,7 +31,7 @@ CODE
OUT
##############################
-output_like(<<'CODE', <<'OUT', "sub_n_i_n");
+pir_2_pasm_like(<<'CODE', <<'OUT', "sub_n_i_n");
.sub _test
sub N0, I0, N1
div N0, I0, N1
@@ -47,7 +48,7 @@ CODE
OUT
##############################
-output_is(<<'CODE', <<'OUT', "added return - end");
+pir_2_pasm_is(<<'CODE', <<'OUT', "added return - end");
.sub _test
noop
end
@@ -59,7 +60,7 @@ _test:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "added return - exit");
+pir_2_pasm_is(<<'CODE', <<'OUT', "added return - exit");
.sub _test
noop
exit 0
@@ -71,7 +72,7 @@ _test:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "added return - nil");
+pir_2_pasm_is(<<'CODE', <<'OUT', "added return - nil");
.sub _test
noop
.end
103 imcc/t/imcpasm/opt1.t
View
@@ -1,12 +1,15 @@
#!perl
+# Copyright: 2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 49;
+use Parrot::Test tests => 49;
# these tests are run with -O1 by TestCompiler and show
# generated PASM code for various optimizations at level 1
##############################
-output_is(<<'CODE', <<'OUT', "branch opt if");
+pir_2_pasm_is(<<'CODE', <<'OUT', "branch opt if");
.sub _main
if I0 goto L1
branch L2
@@ -22,7 +25,7 @@ L2:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "branch opt gt");
+pir_2_pasm_is(<<'CODE', <<'OUT', "branch opt gt");
.sub _main
if I0 > 1 goto L1
branch L2
@@ -38,7 +41,7 @@ L2:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "unreachable 3");
+pir_2_pasm_is(<<'CODE', <<'OUT', "unreachable 3");
.sub _test
goto L
print "ok\n"
@@ -53,7 +56,7 @@ _test:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "unused local label");
+pir_2_pasm_is(<<'CODE', <<'OUT', "unused local label");
.sub _main
branch L2
L2: end
@@ -64,7 +67,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "unused global label");
+pir_2_pasm_is(<<'CODE', <<'OUT', "unused global label");
.sub _main
branch _L2
_L2: end
@@ -76,7 +79,7 @@ _L2:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "branch_branch and dead code");
+pir_2_pasm_is(<<'CODE', <<'OUT', "branch_branch and dead code");
.sub _test
goto l1
l2:
@@ -98,7 +101,7 @@ _test:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant add");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant add");
.sub _main
add I0, 10, 15
add N0, 10.0, 15.0
@@ -112,7 +115,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant sub");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant sub");
.sub _main
sub I0, 10, 15
sub N0, 10.0, 15.0
@@ -126,7 +129,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant mul");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant mul");
.sub _main
mul I0, 10, 15
mul N0, 10.0, 15.0
@@ -140,7 +143,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant div");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant div");
.sub _main
div I0, 10, 5
div N0, 10.0, 5.0
@@ -154,7 +157,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant cmod");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant cmod");
.sub _main
cmod I0, 33, 10
cmod N0, 33.0, 10.0
@@ -168,7 +171,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant mod");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant mod");
.sub _main
mod I0, 33, 10
mod N0, 33.0, 10.0
@@ -182,7 +185,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant eq taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant eq taken");
.sub _main
eq 10, 10, L1
set I0, 5
@@ -194,7 +197,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant eq not taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant eq not taken");
.sub _main
eq 10, 20, L1
set I0, 5
@@ -207,7 +210,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant eq taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant eq taken");
.sub _main
eq 10.0, 10.0, L1
set I0, 5
@@ -219,7 +222,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant eq not taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant eq not taken");
.sub _main
eq 10.0, 20.0, L1
set I0, 5
@@ -232,7 +235,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant eq taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant eq taken");
.sub _main
eq "xy", "xy", L1
set I0, 5
@@ -244,7 +247,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant eq not taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant eq not taken");
.sub _main
eq "ab", "ba", L1
set I0, 5
@@ -257,7 +260,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant ne taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant ne taken");
.sub _main
ne 10, 20, L1
set I0, 5
@@ -269,7 +272,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant ne not taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant ne not taken");
.sub _main
ne 10, 10, L1
set I0, 5
@@ -282,7 +285,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant gt taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant gt taken");
.sub _main
gt "xy", "ap", L1
set I0, 5
@@ -294,7 +297,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant gt not taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant gt not taken");
.sub _main
gt "ab", "ba", L1
set I0, 5
@@ -307,7 +310,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant ge taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant ge taken");
.sub _main
ge "xy", "xy", L1
set I0, 5
@@ -319,7 +322,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant ge not taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant ge not taken");
.sub _main
gt "ab", "ba", L1
set I0, 5
@@ -332,7 +335,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant lt taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant lt taken");
.sub _main
lt "xx", "xy", L1
set I0, 5
@@ -344,7 +347,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant lt not taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant lt not taken");
.sub _main
lt "ba", "ba", L1
set I0, 5
@@ -357,7 +360,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant le taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant le taken");
.sub _main
le "xy", "xy", L1
set I0, 5
@@ -369,7 +372,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant le not taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant le not taken");
.sub _main
le "bb", "ba", L1
set I0, 5
@@ -382,7 +385,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant if taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant if taken");
.sub _main
if 10, L1
set I0, 5
@@ -394,7 +397,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant if not taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant if not taken");
.sub _main
if 0, L1
set I0, 5
@@ -407,7 +410,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant unless taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant unless taken");
.sub _main
unless 0, L1
set I0, 5
@@ -419,7 +422,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant unless not taken");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant unless not taken");
.sub _main
unless 1, L1
set I0, 5
@@ -432,7 +435,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant mix add");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant mix add");
.sub _main
add N0, 10.0, 15
end
@@ -444,7 +447,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant unary abs");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant unary abs");
.sub _main
abs I0, -10
end
@@ -456,7 +459,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant set");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant set");
.sub _main
set N0, 5
end
@@ -468,7 +471,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "strength mul I, 0");
+pir_2_pasm_is(<<'CODE', <<'OUT', "strength mul I, 0");
.sub _main
mul I0, 0
end
@@ -480,7 +483,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "strength mul I, I, 0");
+pir_2_pasm_is(<<'CODE', <<'OUT', "strength mul I, I, 0");
.sub _main
mul I0, I1, 0
end
@@ -492,7 +495,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "strength mul I, 0, I");
+pir_2_pasm_is(<<'CODE', <<'OUT', "strength mul I, 0, I");
.sub _main
mul I0, 0, I1
end
@@ -504,7 +507,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "strength mul N, 0, N");
+pir_2_pasm_is(<<'CODE', <<'OUT', "strength mul N, 0, N");
.sub _main
mul N0, 0.0, N1
end
@@ -516,7 +519,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "strength mul I, 1");
+pir_2_pasm_is(<<'CODE', <<'OUT', "strength mul I, 1");
.sub _main
mul I0, 1
end
@@ -527,7 +530,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "strength mul I, I, 1");
+pir_2_pasm_is(<<'CODE', <<'OUT', "strength mul I, I, 1");
.sub _main
mul I0, I1, 1
end
@@ -539,7 +542,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "strength mul I, 1, I");
+pir_2_pasm_is(<<'CODE', <<'OUT', "strength mul I, 1, I");
.sub _main
mul I0, 1, I1
end
@@ -551,7 +554,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "strength mul N, 1, N");
+pir_2_pasm_is(<<'CODE', <<'OUT', "strength mul N, 1, N");
.sub _main
mul N0, 1.0, N1
end
@@ -563,7 +566,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "strength div I, 1");
+pir_2_pasm_is(<<'CODE', <<'OUT', "strength div I, 1");
.sub _main
div I0, 1
end
@@ -574,7 +577,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "strength div I, I, 1");
+pir_2_pasm_is(<<'CODE', <<'OUT', "strength div I, I, 1");
.sub _main
div I0, I1, 1
end
@@ -586,7 +589,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "strength div N, N, 1");
+pir_2_pasm_is(<<'CODE', <<'OUT', "strength div N, N, 1");
.sub _main
div N0, N1, 1
end
@@ -598,7 +601,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "multiple const syms");
+pir_2_pasm_is(<<'CODE', <<'OUT', "multiple const syms");
.sub _main
set I0, 0
set I1, 1
@@ -620,7 +623,7 @@ OUT
##############################
SKIP: {
skip("printf float output is unportable!", 1) if $^O eq 'MSWin32';
-output_is(<<'CODE', <<'OUT', "constant add big nums");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant add big nums");
.sub _main
add N0, 10.0e20, 15.0e21
end
@@ -635,7 +638,7 @@ OUT
##############################
SKIP: {
skip("constant concat N/Y", 1);
-output_is(<<'CODE', <<'OUT', "constant concat");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant concat");
.sub _main
concat S0, "Parrot ", "rocks"
end
15 imcc/t/imcpasm/opt2.t
View
@@ -1,6 +1,9 @@
#!perl
+# Copyright: 2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 5;
+use Parrot::Test tests => 5;
SKIP: {
@@ -10,7 +13,7 @@ SKIP: {
# generated PASM code for various optimizations at level 2
##############################
-output_is(<<'CODE', <<'OUT', "used once lhs");
+pir_2_pasm_is(<<'CODE', <<'OUT', "used once lhs");
.sub _main
$I1 = 1
$I2 = 2
@@ -24,7 +27,7 @@ _main:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "constant propogation and resulting dead code");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant propogation and resulting dead code");
.sub _main
set I0, 5
loop:
@@ -45,7 +48,7 @@ loop:
OUT
##############################
-output_is(<<'CODE', <<'OUT', "don't move constant past a label");
+pir_2_pasm_is(<<'CODE', <<'OUT', "don't move constant past a label");
.sub _main
set I1, 10
set I0, 5
@@ -74,7 +77,7 @@ OUT
SKIP: {
skip("loop opt disabled for now", 1);
-output_is(<<'CODE', <<'OUT', "remove invariant from loop");
+pir_2_pasm_is(<<'CODE', <<'OUT', "remove invariant from loop");
.sub _main
set I0, 5
loop:
@@ -105,7 +108,7 @@ OUT
}
##############################
-output_is(<<'CODE', <<'OUT', "constant prop repeated");
+pir_2_pasm_is(<<'CODE', <<'OUT', "constant prop repeated");
.sub _main
.local int a
.local int b
17 imcc/t/imcpasm/optc.t
View
@@ -1,6 +1,9 @@
#!perl
+# Copyright: 2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 6;
+use Parrot::Test tests => 6;
# these tests are run with -Oc by TestCompiler and show
# generated PASM code for call optimization
@@ -8,7 +11,7 @@ use TestCompiler tests => 6;
##############################
# prototyped calls, invokecc
-output_like(<<'CODE', <<'OUT', "in P param");
+pir_2_pasm_like(<<'CODE', <<'OUT', "in P param");
.sub _main
$P0 = new PerlUndef
$P0 = 42
@@ -46,7 +49,7 @@ OUT
SKIP: {
skip("PCC changes", 5);
-output_like(<<'CODE', <<'OUT', "in, out P param");
+pir_2_pasm_like(<<'CODE', <<'OUT', "in, out P param");
.sub _main
.local Sub sub
.local PerlUndef x
@@ -95,7 +98,7 @@ _sub:
returncc/
OUT
-output_like(<<'CODE', <<'OUT', "in, out P param, P var");
+pir_2_pasm_like(<<'CODE', <<'OUT', "in, out P param, P var");
.sub _main
.local Sub sub
.local PerlUndef x
@@ -151,7 +154,7 @@ _sub:
returncc/
OUT
-output_like(<<'CODE', <<'OUT', "in, out different P param");
+pir_2_pasm_like(<<'CODE', <<'OUT', "in, out different P param");
.sub _main
.local Sub sub
.local PerlUndef x
@@ -201,7 +204,7 @@ _sub:
returncc/
OUT
-output_like(<<'CODE', <<'OUT', "in, out different P param, interfer");
+pir_2_pasm_like(<<'CODE', <<'OUT', "in, out different P param, interfer");
.sub _main
.local Sub sub
.local PerlUndef x
@@ -254,7 +257,7 @@ _sub:
returncc/
OUT
-output_like(<<'CODE', <<'OUT', "tail call");
+pir_2_pasm_like(<<'CODE', <<'OUT', "tail call");
.sub _main
.local Sub sub
newsub sub, .Sub, _sub1
27 imcc/t/imcpasm/pcc.t
View
@@ -1,9 +1,12 @@
#!perl
+# Copyright: 2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 11;
+use Parrot::Test tests => 11;
-output_like(<<'CODE', <<'OUT', 'end in @MAIN');
+pir_2_pasm_like(<<'CODE', <<'OUT', 'end in @MAIN');
.sub _main @MAIN
noop
.end
@@ -20,7 +23,7 @@ OUT
SKIP: {
skip("PCC changes", 10);
-output_like(<<'CODE', <<'OUT', "proto call, proto sub, invokecc");
+pir_2_pasm_like(<<'CODE', <<'OUT', "proto call, proto sub, invokecc");
.sub _main
.local Sub sub
newsub sub, .Sub, _sub
@@ -57,7 +60,7 @@ _sub:
end/
OUT
-output_like(<<'CODE', <<'OUT', "basic syntax - constants");
+pir_2_pasm_like(<<'CODE', <<'OUT', "basic syntax - constants");
.sub _main
.local Sub sub
.local Continuation cc
@@ -117,7 +120,7 @@ _sub:
OUT
#######################
-output_is(<<'CODE', <<'OUT', "basic syntax - sym constants");
+pir_2_pasm_is(<<'CODE', <<'OUT', "basic syntax - sym constants");
.sub _main
print "ok 1\n"
.const int x = 10
@@ -155,7 +158,7 @@ OUT
#######################
# initial test with register move
#
-output_like(<<'CODE', <<'OUT', "basic syntax - vars");
+pir_2_pasm_like(<<'CODE', <<'OUT', "basic syntax - vars");
.sub _main
.local int x
.local int y
@@ -192,7 +195,7 @@ ret:
end/
OUT
-output_like(<<'CODE', <<'OUT', "non prototyped, I,S");
+pir_2_pasm_like(<<'CODE', <<'OUT', "non prototyped, I,S");
.sub _main
.local Sub sub
newsub sub, .Sub, _sub
@@ -228,7 +231,7 @@ ret:
end/
OUT
-output_like(<<'CODE', <<'OUT', "non prototyped, P");
+pir_2_pasm_like(<<'CODE', <<'OUT', "non prototyped, P");
.sub _main
.local Sub sub
newsub sub, .Sub, _sub
@@ -262,7 +265,7 @@ ret:
end/
OUT
-output_like(<<'CODE', <<'OUT', "non proto call, non proto sub, invokecc");
+pir_2_pasm_like(<<'CODE', <<'OUT', "non proto call, non proto sub, invokecc");
.sub _main
.local Sub sub
newsub sub, .Sub, _sub
@@ -306,7 +309,7 @@ _sub:
end/
OUT
-output_like(<<'CODE', <<'OUT', "proto call, un proto sub, invokecc");
+pir_2_pasm_like(<<'CODE', <<'OUT', "proto call, un proto sub, invokecc");
.sub _main
.local Sub sub
newsub sub, .Sub, _sub
@@ -352,7 +355,7 @@ _sub:
end/
OUT
-output_like(<<'CODE', <<'OUT', "proto call, un proto sub, invokecc, P param");
+pir_2_pasm_like(<<'CODE', <<'OUT', "proto call, un proto sub, invokecc, P param");
.sub _main
.local Sub sub
newsub sub, .Sub, _sub
@@ -396,7 +399,7 @@ _sub:
\2:/
OUT
-output_like(<<'CODE', <<'OUT', "proto call, sub multiple returns");
+pir_2_pasm_like(<<'CODE', <<'OUT', "proto call, sub multiple returns");
.sub _main
.local Sub sub
newsub sub, .Sub, _sub
9 imcc/t/imcpasm/sub.t
View
@@ -1,9 +1,12 @@
#!perl
+# Copyright: 2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 2;
+use Parrot::Test tests => 2;
##############################
-output_like(<<'CODE', <<'OUT', "non-constant dest bsr, invoke");
+pir_2_pasm_like(<<'CODE', <<'OUT', "non-constant dest bsr, invoke");
.sub _main
$P26 = new Sub
$I15 = addr _sub1
@@ -24,7 +27,7 @@ _sub1:
ret/
OUT
-output_like(<<'CODE', <<'OUT', "nonlocal bsr");
+pir_2_pasm_like(<<'CODE', <<'OUT', "nonlocal bsr");
.sub _main
$P26 = new Sub
$I15 = addr _f
44 imcc/t/reg/spill.t
View
@@ -1,14 +1,17 @@
-#!perl
+#!perl -w
+# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 9;
+use Parrot::Test tests => 9;
-##############################
+pir_output_is(<<'CODE', <<'OUT', "allocate 1");
+#
# Test the ability of the register allocator to
# generate spills.
#
-output_is(<<'CODE', <<'OUT', "allocate 1");
-.sub _MAIN
+.sub test @MAIN
$I0 = 0
$I1 = 1
$I2 = 2
@@ -76,14 +79,13 @@ CODE
40
OUT
-##############################
-output_is(<<'CODE', <<'OUT', "spill 1");
+pir_output_is(<<'CODE', <<'OUT', "spill 1");
+#
# Test the ability of the register allocator to
# generate spills.
#
-
-.sub _MAIN
+.sub test @MAIN
$I0 = 0
$I1 = 1
$I2 = 2
@@ -233,15 +235,14 @@ CODE
6165697377
OUT
-##############################
-output_is(<<'CODE', <<'OUT', "pcc arg overflow 1");
+pir_output_is(<<'CODE', <<'OUT', "pcc arg overflow 1");
+#
# Test the ability of the register allocator in
# combination with PCC calling convention and overflow arguments.
# Slightly redundant with tests in t/syn/pcc.t but please leave.
#
-
-.sub _MAIN
+.sub test @MAIN
_foo(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)
end
.end
@@ -327,9 +328,12 @@ CODE
40
OUT
-output_is(<<'CODE', <<'OUT', "spill 4");
-.sub _MAIN
+pir_output_is(<<'CODE', <<'OUT', "spill 4");
+#
+# Another spill test
+#
+.sub test @MAIN
$I0 = 0
$I1 = 1
$I2 = 2
@@ -425,7 +429,7 @@ CODE
ok
OUT
-output_is(<<'CODE', <<'OUT', "bug #32996");
+pir_output_is(<<'CODE', <<'OUT', "bug #32996");
.namespace ["Foo"]
@@ -664,7 +668,7 @@ my $code = repeat($template2, 18,
TESTS => "set I0, a<index>\nne I0, <index>, fail",
TESTS2 => "set I0, a<index>\nne I0, <index>, fail");
-output_is($code, <<'OUT', "overflow pmcs 18 spill");
+pir_output_is($code, <<'OUT', "overflow pmcs 18 spill");
all params ok
OUT
@@ -676,7 +680,7 @@ $code = repeat($template2, 22,
TESTS => "set I0, a<index>\nne I0, <index>, fail",
TESTS2 => "set I0, a<index>\nne I0, <index>, fail");
-output_is($code, <<'OUT', "overflow pmcs 22 spill");
+pir_output_is($code, <<'OUT', "overflow pmcs 22 spill");
all params ok
OUT
@@ -688,7 +692,7 @@ $code = repeat($template2, 40,
TESTS => "set I0, a<index>\nne I0, <index>, fail",
TESTS2 => "set I0, a<index>\nne I0, <index>, fail");
-output_is($code, <<'OUT', "overflow pmcs 40 spill");
+pir_output_is($code, <<'OUT', "overflow pmcs 40 spill");
all params ok
OUT
@@ -700,6 +704,6 @@ $code = repeat($template2, 60,
TESTS => "set I0, a<index>\nne I0, <index>, fail",
TESTS2 => "set I0, a<index>\nne I0, <index>, fail");
-output_is($code, <<'OUT', "overflow pmcs 60 spill");
+pir_output_is($code, <<'OUT', "overflow pmcs 60 spill");
all params ok
OUT
61 imcc/t/syn/bsr.t
View
@@ -1,12 +1,13 @@
-#!perl
+#!perl -w
+# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 13;
+use Parrot::Test tests => 13;
-##############################
+pir_output_is(<<'CODE', <<'OUT', "bsr 1");
# this tests register allocation/preserving of local bsr calls
-#
-output_is(<<'CODE', <<'OUT', "bsr 1");
-.sub _test
+.sub test @MAIN
$I0 = 2
$I1 = 3
bsr L
@@ -24,8 +25,8 @@ CODE
OUT
##############################
-output_is(<<'CODE', <<'OUT', "stack calling conventions");
-.sub _main
+pir_output_is(<<'CODE', <<'OUT', "stack calling conventions");
+.sub test @MAIN
.local int x
x = 10
.const int y = 20
@@ -76,8 +77,8 @@ OUT
##############################
#
-output_is(<<'CODE', <<'OUT', "fact with stack calling conventions");
-.sub _main
+pir_output_is(<<'CODE', <<'OUT', "fact with stack calling conventions");
+.sub test @MAIN
.local int counter
counter = 5
.arg counter
@@ -110,8 +111,8 @@ OUT
##############################
# this is considered a non local bsr
#
-output_is(<<'CODE', <<'OUT', "recursive bsr with saveall");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "recursive bsr with saveall");
+.sub test @MAIN
$I0 = 5 # count
$I1 = 1 # product
save $I0
@@ -144,8 +145,8 @@ OUT
##############################
# tail recursion - caller saves
-output_is(<<'CODE', <<'OUT', "tail recursive bsr");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "tail recursive bsr");
+.sub test @MAIN
$I0 = 5 # count
$I1 = 1 # product
saveall
@@ -175,8 +176,8 @@ OUT
##############################
# tail recursion - caller saves
-output_is(<<'CODE', <<'OUT', "tail recursive bsr 2");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "tail recursive bsr 2");
+.sub test @MAIN
$I0 = 5 # count
$I1 = 1 # product
saveall
@@ -202,8 +203,8 @@ OUT
##############################
# tail recursion - caller saves
-output_is(<<'CODE', <<'OUT', "tail recursive bsr - opt");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "tail recursive bsr - opt");
+.sub test @MAIN
$I0 = 5 # count
$I1 = 1 # product
saveall
@@ -229,8 +230,8 @@ OUT
##############################
# tail recursion - caller saves - parrot calling convention
-output_is(<<'CODE', <<'OUT', "tail recursive bsr, parrot cc");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "tail recursive bsr, parrot cc");
+.sub test @MAIN
$I0 = _fact(1, 5)
print $I0
print "\n"
@@ -257,8 +258,8 @@ OUT
##############################
# coroutine
-output_is(<<'CODE', <<'OUT', "coroutine");
-.sub _main
+pir_output_is(<<'CODE', <<'OUT', "coroutine");
+.sub test @MAIN
.local Coroutine co
co = new Coroutine
co = addr _routine
@@ -281,8 +282,8 @@ CODE
Hello perl6.
OUT
-output_is(<<'CODE', <<'OUT', "newsub");
- .sub _main
+pir_output_is(<<'CODE', <<'OUT', "newsub");
+ .sub test @MAIN
newsub P0, .Sub, _foo # PASM syntax only for now
invokecc P0
end
@@ -300,13 +301,13 @@ OUT
my $head1 = '=head1';
my $cut = '=cut';
-output_is(<<"CODE", <<'OUT', "pod before");
+pir_output_is(<<"CODE", <<'OUT', "pod before");
$head1 BLA
fasel
$cut
-.sub _main
+.sub test \@MAIN
print "ok 1\\n"
end
.end
@@ -314,13 +315,13 @@ CODE
ok 1
OUT
-output_is(<<"CODE", <<'OUT', "pod before, after");
+pir_output_is(<<"CODE", <<'OUT', "pod before, after");
$head1 FOO
fasel
$cut
-.sub _main
+.sub test \@MAIN
print "ok 1\\n"
end
.end
@@ -332,8 +333,8 @@ CODE
ok 1
OUT
-output_is(<<'CODE', <<'OUT', "bug #25948");
-.sub _main
+pir_output_is(<<'CODE', <<'OUT', "bug #25948");
+.sub main @MAIN
goto L1
test:
$I1 = 1
68 imcc/t/syn/clash.t
View
@@ -1,10 +1,12 @@
-#!perl
-use strict;
-use TestCompiler tests => 15;
+#!perl -w
+# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+use strict;
+use Parrot::Test tests => 15;
-output_is(<<'CODE', <<'OUT', "if/unless");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "if/unless");
+.sub test @MAIN
$I0 = 0
if $I0 goto nok1
print "ok 1\n"
@@ -25,8 +27,8 @@ ok 1
ok 2
OUT
-output_is(<<'CODE', <<'OUT', "if/unless");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "if/unless");
+.sub test @MAIN
$I0 = 0
$I1 = 1
if $I0 == $I1 goto nok1
@@ -53,8 +55,8 @@ ok 3
OUT
-output_is(<<'CODE', <<'OUT', "new");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "new");
+.sub test @MAIN
$P1 = new PerlString
$P1 = "ok 1\n"
new P1, .PerlString
@@ -69,8 +71,8 @@ ok 2
OUT
-output_is(<<'CODE', <<'OUT', "clone");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "clone");
+.sub test @MAIN
$P1 = new PerlString
$P1 = "ok 1\n"
$P0 = clone $P1
@@ -87,8 +89,8 @@ ok 2
OUT
-output_is(<<'CODE', <<'OUT', "defined");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "defined");
+.sub test @MAIN
$P1 = new Hash
$I0 = defined $P1
new P1, .Hash
@@ -105,8 +107,8 @@ CODE
OUT
-output_is(<<'CODE', <<'OUT', "defined keyed");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "defined keyed");
+.sub test @MAIN
$P1 = new Hash
$P1["a"] = "ok 1\n"
$I0 = defined $P1["a"]
@@ -129,8 +131,8 @@ CODE
OUT
-output_is(<<'CODE', <<'OUT', "parrot op as identifier");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "parrot op as identifier");
+.sub test @MAIN
.local int set
set = 5
print set
@@ -146,8 +148,8 @@ CODE
OUT
-output_is(<<'CODE', <<'OUT', "parrot op as label");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "parrot op as label");
+.sub test @MAIN
goto set
set:
if I0, err
@@ -166,8 +168,8 @@ CODE
ok
OUT
-output_like(<<'CODE', <<'OUTPUT', "new with a native type");
-.sub _main
+pir_output_like(<<'CODE', <<'OUTPUT', "new with a native type");
+.sub test @MAIN
$P1 = new INTVAL
print "never\n"
end
@@ -176,8 +178,8 @@ CODE
/error:\w+:Unknown PMC type 'INTVAL'/
OUTPUT
-output_is(<<'CODE', <<'OUTPUT', "setline w comment");
-.sub _main
+pir_output_is(<<'CODE', <<'OUTPUT', "setline w comment");
+.sub test @MAIN
setline 1 # comment
print "ok\n"
end
@@ -186,8 +188,8 @@ CODE
ok
OUTPUT
-output_is(<<'CODE', <<'OUTPUT', "setfile w comment");
-.sub _main
+pir_output_is(<<'CODE', <<'OUTPUT', "setfile w comment");
+.sub test @MAIN
setfile "foo" # comment
print "ok\n"
end
@@ -196,8 +198,8 @@ CODE
ok
OUTPUT
-output_is(<<'CODE', <<'OUTPUT', "eq_num => eq");
-.sub _main
+pir_output_is(<<'CODE', <<'OUTPUT', "eq_num => eq");
+.sub test @MAIN
.local int i
.local int j
i = 1
@@ -212,8 +214,8 @@ CODE
ok 1
OUTPUT
-output_is(<<'CODE', <<'OUTPUT', "eq_num => eq mixed => eq_n_n");
-.sub _main
+pir_output_is(<<'CODE', <<'OUTPUT', "eq_num => eq mixed => eq_n_n");
+.sub test @MAIN
.local int i
.local float j
i = 1
@@ -228,16 +230,16 @@ CODE
ok 1
OUTPUT
-output_like(<<'CODE', <<'OUT', "undefined ident");
-.sub _main @MAIN
+pir_output_like(<<'CODE', <<'OUT', "undefined ident");
+.sub test @MAIN
print no_such
.end
CODE
/error.*undefined.*'no_such'/
OUT
-output_is(<<'CODE', <<'OUT', "label ident");
-.sub _main @MAIN
+pir_output_is(<<'CODE', <<'OUT', "label ident");
+.sub test @MAIN
branch no_such
end
no_such:
21 imcc/t/syn/const.t
View
@@ -1,12 +1,11 @@
-#!perl
-
-# Copyright: 2001-2003 The Perl Foundation. All Rights Reserved.
+#!perl -w
+# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved.
# $Id$
use strict;
-use TestCompiler tests => 7;
+use Parrot::Test tests => 7;
-output_is(<<'CODE', <<'OUT', "globalconst 1");
+pir_output_is(<<'CODE', <<'OUT', "globalconst 1");
.sub __main
.globalconst int N = 5
@@ -28,7 +27,7 @@ CODE
5
OUT
-output_is(<<'CODE', <<'OUT', "globalconst 2");
+pir_output_is(<<'CODE', <<'OUT', "globalconst 2");
.sub test @MAIN
.globalconst int N = 5
call _main
@@ -51,7 +50,7 @@ CODE
15
OUT
-output_is(<<'CODE', <<'OUT', "globalconst 3");
+pir_output_is(<<'CODE', <<'OUT', "globalconst 3");
.sub call_sub1
sub1()
@@ -72,7 +71,7 @@ CODE
OUT
-output_is(<<'CODE', <<'OUT', "array/hash consts");
+pir_output_is(<<'CODE', <<'OUT', "array/hash consts");
.sub _MAIN
.local PerlArray ar
.local pmc ha
@@ -102,7 +101,7 @@ CODE
OUT
-output_is(<<'CODE', <<'OUT', "escaped");
+pir_output_is(<<'CODE', <<'OUT', "escaped");
.sub _MAIN
$S0 = "\""
print $S0
@@ -116,7 +115,7 @@ CODE
OUT
-output_is(<<'CODE', <<'OUT', "PMC const 1 - Sub");
+pir_output_is(<<'CODE', <<'OUT', "PMC const 1 - Sub");
.sub main @MAIN
.const .Sub $P0 = "foo"
print "ok 1\n"
@@ -133,7 +132,7 @@ ok 3
OUT
-output_is(<<'CODE', <<'OUT', "PMC const 2 - Sub ident");
+pir_output_is(<<'CODE', <<'OUT', "PMC const 2 - Sub ident");
.sub main @MAIN
.const .Sub func = "foo"
print "ok 1\n"
35 imcc/t/syn/eval.t
View
@@ -1,13 +1,16 @@
-#!perl
+#!perl -w
+# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 7;
+use Parrot::Test tests => 7;
SKIP: {
skip("changed eval semantics - see t/pmc/eval.t", 7);
##############################
-output_is(<<'CODE', <<'OUT', "eval pasm");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "eval pasm");
+.sub test @MAIN
$S0 = 'set S1, "in eval\n"'
concat $S0, "\n"
concat $S0, "print S1\nend\n"
@@ -22,8 +25,8 @@ in eval
back
OUT
-output_is(<<'CODE', <<'OUT', "eval pir");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "eval pir");
+.sub test @MAIN
$S1 = ".sub _foo\n"
concat $S1, '$S1 = "42\n"'
concat $S1, "\nprint $S1\nend\n"
@@ -39,7 +42,7 @@ CODE
back
OUT
-output_is(<<'CODE', <<'OUT', "intersegment branch");
+pir_output_is(<<'CODE', <<'OUT', "intersegment branch");
# #! perl -w
# my $i= 5;
# LAB:
@@ -50,7 +53,7 @@ output_is(<<'CODE', <<'OUT', "intersegment branch");
# 7
#####
-.sub _test
+.sub test @MAIN
I1 = 5
$S0 = ".sub _e\nif I1 == 6 goto LAB\nend\n.end\n"
compreg P2, "PIR"
@@ -66,8 +69,8 @@ CODE
7
OUT
-output_is(<<'CODE', <<'OUT', "intersegment branch 2");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "intersegment branch 2");
+.sub test @MAIN
I1 = 4
$S0 = ".sub _e\nif I1 <= 6 goto LAB\nend\n.end\n"
compreg P2, "PIR"
@@ -83,8 +86,8 @@ CODE
7
OUT
-output_is(<<'CODE', <<'OUT', "intersegment branch 3");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "intersegment branch 3");
+.sub test @MAIN
I1 = 4
compreg P2, "PIR"
$S0 = ".sub _e\nif I1 <= 5 goto LAB\nend\n.end\n"
@@ -104,8 +107,8 @@ CODE
7
OUT
-output_is(<<'CODE', <<'OUT', "intersegment branch 4");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "intersegment branch 4");
+.sub test @MAIN
I1 = 4
compreg P2, "PIR"
$S0 = ".sub _e\nif I1 <= 5 goto LAB\nend\n.end\n"
@@ -126,8 +129,8 @@ CODE
8
OUT
-output_is(<<'CODE', <<'OUT', "eval - same constants");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "eval - same constants");
+.sub test @MAIN
print "hello"
print "\n"
$S0 = 'print "hello"'
38 imcc/t/syn/file.t
View
@@ -1,5 +1,5 @@
-#!perl
-
+#!perl -w
+# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved.
# $Id$
=head1 NAME
@@ -16,7 +16,7 @@ use strict;
use 5;
use Parrot::Config;
-use TestCompiler tests => 12;
+use Parrot::Test tests => 12;
# Do not assume that . is in $PATH
my $PARROT = ".$PConfig{slash}parrot$PConfig{exe}";
@@ -29,8 +29,8 @@ print FOO <<'ENDF';
ENDF
close FOO;
-output_is(<<'CODE', <<'OUT', "include pasm");
-.sub _main
+pir_output_is(<<'CODE', <<'OUT', "include pasm");
+.sub test @MAIN
print "before\n"
.include "temp.pasm"
print .BAR
@@ -51,8 +51,8 @@ print FOO <<'ENDF';
ENDF
close FOO;
-output_is(<<'CODE', <<'OUT', "include pir");
-.sub _main
+pir_output_is(<<'CODE', <<'OUT', "include pir");
+.sub test @MAIN
print "before\n"
.include "temp.imc"
print BAR
@@ -73,8 +73,8 @@ print FOO <<'ENDF';
ENDF
close FOO;
-output_is(<<'CODE', <<'OUT', "include .inc");
-.sub _main
+pir_output_is(<<'CODE', <<'OUT', "include .inc");
+.sub test @MAIN
print "before\n"
.include "temp.inc"
print BAR
@@ -114,8 +114,8 @@ print F <<'EOF';
EOF
close F;
-output_is(<<'CODE', <<'OUT', "subroutine in external file");
-.sub _main
+pir_output_is(<<'CODE', <<'OUT', "subroutine in external file");
+.sub test @MAIN
.local int x
x = 10
.const int y = 20
@@ -160,7 +160,7 @@ close FOO;
system("$PARROT -o temp.pbc temp.imc");
-output_is(<<'CODE', <<'OUT', "call sub in external pbc");
+pir_output_is(<<'CODE', <<'OUT', "call sub in external pbc");
.pcc_sub _sub1 prototyped
print "sub1\n"
load_bytecode "temp.pbc"
@@ -193,7 +193,7 @@ close FOO;
system("$PARROT -o temp.pbc temp.imc");
-output_is(<<'CODE', <<'OUT', "call sub in external pbc, return");
+pir_output_is(<<'CODE', <<'OUT', "call sub in external pbc, return");
.pcc_sub _sub1 prototyped
print "sub1\n"
load_bytecode "temp.pbc"
@@ -231,7 +231,7 @@ close FOO;
system("$PARROT -o temp.pbc temp.imc");
-output_is(<<'CODE', <<'OUT', "call sub in external pbc with 2 subs");
+pir_output_is(<<'CODE', <<'OUT', "call sub in external pbc with 2 subs");
.pcc_sub _sub1 prototyped
print "sub1\n"
load_bytecode "temp.pbc"
@@ -262,7 +262,7 @@ ENDF
close FOO;
# compile it
-output_is(<<'CODE', <<'OUT', "call sub in external imc, return");
+pir_output_is(<<'CODE', <<'OUT', "call sub in external imc, return");
.pcc_sub _sub1 prototyped
print "sub1\n"
load_bytecode "temp.imc"
@@ -283,7 +283,7 @@ back
OUT
-output_is(<<'CODE', <<'OUT', "call internal sub like external");
+pir_output_is(<<'CODE', <<'OUT', "call internal sub like external");
.pcc_sub _sub1 prototyped
print "sub1\n"
$P0 = global "_sub2"
@@ -349,7 +349,7 @@ OUT
# Including a non-existent file should produce an error
.include "non_existent.imc"
# An error should have been raised
-.sub _main
+.sub test @MAIN
# dummy, because a main function is expected
end
.end
@@ -373,7 +373,7 @@ END_PIR
my $ENOENT = $! + 0;
open FOO, ">temp.imc" or die "Can't write temp.imc\n";
print FOO << "END_PIR";
-.sub _main
+.sub test \@MAIN
# run a OS command, and get the errmessge for the exit code
.local string enoent_err_msg
err enoent_err_msg, $ENOENT
@@ -396,7 +396,7 @@ SKIP:
{
skip("multiple loading not speced - failing", 1);
- output_is(<<'CODE', <<'OUT', "twice call sub in external imc, return");
+ pir_output_is(<<'CODE', <<'OUT', "twice call sub in external imc, return");
.pcc_sub _sub1 prototyped
print "sub1\n"
load_bytecode "temp.imc"
11 imcc/t/syn/keyed.t
View
@@ -1,10 +1,13 @@
-#!perl
+#!perl -w
+# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 1;
+use Parrot::Test tests => 1;
##############################
-output_is(<<'CODE', <<'OUTPUT', "add_keyed");
-.sub _main
+pir_output_is(<<'CODE', <<'OUTPUT', "add_keyed");
+.sub test @MAIN
new P0, .PerlArray
new P1, .PerlArray
new P2, .PerlArray
25 imcc/t/syn/labels.t
View
@@ -1,10 +1,13 @@
-#!perl
+#!perl -w
+# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 7;
+use Parrot::Test tests => 7;
##############################
-output_is(<<'CODE', <<'OUT', "goto 1");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "goto 1");
+.sub test @MAIN
goto foo
end
foo:
@@ -17,8 +20,8 @@ ok 1
OUT
##############################
-output_is(<<'CODE', <<'OUT', "goto 2");
-.sub _test
+pir_output_is(<<'CODE', <<'OUT', "goto 2");
+.sub test @MAIN
goto foo
bar: print "ok 2\n"
end
@@ -33,7 +36,7 @@ ok 2
OUT
##############################
-output_is(<<'CODE', <<'OUT', "local labels");
+pir_output_is(<<'CODE', <<'OUT', "local labels");
# this code is illegal for assemble.pl
.sub __main
bsr _sub1
@@ -62,7 +65,7 @@ ok 2
OUT
##############################
-output_is(<<'CODE', <<'OUT', "local labels 2");
+pir_output_is(<<'CODE', <<'OUT', "local labels 2");
.sub _realmain
bsr FOO
call _function
@@ -82,7 +85,7 @@ in main
in function
OUT
-output_is(<<'CODE', <<'OUT', "perlish func label");
+pir_output_is(<<'CODE', <<'OUT', "perlish func label");
.sub _main::test
print "ok 1\n"
end
@@ -92,7 +95,7 @@ CODE
ok 1
OUT
-output_is(<<'CODE', <<'OUT', "perlish func label - .pcc_sub");
+pir_output_is(<<'CODE', <<'OUT', "perlish func label - .pcc_sub");
.pcc_sub _main::test prototyped
print "ok 1\n"
end
@@ -102,7 +105,7 @@ CODE
ok 1
OUT
-output_is(<<'CODE', <<'OUT', "perlish func label - bsr");
+pir_output_is(<<'CODE', <<'OUT', "perlish func label - bsr");
.sub _main::test
bsr _main::sub
print "ok 2\n"
101 imcc/t/syn/macro.t
View
@@ -1,13 +1,14 @@
-#!perl
+#!perl -w
+# Copyright: 2001-2005 The Perl Foundation. All Rights Reserved.
+# $Id$
+
use strict;
-use TestCompiler tests => 23;
+use Parrot::Test tests => 23;
# macro tests
-##############################
-
-output_is( <<'CODE', <<OUTPUT, "macro, zero parameters" );
-.sub _main
+pir_output_is( <<'CODE', <<OUTPUT, "macro, zero parameters" );
+.sub test @MAIN
.macro answer()
print 42
print "\n"
@@ -19,8 +20,8 @@ CODE
42
OUTPUT
-output_is( <<'CODE', <<OUTPUT, "macro, one unused parameter, literal term" );
-.sub _main
+pir_output_is( <<'CODE', <<OUTPUT, "macro, one unused parameter, literal term" );
+.sub test @MAIN
.macro answer(A)
print 42
.endm
@@ -32,8 +33,8 @@ CODE
42
OUTPUT
-output_is( <<'CODE', <<OUTPUT, "macro, one unused parameter, register term" );
-.sub _main
+pir_output_is( <<'CODE', <<OUTPUT, "macro, one unused parameter, register term" );
+.sub test @MAIN
.macro answer(A)
print 42
.endm
@@ -46,8 +47,8 @@ CODE
42
OUTPUT
-output_is( <<'CODE', <<OUTPUT, "macro, one used parameter, literal" );
-.sub _main
+pir_output_is( <<'CODE', <<OUTPUT, "macro, one used parameter, literal" );
+.sub test @MAIN
.macro answer(A)
print .A
.endm
@@ -59,8 +60,8 @@ CODE
42
OUTPUT
-output_is( <<'CODE', <<OUTPUT, "macro, one used parameter, register" );
-.sub _main
+pir_output_is( <<'CODE', <<OUTPUT, "macro, one used parameter, register" );
+.sub test @MAIN
.macro answer(A)
print .A
.endm
@@ -73,8 +74,8 @@ CODE
42
OUTPUT
-output_is( <<'CODE', <<OUTPUT, "macro, one used parameter, called twice" );
-.sub _main
+pir_output_is( <<'CODE', <<OUTPUT, "macro, one used parameter, called twice" );
+.sub test @MAIN
.macro answer(A)
print .A
print "\n"
@@ -90,8 +91,8 @@ CODE
43
OUTPUT
-output_is( <<'CODE', <<OUTPUT, "macro, one used parameter, label" );
-.sub _main
+pir_output_is( <<'CODE', <<OUTPUT, "macro, one used parameter, label" );
+.sub test @MAIN
.macro answer(A)
ne I0,42,.$done
print .A
@@ -106,8 +107,8 @@ CODE
42
OUTPUT
-output_is( <<'CODE', <<OUTPUT, "macro, one used parameter run twice, label" );
-.sub _main
+pir_output_is( <<'CODE', <<OUTPUT, "macro, one used parameter run twice, label" );
+.sub test @MAIN
.macro answer(A)
ne I0,42,.$done
print .A
@@ -124,24 +125,24 @@ CODE
42
OUTPUT
-output_is(<<'CODE', '32', "constant defined and used");
-.sub _main
+pir_output_is(<<'CODE', '32', "constant defined and used");
+.sub test @MAIN
.const int FOO = 32
print FOO
end
.end
CODE
-output_is(<<'CODE', 'foo', "constant defined and used");
-.sub _main
+pir_output_is(<<'CODE', 'foo', "constant defined and used");
+.sub test @MAIN
.const string FOO = "foo"
print FOO
end
.end
CODE
-output_is( <<'CODE', <<OUTPUT, ".newid" );
-.sub _main
+pir_output_is( <<'CODE', <<OUTPUT, ".newid" );
+.sub test @MAIN
.macro newid(ID, CLASS)
.sym .CLASS .ID
.ID = new .CLASS
@@ -156,8 +157,8 @@ CODE
10
OUTPUT
-output_is( <<'CODE', <<OUTPUT, ".newlex" );
-.sub _main
+pir_output_is( <<'CODE', <<OUTPUT, ".newlex" );
+.sub test @MAIN
.macro newlex(ID, CLASS)
.sym .CLASS .ID
.ID = new .CLASS
@@ -173,8 +174,8 @@ CODE
10
OUTPUT
-output_like( <<'CODE', <<OUTPUT, "too few params" );
-.sub _main
+pir_output_like( <<'CODE', <<OUTPUT, "too few params" );
+.sub test @MAIN
.macro M(A, B)
print .A
print .B
@@ -186,8 +187,8 @@ CODE
/Macro 'M' requires 2 arguments, but 1 given/
</