Add regression test for variable declarations in unnamed forks

SystemVerilog supports variable declarations in unnamed forks, while
Verilog does not.

Add a regression test that checks for this.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-02-06 13:57:48 +01:00
parent f2c1e21ad3
commit 4a9200f5f2
3 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,29 @@
// Check variable declarations in unnamed forks
// All of these should pass in SystemVerilog and all should fail in Verilog
module test;
initial fork
integer x;
join
initial fork
integer x;
integer y;
join
initial fork
integer x, y;
join
initial fork
integer x;
integer y;
x = y;
join
initial begin
$display("PASSED");
end
endmodule

View File

@ -83,6 +83,7 @@ resetall normal,-Wtimescale ivltests gold=resetall-fsv.gold
scope2b normal ivltests
sys_func_task_error RE ivltests gold=sys_func_task_error-fsv.gold
unnamed_block_var_decl normal ivltests
unnamed_fork_var_decl normal ivltests
# We do not run synthesis when forcing SystemVerilog so these pass
br995 normal ivltests

View File

@ -1677,6 +1677,7 @@ undef_lval_select4c CE ivltests
undef_lval_select5 normal ivltests
undefined_shift normal ivltests
unnamed_block_var_decl CE ivltests
unnamed_fork_var_decl CE ivltests
urand_r normal ivltests gold=urand_r.gold
urand_r2 normal ivltests gold=urand_r.gold
urand_r3 normal ivltests gold=urand_r.gold