Many of the examples in examples/shootout specify preferred flags. For
example, ack.pir starts with
#!./parrot -Oc -Cj
I don't know what -Oc does. docs/running.pod doesn't say. It refers to
the non-existent F<imcc/docs/operation.pod> for more details. I found
what I presume is that file in F<docs/imcc/operation.pod>, but that
doesn't say anything about -Oc either. Oh well.
Ignoring that for the moment, the second set of flags is the problem.
On a system with neither -C nor -j, t/examples/shootout.t would leave
the second argument there as a plain '-'. Parrot would then sit waiting
forever for stdin, and the test suite would hang.
This patch fixes that.
--- parrot-current/t/examples/shootout.t Tue Feb 20 19:15:45 2007
+++ parrot-andy/t/examples/shootout.t Tue Mar 27 08:23:38 2007
@@ -84,10 +84,11 @@
}
unless ( $PConfig{cg_flag} =~ /HAVE/ ) {
$args =~ s/-Cj/-j/;
- $args =~ s/C//;
+ # Remove any plain -C option.
+ $args =~ s/(^|\s)-C(\s|$)/$1$2/;
+ # Remove any extra Cs still floating around
+ $args =~ s/C//;
}
-
- $args eq '-' and $args = '';
# look for input files
my $input = "$file$INPUT_EXT";
--
Andy Dougherty doug...@lafayette.edu
> Ignoring that for the moment, the second set of flags is the problem.
> On a system with neither -C nor -j, t/examples/shootout.t would leave
> the second argument there as a plain '-'. Parrot would then sit waiting
> forever for stdin, and the test suite would hang.
Thanks, applied as r17792.
-- c
Sorry for the underdocumentation, -Oc turns on the optional/experimental tail
call optimizations, which is visible at:
$ find . -type f -name '*.c' | xargs grep OPT_SUB
./compilers/imcc/pcc.c: if (tail_call && IMCC_INFO(interp)->optimizer_level
& OPT_SUB) {
...
(the OPT_SUB bit is following directly out of -Oc parsing
in /compilers/imcc/main.c)
Sorry^2: docs/imcc/operation.pod # moved long time ago ;)
> I found
> what I presume is that file in F<docs/imcc/operation.pod>, but that
> doesn't say anything about -Oc either. Oh well.
>
> Ignoring that for the moment, the second set of flags is the problem.
> On a system with neither -C nor -j, t/examples/shootout.t would leave
> the second argument there as a plain '-'. Parrot would then sit waiting
> forever for stdin, and the test suite would hang.
Yep. And some of the tests might be boringly slow, if $platform doesn't have
these runtime options, so that skipping these tests should be preferable in
that case.
Thanks,
leo