diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 3710dfd3a..f5e141701 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -1467,7 +1467,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char i += consumed; } else { fl->v3fatal("Invalid option: " << argv[i] << parser.getSuggestion(argv[i])); - ++i; + ++i; // LCOV_EXCL_LINE } } else { // Filename @@ -1643,21 +1643,6 @@ string V3Options::parseFileArg(const string& optdir, const string& relfilename) //====================================================================== -//! Utility to see if we have a language extension argument and if so add it. -bool V3Options::parseLangExt(const char* swp, //!< argument text - const char* langswp, //!< option to match - const V3LangCode& lc) { //!< language code - const int len = strlen(langswp); - if (!strncmp(swp, langswp, len)) { - addLangExt(swp + len, lc); - return true; - } else { - return false; - } -} - -//====================================================================== - void V3Options::showVersion(bool verbose) { cout << version(); cout << endl; diff --git a/src/V3Options.h b/src/V3Options.h index b8b2c7082..3668fe605 100644 --- a/src/V3Options.h +++ b/src/V3Options.h @@ -376,7 +376,6 @@ private: void coverage(bool flag) { m_coverageLine = m_coverageToggle = m_coverageUser = flag; } static bool suffixed(const string& sw, const char* arg); static string parseFileArg(const string& optdir, const string& relfilename); - bool parseLangExt(const char* swp, const char* langswp, const V3LangCode& lc); string filePathCheckOneDir(const string& modname, const string& dirname); static int stripOptionsForChildRun(const string& opt, bool forTop); diff --git a/src/VlcMain.cpp b/src/VlcMain.cpp index f29fef2c4..f8c57d7c8 100644 --- a/src/VlcMain.cpp +++ b/src/VlcMain.cpp @@ -83,7 +83,7 @@ void VlcOptions::parseOptsList(int argc, char** argv) { i += consumed; } else { v3fatal("Invalid option: " << argv[i] << parser.getSuggestion(argv[i])); - ++i; + ++i; // LCOV_EXCL_LINE } } else { addReadFile(argv[i]); diff --git a/test_regress/t/t_math_msvc_64.v b/test_regress/t/t_flag_compiler.v similarity index 100% rename from test_regress/t/t_math_msvc_64.v rename to test_regress/t/t_flag_compiler.v diff --git a/test_regress/t/t_flag_compiler_clang.pl b/test_regress/t/t_flag_compiler_clang.pl new file mode 100755 index 000000000..edd331316 --- /dev/null +++ b/test_regress/t/t_flag_compiler_clang.pl @@ -0,0 +1,24 @@ +#!/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(simulator => 1); + +top_filename("t/t_flag_compiler.v"); + +compile( + verilator_flags2 => ["--compiler clang"], + ); + +execute( + check_finished => 1, + ); + +ok(1); +1; diff --git a/test_regress/t/t_flag_compiler_gcc.pl b/test_regress/t/t_flag_compiler_gcc.pl new file mode 100755 index 000000000..faaedc67a --- /dev/null +++ b/test_regress/t/t_flag_compiler_gcc.pl @@ -0,0 +1,24 @@ +#!/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(simulator => 1); + +top_filename("t/t_flag_compiler.v"); + +compile( + verilator_flags2 => ["--compiler gcc"], + ); + +execute( + check_finished => 1, + ); + +ok(1); +1; diff --git a/test_regress/t/t_math_msvc_64.pl b/test_regress/t/t_flag_compiler_msvc.pl similarity index 94% rename from test_regress/t/t_math_msvc_64.pl rename to test_regress/t/t_flag_compiler_msvc.pl index 2769c27e2..01c70152c 100755 --- a/test_regress/t/t_math_msvc_64.pl +++ b/test_regress/t/t_flag_compiler_msvc.pl @@ -10,6 +10,8 @@ if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); di scenarios(simulator => 1); +top_filename("t/t_flag_compiler.v"); + compile( verilator_flags2 => ["--compiler msvc"], # Bug requires msvc ); diff --git a/test_regress/t/t_flag_j_bad.out b/test_regress/t/t_flag_j_bad.out new file mode 100644 index 000000000..2fe652c5d --- /dev/null +++ b/test_regress/t/t_flag_j_bad.out @@ -0,0 +1,2 @@ +%Error: -j accepts positive integer, but '0' is passed +%Error: Exiting due to diff --git a/test_regress/t/t_flag_j_bad.pl b/test_regress/t/t_flag_j_bad.pl new file mode 100755 index 000000000..ee3d0fdc8 --- /dev/null +++ b/test_regress/t/t_flag_j_bad.pl @@ -0,0 +1,22 @@ +#!/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_flag_werror.v"); + +lint( + fails => 1, + verilator_flags => [qw(-j 0 --build)], + expect_filename => $Self->{golden_filename}, + ); + +ok(1); +1; diff --git a/test_regress/t/t_flag_make_bad.out b/test_regress/t/t_flag_make_bad.out new file mode 100644 index 000000000..d3a472dd3 --- /dev/null +++ b/test_regress/t/t_flag_make_bad.out @@ -0,0 +1 @@ +%Error: Unknown --make system specified: 'bad_one' diff --git a/test_regress/t/t_flag_make_bad.pl b/test_regress/t/t_flag_make_bad.pl new file mode 100755 index 000000000..1c6f23aec --- /dev/null +++ b/test_regress/t/t_flag_make_bad.pl @@ -0,0 +1,20 @@ +#!/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); + +lint( + verilator_flags2 => ["--make bad_one"], + fails => 1, + expect_filename => $Self->{golden_filename}, + ); + +ok(1); +1; diff --git a/test_regress/t/t_flag_make_gmake.pl b/test_regress/t/t_flag_make_gmake.pl new file mode 100755 index 000000000..e5caca9d8 --- /dev/null +++ b/test_regress/t/t_flag_make_gmake.pl @@ -0,0 +1,21 @@ +#!/usr/bin/env perl +if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2008 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(simulator => 1); + +top_filename("t/t_flag_make_cmake.v"); + +compile( + verilator_flags2 => ['--make gmake'], + ); + +ok(1); +1;