This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Handle SAVEt_ADELETE in ss_dup
[perl5.git] / t / porting / ss_dup.t
CommitLineData
d8ca50cb
FC
1#!perl
2
cb555a74 3@TODO = qw [ SAVEt_READONLY_OFF SAVEt_SAVESWITCHSTACK
d8ca50cb
FC
4 SAVEt_STACK_CXPOS ];
5@TODO{@TODO} = ();
6
7BEGIN { chdir 't'; require './test.pl' }
8
9sub read_cases {
10 my ($file, $func) = @_;
11
12 open my $fh, $file or die "$0 cannot open $file: $!";
13
14 while (readline $fh) {
15 last if /^Perl_$func/;
16 }
17 my %found;
18 while (readline $fh) {
19 last if /^}/;
20 $found{$1}++ if /case (SAVEt_\w*):/;
21 }
22 close $fh or die "$0 cannot close $file: $!";
23 \%found;
24}
25
26my $leave_scope = read_cases "../scope.c", "leave_scope";
27my $ss_dup = read_cases "../sv.c", "ss_dup";
28
29ok scalar %$leave_scope, 'we got some';
30
31for (sort keys %$leave_scope) {
32 local $::TODO = ' ' if exists $TODO{$_};
33 ok exists $$ss_dup{$_}, "ss_dup handles $_";
34}
35
36done_testing;