use strict;
use Config;
-print "1..18\n";
+print "1..32\n";
use B::Deparse;
my $deparse = B::Deparse->new() or print "not ";
ne $deparse->coderef2text(sub{(-1) ** $a });
print "ok " . $i++ . "\n";
-# XXX ToDo - constsub that returns a reference
-#use constant cr => ['hello'];
-#my $string = "sub " . $deparse->coderef2text(\&cr);
-#my $val = (eval $string)->();
-#print "not " if ref($val) ne 'ARRAY' || $val->[0] ne 'hello';
-#print "ok " . $i++ . "\n";
+use constant cr => ['hello'];
+my $string = "sub " . $deparse->coderef2text(\&cr);
+my $val = (eval $string)->();
+print "not " if ref($val) ne 'ARRAY' || $val->[0] ne 'hello';
+print "ok " . $i++ . "\n";
my $a;
my $Is_VMS = $^O eq 'VMS';
'XL'->bootstrap;
}
$1/ if $Is_MacOS;
-if ($a ne $b) {
- # A temporary debugging aid (Tru64 threaded smoke test somehow
- # broke between 19150 and 19160, but works okay from command line.)
- print STDERR "# [$a]\n\# vs expected\n# [$b]\n";
- print "not ";
-}
+print "# [$a]\n\# vs expected\n# [$b]\nnot " if $a ne $b;
print "ok " . $i++ . "\n";
__DATA__
####
# 15
s/x/'y';/e;
+####
+# 16 - various lypes of loop
+{ my $x; }
+####
+# 17
+while (1) { my $k; }
+####
+# 18
+my ($x,@a);
+$x=1 for @a;
+>>>>
+my($x, @a);
+foreach $_ (@a) {
+ $x = 1;
+}
+####
+# 19
+for (my $i = 0; $i < 2;) {
+ my $z = 1;
+}
+####
+# 20
+for (my $i = 0; $i < 2; ++$i) {
+ my $z = 1;
+}
+####
+# 21
+for (my $i = 0; $i < 2; ++$i) {
+ my $z = 1;
+}
+####
+# 22
+my $i;
+while ($i) { my $z = 1; } continue { $i = 99; }
+####
+# 23
+foreach $i (1, 2) {
+ my $z = 1;
+}
+####
+# 24
+my $i;
+foreach $i (1, 2) {
+ my $z = 1;
+}
+####
+# 25
+my $i;
+foreach my $i (1, 2) {
+ my $z = 1;
+}
+####
+# 26
+foreach my $i (1, 2) {
+ my $z = 1;
+}
+####
+# 27
+foreach our $i (1, 2) {
+ my $z = 1;
+}
+####
+# 28
+my $i;
+foreach our $i (1, 2) {
+ my $z = 1;
+}