diff --git a/test_regress/t/t_cover_lib_1.out b/test_regress/t/t_cover_lib_1.out
index 71fdbee4b..d757bf25a 100644
--- a/test_regress/t/t_cover_lib_1.out
+++ b/test_regress/t/t_cover_lib_1.out
@@ -1,4 +1,4 @@
 # SystemC::Coverage-3
-C 'f../../t/t_cover_lib_c.cppl35pagesp_user/t_cover_lib_cokept_onehmain' 100
-C 'f../../t/t_cover_lib_c.cppl36pagesp_user/t_cover_lib_cokept_twohmain' 210
-C 'f../../t/t_cover_lib_c.cppl37pagesp_user/t_cover_lib_colost_threehmain' 220
+C 'f../../t/t_cover_lib_c.cppl44pagesp_user/t_cover_lib_cokept_onehmain' 100
+C 'f../../t/t_cover_lib_c.cppl45pagesp_user/t_cover_lib_cokept_twohmain' 210
+C 'f../../t/t_cover_lib_c.cppl46pagesp_user/t_cover_lib_colost_threehmain' 220
diff --git a/test_regress/t/t_cover_lib_2.out b/test_regress/t/t_cover_lib_2.out
index 445668d78..42ec9a18e 100644
--- a/test_regress/t/t_cover_lib_2.out
+++ b/test_regress/t/t_cover_lib_2.out
@@ -1,3 +1,3 @@
 # SystemC::Coverage-3
-C 'f../../t/t_cover_lib_c.cppl35pagesp_user/t_cover_lib_cokept_onehmain' 100
-C 'f../../t/t_cover_lib_c.cppl36pagesp_user/t_cover_lib_cokept_twohmain' 210
+C 'f../../t/t_cover_lib_c.cppl44pagesp_user/t_cover_lib_cokept_onehmain' 100
+C 'f../../t/t_cover_lib_c.cppl45pagesp_user/t_cover_lib_cokept_twohmain' 210
diff --git a/test_regress/t/t_cover_lib_3.out b/test_regress/t/t_cover_lib_3.out
index e04cf5d1c..78bddf206 100644
--- a/test_regress/t/t_cover_lib_3.out
+++ b/test_regress/t/t_cover_lib_3.out
@@ -1,3 +1,3 @@
 # SystemC::Coverage-3
-C 'f../../t/t_cover_lib_c.cppl35pagesp_user/t_cover_lib_cokept_onehmain' 0
-C 'f../../t/t_cover_lib_c.cppl36pagesp_user/t_cover_lib_cokept_twohmain' 0
+C 'f../../t/t_cover_lib_c.cppl44pagesp_user/t_cover_lib_cokept_onehmain' 0
+C 'f../../t/t_cover_lib_c.cppl45pagesp_user/t_cover_lib_cokept_twohmain' 0
diff --git a/test_regress/t/t_cover_lib_c.cpp b/test_regress/t/t_cover_lib_c.cpp
index cce1893b6..4f7b08dfe 100644
--- a/test_regress/t/t_cover_lib_c.cpp
+++ b/test_regress/t/t_cover_lib_c.cpp
@@ -18,10 +18,17 @@
 
 #include VM_PREFIX_INCLUDE
 
-double sc_time_stamp() { return 0; }
+#define CHECK_RESULT_CSTR(got, exp) \
+    if (strcmp((got), (exp))) { \
+        printf("%%Error: %s:%d: GOT = '%s'   EXP = '%s'\n", __FILE__, __LINE__, \
+               (got) ? (got) : "<null>", (exp) ? (exp) : "<null>"); \
+        ++failure; \
+    }
 
 //======================================================================
 
+double sc_time_stamp() { return 0; }
+
 int failure = 0;
 
 //======================================================================
@@ -32,6 +39,8 @@ int main() {
     vluint32_t covers[1];
     vluint64_t coverw[2];
 
+    //
+
     VL_COVER_INSERT(&covers[0], "comment", "kept_one");
     VL_COVER_INSERT(&coverw[0], "comment", "kept_two");
     VL_COVER_INSERT(&coverw[1], "comment", "lost_three");
@@ -40,6 +49,7 @@ int main() {
     coverw[0] = 210;
     coverw[1] = 220;
 
+    CHECK_RESULT_CSTR(VerilatedCov::defaultFilename(), "coverage.dat");
     VerilatedCov::write(VL_STRINGIFY(TEST_OBJ_DIR) "/coverage1.dat");
     VerilatedCov::clearNonMatch("kept_");
     VerilatedCov::write(VL_STRINGIFY(TEST_OBJ_DIR) "/coverage2.dat");
diff --git a/test_regress/t/t_cover_lib_legacy.pl b/test_regress/t/t_cover_lib_legacy.pl
new file mode 100755
index 000000000..9d53f269e
--- /dev/null
+++ b/test_regress/t/t_cover_lib_legacy.pl
@@ -0,0 +1,33 @@
+#!/usr/bin/env perl
+if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
+# DESCRIPTION: Verilator: Verilog Test driver/expect definition
+#
+# Copyright 2003 by Wilson Snyder. This program is free software; you
+# can redistribute it and/or modify it under the terms of either the GNU
+# Lesser General Public License Version 3 or the Perl Artistic License
+# Version 2.0.
+# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
+
+scenarios(vlt => 1);
+
+top_filename("t/t_cover_lib.v");
+
+compile(
+    v_flags2 => ["--coverage t/t_cover_lib_c.cpp"],
+    verilator_flags2 => ["--exe -Wall -Wno-DECLFILENAME"],
+    make_flags => 'CPPFLAGS_ADD=-DTEST_OBJ_DIR="'.$Self->{obj_dir}.'"',
+    make_top_shell => 0,
+    make_main => 0,
+    );
+
+execute(
+    check_finished => 1,
+    );
+
+files_identical_sorted("$Self->{obj_dir}/coverage1.dat", "t/t_cover_lib_1.out");
+files_identical_sorted("$Self->{obj_dir}/coverage2.dat", "t/t_cover_lib_2.out");
+files_identical_sorted("$Self->{obj_dir}/coverage3.dat", "t/t_cover_lib_3.out");
+files_identical_sorted("$Self->{obj_dir}/coverage4.dat", "t/t_cover_lib_4.out");
+
+ok(1);
+1;
