Tests: Fix t_flag_csplit skip on old make.

This commit is contained in:
Wilson Snyder 2019-06-29 08:25:50 -04:00
parent 2fff92fe78
commit a2c1b7f827

View File

@ -9,10 +9,14 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di
scenarios(vlt_all => 1);
while (1) {
# Thi rule requires GNU make > 4.1 (or so, known broken in 3.81)
#%__Slow.o: %__Slow.cpp
# $(OBJCACHE) $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPT_SLOW) -c -o $@ $<
make_version() < 4.1 and unsupported("Verilator unsupported, require GNU Make version >= 4.1");
if (make_version() < 4.1) {
skip("Test requires GNU Make version >= 4.1");
last;
}
compile(
v_flags2 => ["--trace --output-split 1 --output-split-cfuncs 1 --exe ../$Self->{main_filename}"],
@ -40,17 +44,12 @@ execute(
check_finished => 1,
);
{
my $got1;
foreach my $file (glob("$Self->{obj_dir}/*.cpp")) {
$got1 = 1 if $file =~ /__1/;
check_cpp($file);
}
$got1 or error("No __1 split file found");
}
check_splits();
check_gcc_flags("$Self->{obj_dir}/vlt_gcc.log");
ok(1);
last;
}
1;
sub make_version {
@ -62,6 +61,15 @@ sub make_version {
}
}
sub check_splits {
my $got1;
foreach my $file (glob("$Self->{obj_dir}/*.cpp")) {
$got1 = 1 if $file =~ /__1/;
check_cpp($file);
}
$got1 or error("No __1 split file found");
}
sub check_cpp {
my $filename = shift;
my $size = -s $filename;