mirror of
https://github.com/verilator/verilator.git
synced 2025-01-01 04:07:34 +00:00
Delay struct type determination until elaboration
This commit is contained in:
parent
5f39c69d19
commit
888af29a72
@ -2212,7 +2212,7 @@ data_typeVirtual<nodeDTypep>: // ==IEEE: data_type after yVIRTUAL [ yI
|
||||
;
|
||||
|
||||
data_type_or_void<nodeDTypep>: // ==IEEE: data_type_or_void
|
||||
data_type { $$ = $1; }
|
||||
data_typeAny { $$ = $1; }
|
||||
| yVOID
|
||||
{ $$ = new AstBasicDType{$1, LOGIC_IMPLICIT};
|
||||
BBUNSUP($1, "Unsupported: void (for tagged unions)"); }
|
||||
|
4
test_regress/t/t_struct_type_bad.out
Normal file
4
test_regress/t/t_struct_type_bad.out
Normal file
@ -0,0 +1,4 @@
|
||||
%Error: t/t_struct_type_bad.v:13:7: Expecting a data type: 'i'
|
||||
13 | i badi;
|
||||
| ^
|
||||
%Error: Exiting due to
|
16
test_regress/t/t_struct_type_bad.py
Executable file
16
test_regress/t/t_struct_type_bad.py
Executable file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||
#
|
||||
# Copyright 2024 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
|
||||
|
||||
import vltest_bootstrap
|
||||
|
||||
test.scenarios('linter')
|
||||
|
||||
test.lint(fails=True, expect_filename=test.golden_filename)
|
||||
|
||||
test.passes()
|
16
test_regress/t/t_struct_type_bad.v
Normal file
16
test_regress/t/t_struct_type_bad.v
Normal file
@ -0,0 +1,16 @@
|
||||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed under the Creative Commons Public Domain, for
|
||||
// any use, without warranty, 2012 by Wilson Snyder.
|
||||
// SPDX-License-Identifier: CC0-1.0
|
||||
|
||||
module t (/*AUTOARG*/);
|
||||
|
||||
int i;
|
||||
|
||||
typedef struct packed {
|
||||
int i;
|
||||
i badi; // Bad
|
||||
} struct_t;
|
||||
|
||||
endmodule
|
Loading…
Reference in New Issue
Block a user