diff --git a/test_regress/driver.pl b/test_regress/driver.pl index 48650baa1..48fd12a05 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -1845,7 +1845,7 @@ sub _make_main { $fh->print(" if (sc_time_stamp() == save_time && save_time) {\n"); $fh->print(" save_model(\"$self->{obj_dir}/saved.vltsv\");\n"); $fh->print(" printf(\"Exiting after save_model\\n\");\n"); - $fh->print(" exit(0);\n"); + $fh->print(" return 0;\n"); $fh->print(" }\n"); } _print_advance_time($self, $fh, 1, $action); @@ -1870,7 +1870,7 @@ sub _make_main { $fh->print("\n"); print $fh " topp.reset();\n"; - print $fh " exit(0L);\n"; + print $fh " return 0;\n"; print $fh "}\n"; $fh->close(); } diff --git a/test_regress/t/t_cover_lib_c.cpp b/test_regress/t/t_cover_lib_c.cpp index a9168e483..cce1893b6 100644 --- a/test_regress/t/t_cover_lib_c.cpp +++ b/test_regress/t/t_cover_lib_c.cpp @@ -49,5 +49,5 @@ int main() { VerilatedCov::write(VL_STRINGIFY(TEST_OBJ_DIR) "/coverage4.dat"); printf("*-* All Finished *-*\n"); - exit(failure ? 10 : 0); + return (failure ? 10 : 0); } diff --git a/test_regress/t/t_dpi_var.cpp b/test_regress/t/t_dpi_var.cpp index 16241b904..f62388ccb 100644 --- a/test_regress/t/t_dpi_var.cpp +++ b/test_regress/t/t_dpi_var.cpp @@ -144,5 +144,5 @@ int main(int argc, char** argv, char** env) { topp->final(); VL_DO_DANGLING(delete topp, topp); - exit(0L); + return 0; } diff --git a/test_regress/t/t_math_imm2.cpp b/test_regress/t/t_math_imm2.cpp index 191b4eafa..1238fff1f 100644 --- a/test_regress/t/t_math_imm2.cpp +++ b/test_regress/t/t_math_imm2.cpp @@ -54,6 +54,6 @@ int main(int argc, char* argv[]) { exit(10); } else { printf("*-* All Finished *-*\n"); - exit(0); + return 0; } } diff --git a/test_regress/t/t_runflag_uninit_bad.cpp b/test_regress/t/t_runflag_uninit_bad.cpp index 2a389c6e1..e1484272f 100644 --- a/test_regress/t/t_runflag_uninit_bad.cpp +++ b/test_regress/t/t_runflag_uninit_bad.cpp @@ -24,5 +24,5 @@ int main(int argc, char* argv[]) { // We aren't calling Verilated::commandArgs(argc, argv) topp->eval(); - exit(0); + return 0; } diff --git a/test_regress/t/t_savable_open_bad2.cpp b/test_regress/t/t_savable_open_bad2.cpp index 0e4c383cc..1fb06a851 100644 --- a/test_regress/t/t_savable_open_bad2.cpp +++ b/test_regress/t/t_savable_open_bad2.cpp @@ -44,5 +44,5 @@ int main(int argc, char* argv[]) { CHECK_RESULT_HEX(os.isOpen(), false); } - exit(0); + return 0; } diff --git a/test_regress/t/t_trace_two_cc.cpp b/test_regress/t/t_trace_two_cc.cpp index 3b4fc5f3d..87c7ebb5f 100644 --- a/test_regress/t/t_trace_two_cc.cpp +++ b/test_regress/t/t_trace_two_cc.cpp @@ -94,5 +94,5 @@ int main(int argc, char** argv, char** env) { VL_DO_DANGLING(delete ap, ap); VL_DO_DANGLING(delete bp, bp); - exit(0L); + return 0; } diff --git a/test_regress/t/t_trace_two_sc.cpp b/test_regress/t/t_trace_two_sc.cpp index ebfffc68d..6d0c0e125 100644 --- a/test_regress/t/t_trace_two_sc.cpp +++ b/test_regress/t/t_trace_two_sc.cpp @@ -67,5 +67,5 @@ int sc_main(int argc, char** argv) { VL_DO_DANGLING(delete ap, ap); VL_DO_DANGLING(delete bp, bp); - exit(0L); + return 0; } diff --git a/test_regress/t/t_var_overwidth_bad.cpp b/test_regress/t/t_var_overwidth_bad.cpp index 30573b0b4..2aa7d801a 100644 --- a/test_regress/t/t_var_overwidth_bad.cpp +++ b/test_regress/t/t_var_overwidth_bad.cpp @@ -34,5 +34,5 @@ int main(int argc, char** argv, char** env) { topp->final(); VL_DO_DANGLING(delete topp, topp); - exit(0L); + return 0; } diff --git a/test_regress/t/t_vpi_cb_iter.cpp b/test_regress/t/t_vpi_cb_iter.cpp index 7ef5df92d..b71f33ff6 100644 --- a/test_regress/t/t_vpi_cb_iter.cpp +++ b/test_regress/t/t_vpi_cb_iter.cpp @@ -200,5 +200,5 @@ int main(int argc, char** argv, char** env) { topp->final(); VL_DO_DANGLING(delete topp, topp); - exit(0L); + return 0; } diff --git a/test_regress/t/t_vpi_cbs_called.cpp b/test_regress/t/t_vpi_cbs_called.cpp index 79d62e3ae..3b81b1840 100644 --- a/test_regress/t/t_vpi_cbs_called.cpp +++ b/test_regress/t/t_vpi_cbs_called.cpp @@ -308,5 +308,5 @@ int main(int argc, char** argv, char** env) { topp->final(); VL_DO_DANGLING(delete topp, topp); - exit(0L); + return 0; } diff --git a/test_regress/t/t_vpi_get.cpp b/test_regress/t/t_vpi_get.cpp index 451af15e3..ba97e83fb 100644 --- a/test_regress/t/t_vpi_get.cpp +++ b/test_regress/t/t_vpi_get.cpp @@ -278,7 +278,7 @@ int main(int argc, char** argv, char** env) { #endif VL_DO_DANGLING(delete topp, topp); - exit(0L); + return 0; } #endif diff --git a/test_regress/t/t_vpi_memory.cpp b/test_regress/t/t_vpi_memory.cpp index 51dcb3a57..c420baebc 100644 --- a/test_regress/t/t_vpi_memory.cpp +++ b/test_regress/t/t_vpi_memory.cpp @@ -291,7 +291,7 @@ int main(int argc, char** argv, char** env) { #endif VL_DO_DANGLING(delete topp, topp); - exit(0L); + return 0; } #endif diff --git a/test_regress/t/t_vpi_module.cpp b/test_regress/t/t_vpi_module.cpp index 8bc9afe0e..7c00dcbf5 100644 --- a/test_regress/t/t_vpi_module.cpp +++ b/test_regress/t/t_vpi_module.cpp @@ -220,7 +220,7 @@ int main(int argc, char** argv, char** env) { #endif VL_DO_DANGLING(delete topp, topp); - exit(0L); + return 0; } #endif diff --git a/test_regress/t/t_vpi_param.cpp b/test_regress/t/t_vpi_param.cpp index 731aaf625..ac6275b15 100644 --- a/test_regress/t/t_vpi_param.cpp +++ b/test_regress/t/t_vpi_param.cpp @@ -288,7 +288,7 @@ int main(int argc, char** argv, char** env) { #endif VL_DO_DANGLING(delete topp, topp); - exit(0L); + return 0; } #endif diff --git a/test_regress/t/t_vpi_time_cb.cpp b/test_regress/t/t_vpi_time_cb.cpp index 5e1c407f2..e3f9748a5 100644 --- a/test_regress/t/t_vpi_time_cb.cpp +++ b/test_regress/t/t_vpi_time_cb.cpp @@ -258,7 +258,7 @@ int main(int argc, char** argv, char** env) { #endif VL_DO_DANGLING(delete topp, topp); - exit(0L); + return 0; } #endif diff --git a/test_regress/t/t_vpi_unimpl.cpp b/test_regress/t/t_vpi_unimpl.cpp index c9a6d3bda..5706be271 100644 --- a/test_regress/t/t_vpi_unimpl.cpp +++ b/test_regress/t/t_vpi_unimpl.cpp @@ -233,5 +233,5 @@ int main(int argc, char** argv, char** env) { #endif VL_DO_DANGLING(delete topp, topp); - exit(0L); + return 0; } diff --git a/test_regress/t/t_vpi_var.cpp b/test_regress/t/t_vpi_var.cpp index 3698d0751..d9ec774b2 100644 --- a/test_regress/t/t_vpi_var.cpp +++ b/test_regress/t/t_vpi_var.cpp @@ -67,6 +67,12 @@ bool verbose = false; return __LINE__; \ } +#define CHECK_RESULT_Z(got) \ + if ((got)) { \ + printf("%%Error: %s:%d: GOT = !NULL EXP = NULL\n", FILENM, __LINE__); \ + return __LINE__; \ + } + // Use cout to avoid issues with %d/%lx etc #define CHECK_RESULT(got, exp) \ if ((got) != (exp)) { \ @@ -624,6 +630,7 @@ int _mon_check_vlog_info() { CHECK_RESULT_CSTR(vlog_info.argv[1], "+PLUS"); CHECK_RESULT_CSTR(vlog_info.argv[2], "+INT=1234"); CHECK_RESULT_CSTR(vlog_info.argv[3], "+STRSTR"); + CHECK_RESULT_Z(vlog_info.argv[4]); if (TestSimulator::is_verilator()) { CHECK_RESULT_CSTR(vlog_info.product, "Verilator"); CHECK_RESULT(strlen(vlog_info.version) > 0, 1); @@ -734,7 +741,7 @@ int main(int argc, char** argv, char** env) { #endif VL_DO_DANGLING(delete topp, topp); - exit(0L); + return 0; } #endif diff --git a/test_regress/t/t_vpi_zero_time_cb.cpp b/test_regress/t/t_vpi_zero_time_cb.cpp index 0c500906c..1c1f15e5d 100644 --- a/test_regress/t/t_vpi_zero_time_cb.cpp +++ b/test_regress/t/t_vpi_zero_time_cb.cpp @@ -180,7 +180,7 @@ int main(int argc, char** argv, char** env) { #endif VL_DO_DANGLING(delete topp, topp); - exit(0L); + return 0; } #endif