diff --git a/test_regress/t/t_preproc_debugi.v b/test_regress/t/t_preproc_debugi.v index d044a69d7..9e9202741 100644 --- a/test_regress/t/t_preproc_debugi.v +++ b/test_regress/t/t_preproc_debugi.v @@ -8,3 +8,23 @@ `define BAR(aa,bb) aa bb `FOO `BAR(aa,bb) + +`ifdef FOO +`else +`endif +`ifndef FOO +`elsif FOO +`endif + +`define STRINGIFY(x) `"x`" +`define CONCAT(a, b) a``b +`STRINGIFY(x) +`CONCAT(x,y) + +`undef FOO + +`undefineall + +`ifdef NEVER +`error "should not get" +`endif diff --git a/test_regress/t/t_preproc_inc_fn_bad.out b/test_regress/t/t_preproc_inc_fn_bad.out new file mode 100644 index 000000000..7e41874fa --- /dev/null +++ b/test_regress/t/t_preproc_inc_fn_bad.out @@ -0,0 +1,4 @@ +%Error: t/t_preproc_inc_fn_bad.v:7:10: Expecting include filename. Found: ELSE + 7 | `include `else + | ^~~~~ +%Error: Exiting due to diff --git a/test_regress/t/t_preproc_inc_fn_bad.pl b/test_regress/t/t_preproc_inc_fn_bad.pl new file mode 100755 index 000000000..cdeb5a8e1 --- /dev/null +++ b/test_regress/t/t_preproc_inc_fn_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( + fails => 1, + # The .vh file has the error, not the .v file + expect_filename => $Self->{golden_filename}, + ); + +ok(1); +1; diff --git a/test_regress/t/t_preproc_inc_fn_bad.v b/test_regress/t/t_preproc_inc_fn_bad.v new file mode 100644 index 000000000..49fd4a1a5 --- /dev/null +++ b/test_regress/t/t_preproc_inc_fn_bad.v @@ -0,0 +1,10 @@ +// DESCRIPTION: Verilator: Verilog Test module +// +// This file ONLY is placed under the Creative Commons Public Domain, for +// any use, without warranty, 2010 by Wilson Snyder. +// SPDX-License-Identifier: CC0-1.0 + +`include `else + +module t; +endmodule