summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/lib/warnings/9uninit16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/lib/warnings/9uninit b/t/lib/warnings/9uninit
index f49ca66474..9fb5df1359 100644
--- a/t/lib/warnings/9uninit
+++ b/t/lib/warnings/9uninit
@@ -759,6 +759,22 @@ Use of uninitialized value $m1 in scalar assignment at - line 5.
########
use warnings 'uninitialized';
my ($m1);
+our ($g1);
+
+$v = pos($m1) + 1;
+$v = pos($g1) + 1;
+$m1 = 0;
+$g1 = "";
+$v = pos($m1) + 1;
+$v = pos($g1) + 1;
+EXPECT
+Use of uninitialized value in addition (+) at - line 5.
+Use of uninitialized value in addition (+) at - line 6.
+Use of uninitialized value in addition (+) at - line 9.
+Use of uninitialized value in addition (+) at - line 10.
+########
+use warnings 'uninitialized';
+my ($m1);
{ my $x = "a" x $m1 } # NB LHS of repeat does not warn
{ my @x = ("a") x $m1 }