Tests: Fix missing forward decls (#6202 partial)

This commit is contained in:
Wilson Snyder 2025-07-26 15:48:19 -04:00
parent 42e1c83875
commit 39a5c731ac
7 changed files with 17 additions and 15 deletions

View File

@ -7592,7 +7592,8 @@ class_item<nodep>: // ==IEEE: class_item
{
const string cgName = $1->name();
$1->name("__vlAnonCG_" + cgName);
AstVar* const newp = new AstVar{$<fl>1, VVarType::VAR, cgName, VFlagChildDType{}, new AstRefDType($<fl>1, $1->name())};
AstVar* const newp = new AstVar{$1->fileline(), VVarType::VAR, cgName,
VFlagChildDType{}, new AstRefDType($1->fileline(), $1->name())};
$$ = addNextNull($1, newp);
}
// // local_parameter_declaration under parameter_declaration

View File

@ -1,9 +1,9 @@
%Error: t/t_enum_bad_circdecl.v:11:6: Typedef has self-reference: 'bad_redecl'
: ... note: In instance 't'
11 | } bad_redecl;
| ^~~~~~~~~~
t/t_enum_bad_circdecl.v:9:17: ... Location of reference
9 | typedef enum bad_redecl [2:0] {
| ^~~~~~~~~~
%Error: t/t_enum_bad_circdecl.v:10:41: Typedef has self-reference: 'bad_redecl'
: ... note: In instance 't'
10 | typedef enum bad_redecl [2:0] {VALUE} bad_redecl;
| ^~~~~~~~~~
t/t_enum_bad_circdecl.v:10:16: ... Location of reference
10 | typedef enum bad_redecl [2:0] {VALUE} bad_redecl;
| ^~~~~~~~~~
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
%Error: Exiting due to

View File

@ -4,10 +4,9 @@
// any use, without warranty, 2020 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
module t();
module t;
typedef enum bad_redecl [2:0] {
VALUE
} bad_redecl;
typedef enum bad_redecl;
typedef enum bad_redecl [2:0] {VALUE} bad_redecl;
endmodule

View File

@ -1,5 +1,5 @@
%Error: t/t_enum_recurse_bad2.v:7:14: Self-referential enumerated type definition
7 | typedef enum foo_t { A = 'b0, B = 'b1 } foo_t;
%Error: t/t_enum_recurse_bad2.v:8:14: Self-referential enumerated type definition
8 | typedef enum foo_t { A = 'b0, B = 'b1 } foo_t;
| ^~~~~
... See the manual at https://verilator.org/verilator_doc.html?v=latest for more assistance.
%Error: Exiting due to

View File

@ -4,4 +4,5 @@
// any use, without warranty, 2019 by Wilson Snyder.
// SPDX-License-Identifier: CC0-1.0
typedef enum foo_t;
typedef enum foo_t { A = 'b0, B = 'b1 } foo_t;

View File

@ -9,7 +9,7 @@
import vltest_bootstrap
test.scenarios('simulator')
test.scenarios('simulator_st')
test.compile()

View File

@ -6,6 +6,7 @@
typedef class Bar;
typedef Bar Baz;
typedef class Quux;
typedef Quux #(16, 32) Quux_t;
typedef Quux_t Quuux_t;