summaryrefslogtreecommitdiff
path: root/t/comp
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-11-26 06:51:16 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-11-26 06:51:16 +0000
commit7ad382f40c272949663b62a641674bd9771ee3b8 (patch)
treea3e68bac2583aee0cf9d8a2fcc30bec894332032 /t/comp
parent73a462964be81fd1ed02a757d25ecbbf6c0e2686 (diff)
downloadperl-7ad382f40c272949663b62a641674bd9771ee3b8.tar.gz
fix C<if (...) { package Foo; ... }> misoptimization that fails
to set the package for the block properly p4raw-id: //depot/perl@2299
Diffstat (limited to 't/comp')
-rwxr-xr-xt/comp/package.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/comp/package.t b/t/comp/package.t
index d7d19ae882..4982256db7 100755
--- a/t/comp/package.t
+++ b/t/comp/package.t
@@ -1,6 +1,6 @@
#!./perl
-print "1..7\n";
+print "1..8\n";
$blurfl = 123;
$foo = 3;
@@ -37,3 +37,17 @@ print $blurfl == 5 ? "ok 4\n" : "not ok 4\n";
eval 'print $blurfl == 5 ? "ok 5\n" : "not ok 5\n";';
eval 'package main; print $blurfl == 123 ? "ok 6\n" : "not ok 6\n";';
print $blurfl == 5 ? "ok 7\n" : "not ok 7\n";
+
+package main;
+
+sub c { caller(0) }
+
+sub foo {
+ my $s = shift;
+ if ($s) {
+ package PQR;
+ main::c();
+ }
+}
+
+print((foo(1))[0] eq 'PQR' ? "ok 8\n" : "not ok 8\n");