16fb12b70Safresh1#!perl 26fb12b70Safresh1 36fb12b70Safresh1@TODO = qw [ SAVEt_SAVESWITCHSTACK ]; 46fb12b70Safresh1@TODO{@TODO} = (); 56fb12b70Safresh1 6*b8851fccSafresh1BEGIN { chdir 't'; @INC = "../lib"; require './test.pl' } 76fb12b70Safresh1use Config; 86fb12b70Safresh1 96fb12b70Safresh1if ( $Config{usecrosscompile} ) { 106fb12b70Safresh1 skip_all( "Not all files are available during cross-compilation" ); 116fb12b70Safresh1} 126fb12b70Safresh1 136fb12b70Safresh1sub read_cases { 146fb12b70Safresh1 my ($file, $func) = @_; 156fb12b70Safresh1 166fb12b70Safresh1 open my $fh, $file or die "$0 cannot open $file: $!"; 176fb12b70Safresh1 186fb12b70Safresh1 while (readline $fh) { 196fb12b70Safresh1 last if /^Perl_$func/; 206fb12b70Safresh1 } 216fb12b70Safresh1 my %found; 226fb12b70Safresh1 while (readline $fh) { 236fb12b70Safresh1 last if /^}/; 246fb12b70Safresh1 $found{$1}++ if /case (SAVEt_\w*):/; 256fb12b70Safresh1 } 266fb12b70Safresh1 close $fh or die "$0 cannot close $file: $!"; 276fb12b70Safresh1 \%found; 286fb12b70Safresh1} 296fb12b70Safresh1 306fb12b70Safresh1my $leave_scope = read_cases "../scope.c", "leave_scope"; 316fb12b70Safresh1my $ss_dup = read_cases "../sv.c", "ss_dup"; 326fb12b70Safresh1 336fb12b70Safresh1ok scalar %$leave_scope, 'we got some'; 346fb12b70Safresh1 356fb12b70Safresh1for (sort keys %$leave_scope) { 366fb12b70Safresh1 local $::TODO = ' ' if exists $TODO{$_}; 376fb12b70Safresh1 ok exists $$ss_dup{$_}, "ss_dup handles $_"; 386fb12b70Safresh1} 396fb12b70Safresh1 406fb12b70Safresh1done_testing; 41