summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/ext/XS-APItest/t/gotosub.t
blob: c665aafd5d3692efa354b1e0c99992eef2005561 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!perl -w

# Test that goto &xsub provides the right lexical environment.

use strict;

use Test::More tests => 1;
use XS::APItest;

# This sub must remain outside the ‘use warnings’ scope.
sub no_warnings { goto &stringify }

use warnings;

$SIG{__WARN__} = sub { like shift, qr\^Use of uninitialized\ };

no_warnings(my $x) # undefined variable