From 3e03fef3e359401b23e17a98792872f3525cdddc Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 22 Jul 2012 09:09:53 -0400 Subject: [PATCH] Tests: Add t_var_notfound_bad --- test_regress/t/t_var_notfound_bad.pl | 22 ++++++++++++++++++++++ test_regress/t/t_var_notfound_bad.v | 27 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100755 test_regress/t/t_var_notfound_bad.pl create mode 100644 test_regress/t/t_var_notfound_bad.v diff --git a/test_regress/t/t_var_notfound_bad.pl b/test_regress/t/t_var_notfound_bad.pl new file mode 100755 index 000000000..f567ed80d --- /dev/null +++ b/test_regress/t/t_var_notfound_bad.pl @@ -0,0 +1,22 @@ +#!/usr/bin/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. + +compile ( + fails=>1, + expect=> +'%Error: t/t_var_notfound_bad.v:\d+: Can\'t find definition of signal: nf +%Error: t/t_var_notfound_bad.v:\d+: Can\'t find definition of \'subsubz\' in dotted signal: sub.subsubz.inss +%Error: Known scopes under \'inss\': subsub +%Error: t/t_var_notfound_bad.v:\d+: Can\'t find definition of task/function: nofunc +%Error: t/t_var_notfound_bad.v:\d+: Can\'t find definition of task/function: notask +%Error: Exiting due to.*', + ); + +ok(1); +1; diff --git a/test_regress/t/t_var_notfound_bad.v b/test_regress/t/t_var_notfound_bad.v new file mode 100644 index 000000000..a5f3c34d9 --- /dev/null +++ b/test_regress/t/t_var_notfound_bad.v @@ -0,0 +1,27 @@ +// DESCRIPTION: Verilator: Verilog Test module +// +// This file ONLY is placed into the Public Domain, for any use, +// without warranty, 2012 by Wilson Snyder. + +module t (/*AUTOARG*/); + + integer i; + + sub sub (); + + initial begin + nf = 0; // z not found + sub.subsubz.inss = 0; // subsub not found + i = nofunc(); // nofunc not found + notask(); // notask not found + $finish; + end +endmodule + +module sub; + subsub subsub (); +endmodule + +module subsub; + integer inss; +endmodule