Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit b6ce966

Browse files
committed
B-C: Update to 1.55_02
Mostly test TODO improvements
1 parent dc4c269 commit b6ce966

File tree

12 files changed

+73
-44
lines changed

12 files changed

+73
-44
lines changed

Porting/Maintainers.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ package Maintainers;
179179
},
180180

181181
'B::C' => {
182-
'DISTRIBUTION' => 'RURBAN/B-C-1.54_15.tar.gz',
182+
'DISTRIBUTION' => 'RURBAN/B-C-1.55_02.tar.gz',
183183
'FILES' => q[cpan/B-C],
184184
'EXCLUDED' => [
185185
qr{^.gdb},

cpan/B-C/lib/B/Assembler.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ require ByteLoader; # we just need its $VERSION
1717
no warnings; # XXX
1818

1919
@ISA = qw(Exporter);
20-
@EXPORT_OK = qw(assemble_fh newasm endasm assemble asm maxopix maxsvix);
21-
$VERSION = '1.13';
20+
our @EXPORT_OK = qw(assemble_fh newasm endasm assemble asm maxopix maxsvix);
21+
our $VERSION = '1.13';
2222

2323
use strict;
2424
my %opnumber;

cpan/B-C/lib/B/Bblock.pm

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ package B::Bblock;
44
our $VERSION = '1.05';
55

66
use Exporter ();
7-
@ISA = "Exporter";
7+
@ISA = "Exporter";
88
our @EXPORT_OK = qw(find_leaders);
99

1010
use B qw(peekop walkoptree walkoptree_exec
@@ -15,8 +15,10 @@ use strict;
1515

1616
my $bblock;
1717
my @bblock_ends;
18-
sub CPERL56 () { ( $Config::Config{usecperl} and $] >= 5.025003 ) } #sibparent, xpad_cop_seq
19-
sub PUSHRE () { ($] >= 5.025006 or CPERL56) ? "split" : "pushre" }
18+
# don't load Config with its dependencies
19+
use B::C ();
20+
sub CPERL56 () { ($B::C::Config::Config{usecperl} and $] >= 5.025003) ? 1 : 0 } #sibparent, xpad_cop_seq
21+
sub PUSHRE () { ($] >= 5.025006 or CPERL56) ? "split" : "pushre" }
2022

2123
sub mark_leader {
2224
my $op = shift;

cpan/B-C/lib/B/Bytecode.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ sub nice1 ($) { }
8787
my %optype_enum;
8888
my ($SVt_PVGV, $SVf_FAKE, $POK);
8989
if ($PERL56) {
90-
sub dowarn {};
90+
*dowarn = sub {};
9191
$SVt_PVGV = 13;
9292
$SVf_FAKE = 0x00100000;
9393
$POK = 0x00040000 | 0x04000000;
@@ -115,7 +115,7 @@ for ( my $i = 0 ; $i < @optype ; $i++ ) {
115115
}
116116

117117
BEGIN {
118-
my $ithreads = $Config::Config{'useithreads'} eq 'define';
118+
my $ithreads = defined $Config::Config{'useithreads'} && $Config::Config{'useithreads'} eq 'define';
119119
eval qq{
120120
sub ITHREADS() { $ithreads }
121121
sub VERSION() { $] }
@@ -183,7 +183,7 @@ sub sv_flags($;$) {
183183

184184
# TODO: Check with which Concise and B versions this works. 5.10.0 fails.
185185
# B::Concise 0.66 fails also
186-
sub B::Concise::fmt_line { return shift; }
186+
*B::Concise::fmt_line = sub { return shift };
187187
my $op = $ops{ $tix - 1 };
188188
if (ref $op and !$op->targ) { # targ assumes a valid curcv
189189
%h = B::Concise::concise_op( $op );
@@ -957,7 +957,7 @@ sub B::OP::bsave_thin {
957957
if ($] >= 5.019002 and $op->can('folded')) {
958958
asm "op_folded", $op->folded if $op->folded;
959959
}
960-
if ($] >= 5.021002 and $[ < 5.021011 and $op->can('lastsib')) {
960+
if ($] >= 5.021002 and $] < 5.021011 and $op->can('lastsib')) {
961961
asm "op_lastsib", $op->lastsib if $op->lastsib;
962962
}
963963
elsif ($] >= 5.021011 and $op->can('moresib')) {

cpan/B-C/lib/B/C.pm

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
package B::C;
1313
use strict;
1414

15-
our $VERSION = '1.54_17';
15+
our $VERSION = '1.55_02';
1616
our (%debug, $check, %Config);
1717
BEGIN {
1818
require B::C::Config;
@@ -555,11 +555,10 @@ my @threadsv_names;
555555

556556
BEGIN {
557557
@threadsv_names = threadsv_names();
558+
# This the Carp free workaround for DynaLoader::bootstrap
559+
eval 'sub DynaLoader::croak {die @_}' unless $CPERL51;
558560
}
559561

560-
# This the Carp free workaround for DynaLoader::bootstrap
561-
sub DynaLoader::croak {die @_}
562-
563562
# needed for init2 remap and Dynamic annotation
564563
sub dl_module_to_sofile {
565564
my $module = shift
@@ -1507,7 +1506,7 @@ sub B::OP::_save_common {
15071506
if ($op->type == $OP_CUSTOM) {
15081507
warn sprintf("CUSTOM OP %s $op\n", $op->name) if $verbose;
15091508
}
1510-
# $prev_op = $op;
1509+
$prev_op = $op;
15111510
my $sibling;
15121511
if ($have_sibparent and !$op->moresib) { # HAS_SIBLING
15131512
$sibling = $op->parent;
@@ -2315,7 +2314,9 @@ sub B::COP::save {
23152314

23162315
$level = 0 unless $level;
23172316
# we need to keep CvSTART cops, so check $level == 0
2318-
if ($optimize_cop and $level and !$op->label) { # XXX very unsafe!
2317+
# what a COP needs to do is to reset the stack, and restore locals
2318+
if ($optimize_cop and $level and !$op->label
2319+
and ref($prev_op) ne 'B::LISTOP') { # XXX very unsafe!
23192320
my $sym = savesym( $op, $op->next->save );
23202321
warn sprintf( "Skip COP (0x%x) => %s (0x%x), line %d file %s\n",
23212322
$$op, $sym, $op->next, $op->line, $op->file ) if $debug{cops};

cpan/B-C/lib/B/CC.pm

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,10 +1816,13 @@ sub pp_gvsv {
18161816
else {
18171817
$gvsym = $op->gv->save;
18181818
}
1819+
write_back_stack();
18191820
# Expects GV*, not SV* PL_curpad
18201821
$gvsym = "(GV*)$gvsym" if $gvsym =~ /PL_curpad/;
1821-
write_back_stack();
1822-
if ( $op->private & OPpLVAL_INTRO ) {
1822+
if ($gvsym eq '(SV*)&PL_sv_undef') {
1823+
runtime("XPUSHs($gvsym);");
1824+
}
1825+
elsif ( $op->private & OPpLVAL_INTRO ) {
18231826
runtime("XPUSHs(save_scalar($gvsym));");
18241827
#my $obj = new B::Stackobj::Const($op->gv);
18251828
#push( @stack, $obj );

cpan/B-C/lib/B/Disassembler.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ sub GET_pmflags {
216216
package B::Disassembler;
217217
use Exporter;
218218
@ISA = qw(Exporter);
219-
@EXPORT_OK = qw(disassemble_fh get_header print_insn print_insn_bare @opname);
219+
our @EXPORT_OK = qw(disassemble_fh get_header print_insn print_insn_bare @opname);
220220
use Carp;
221221
use strict;
222222
use B::Asmdata qw(%insn_data @insn_name);

cpan/B-C/lib/B/Stackobj.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ our $VERSION = '1.12_01';
1313

1414
use Exporter ();
1515
@ISA = qw(Exporter);
16-
@EXPORT_OK = qw(set_callback T_UNKNOWN T_NUM T_INT T_STR VALID_UNSIGNED
16+
our @EXPORT_OK = qw(set_callback T_UNKNOWN T_NUM T_INT T_STR VALID_UNSIGNED
1717
VALID_INT VALID_NUM VALID_STR VALID_SV REGISTER TEMPORARY);
18-
%EXPORT_TAGS = (
18+
our %EXPORT_TAGS = (
1919
types => [qw(T_UNKNOWN T_NUM T_INT T_STR)],
2020
flags => [
2121
qw(VALID_INT VALID_NUM VALID_STR VALID_SV

cpan/B-C/t/TestBC.pm

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,10 @@ sub run_cc_test {
790790
($fnbackend,$opt) = $fnbackend =~ /^(cc?)(,-o.)?/;
791791
$opt =~ s/,-/_/ if $opt;
792792
$opt = '' unless $opt;
793-
#if ($] > 5.021006 and $fnbackend eq 'cc') { print "ok $cnt # skip CC for 5.22 WIP\n"; return 1; }
793+
#if ($] > 5.023007 and $fnbackend eq 'cc' and !$Config{usecperl}) {
794+
#print "ok $cnt # skip CC for 5.24\n";
795+
#return 1;
796+
#}
794797
use Config;
795798
require B::C::Config;
796799
# note that the smokers run the c.t and c_o3.t tests in parallel, with possible
@@ -920,8 +923,8 @@ sub run_cc_test {
920923
return 1;
921924
}
922925
}
923-
if ($todo and $todo =~ /TODO/) {
924-
$todo =~ s/TODO //;
926+
if ($todo and $todo =~ /TODO /) {
927+
$todo =~ s/TODO //g;
925928
TODO:
926929
{
927930
local $TODO = $todo;
@@ -939,16 +942,21 @@ sub run_cc_test {
939942
($result,$out,$stderr) = run_cmd($exe, 5);
940943
if (defined($out) and !$result) {
941944
if ($out =~ /^$expect$/) {
942-
ok(1, $todo eq '#' ? "" : " $todo");
945+
if ($todo eq '#') {
946+
ok(1);
947+
} else {
948+
ok(1, $todo);
949+
}
943950
unlink ($test, $cfile, $exe, @obj) unless $keep_c;
944951
return 1;
945952
} else {
946953
# cc test failed, double check uncompiled
947-
$got = run_perl(verbose => $ENV{TEST_VERBOSE}, # for debugging
948-
nolib => $ENV{PERL_CORE} ? 0 : 1, # include ../lib only in CORE
949-
stderr => 1, # to capture the "ccode.pl syntax ok"
950-
timeout => 10,
951-
progfile => $test);
954+
$got = run_perl
955+
(verbose => $ENV{TEST_VERBOSE}, # for debugging
956+
nolib => $ENV{PERL_CORE} ? 0 : 1, # include ../lib only in CORE
957+
stderr => 1, # to capture the "ccode.pl syntax ok"
958+
timeout => 10,
959+
progfile => $test);
952960
if (! $? and $got =~ /^$expect$/) {
953961
ok(1, "$todo wanted: \"$expect\", got: \"$out\"");
954962
} else {
@@ -963,11 +971,11 @@ sub run_cc_test {
963971
}
964972
}
965973
if ($todo and $todo =~ /TODO/) {
966-
$todo =~ s/TODO //;
974+
$todo =~ s/#TODO//g;
967975
TODO:
968976
{
969-
local $TODO = $todo;
970-
ok(0, "$todo wanted: \"$expect\", \$\? = $?, got: \"$out\"");
977+
local $TODO = $todo ? $todo : $];
978+
ok(0, "wanted: \"$expect\", \$\? = $?, got: \"$out\"");
971979
}
972980
} else {
973981
ok(0, "wanted: \"$expect\", \$\? = $?, got: \"$out\"");
@@ -1149,7 +1157,7 @@ sub plctest {
11491157
chomp $out;
11501158
my $ok = $out =~ /$expected/;
11511159
if ($todo and $todo =~ /TODO/) {
1152-
$todo =~ s/TODO //;
1160+
$todo =~ s/TODO //g;
11531161
TODO: {
11541162
local $TODO = $todo;
11551163
ok($ok);
@@ -1172,7 +1180,11 @@ sub ctest {
11721180
my ($num, $expected, $backend, $base, $script, $todo) = @_;
11731181
my $name = $base."_$num";
11741182
my $b = $backend; # protect against parallel test name clashes
1175-
#if ($] > 5.021006 and $backend =~ /^CC/i) { ok(1, "skip CC for 5.22 WIP"); return 1; } # temp 5.22
1183+
my $CPERL = $Config{usecperl};
1184+
#if ($] > 5.021006 and $backend =~ /^CC/i) { ok(1, "skip CC for 5.22 WIP"); return 1; }
1185+
#if ($] >= 5.025 and !$CPERL and $todo !~ /TODO /) {
1186+
# $todo .= 'TODO - no 5.26 yet';
1187+
#}
11761188
$b =~ s/-(D.*|f.*|v),//g;
11771189
$b =~ s/-/_/g;
11781190
$b =~ s/[, ]//g;
@@ -1212,7 +1224,7 @@ sub ctest {
12121224
ok(1, "skip MSVC"); return 1;
12131225
}
12141226
if ($todo and $todo =~ /TODO/) {
1215-
$todo =~ s/TODO //;
1227+
$todo =~ s/TODO //g;
12161228
TODO: {
12171229
local $TODO = $todo;
12181230
ok(undef, "failed to compile");
@@ -1237,7 +1249,7 @@ sub ctest {
12371249
}
12381250
}
12391251
if ($todo and $todo =~ /TODO/) {
1240-
$todo =~ s/TODO //;
1252+
$todo =~ s/TODO //g;
12411253
TODO: {
12421254
local $TODO = $todo;
12431255
ok ($out =~ /$expected/);
@@ -1248,7 +1260,7 @@ sub ctest {
12481260
}
12491261
} else {
12501262
if ($todo and $todo =~ /TODO/) {
1251-
$todo =~ s/TODO //;
1263+
$todo =~ s/TODO //g;
12521264
TODO: {
12531265
local $TODO = $todo;
12541266
ok (undef);
@@ -1291,7 +1303,7 @@ sub ccompileok {
12911303
my $ok = -e $name or -e "$name.exe";
12921304
if ($todo and $todo =~ /TODO/) {
12931305
TODO: {
1294-
$todo =~ s/TODO //;
1306+
$todo =~ s/TODO //g;
12951307
local $TODO = $todo;
12961308
ok($ok);
12971309
}
@@ -1308,6 +1320,7 @@ sub todo_tests_default {
13081320
my $what = shift;
13091321
my $DEBUGGING = ($Config{ccflags} =~ m/-DDEBUGGING/);
13101322
my $ITHREADS = ($Config{useithreads});
1323+
my $CPERL = ($Config{usecperl});
13111324

13121325
my @todo = ();
13131326
# no IO::Scalar
@@ -1317,6 +1330,7 @@ sub todo_tests_default {
13171330
push @todo, 28 if $] > 5.023 and
13181331
($Config{cc} =~ / -m32/ or $Config{ccflags} =~ / -m32/);
13191332
push @todo, (21, 38) if $^O eq 'cygwin'; #hangs
1333+
push @todo, (15,27,41..45) if $] >= 5.025 and !$CPERL;
13201334

13211335
if ($what =~ /^c(|_o[1-4])$/) {
13221336
# a regression
@@ -1326,6 +1340,7 @@ sub todo_tests_default {
13261340
#push @todo, (48) if $] >= 5.018; # opfree
13271341
push @todo, (48) if $what eq 'c_o4' and $] < 5.021 and $ITHREADS;
13281342
push @todo, (8,18,19,25,26,28) if $what eq 'c_o4' and !$ITHREADS;
1343+
#push @todo, (10) if $what eq 'c_o4' and $] > 5.023;
13291344
push @todo, (29) if $] >= 5.021006 and $ITHREADS;
13301345
push @todo, (10,15,27,41,42,43,44,45,49,50)
13311346
if $] >= 5.021006 and $what eq 'c_o4';
@@ -1351,10 +1366,11 @@ sub todo_tests_default {
13511366
#push @todo, (27) if $] > 5.008008 and $] < 5.009 and $what eq 'cc_o2';
13521367
push @todo, (103) if ($] >= 5.012 and $] < 5.014 and !$ITHREADS);
13531368
push @todo, (12,19) if $] >= 5.019; # XXX had 25 also
1354-
push @todo, (25) if $] >= 5.021006 and !$Config{usecperl};
1369+
push @todo, (25) if $] >= 5.021006 and !$CPERL;
13551370
push @todo, (29) if $] >= 5.021006 and $what eq 'cc_o1';
13561371
push @todo, (24,29) if $] >= 5.021006 and $what eq 'cc_o2';
1357-
push @todo, (103) if ($Config{usecperl} and $ITHREADS);
1372+
push @todo, (103) if $CPERL and $ITHREADS;
1373+
push @todo, (9,10,15,24,26,27,41..45,103) if $] > 5.023007 and !$CPERL;
13581374
}
13591375
push @todo, (48) if $] > 5.007 and $] < 5.009 and $^O =~ /MSWin32|cygwin/i;
13601376
return @todo;

0 commit comments

Comments
 (0)