diff --git a/ivtest/ivltests/final_nested_block_task_fail.v b/ivtest/ivltests/final_nested_block_task_fail.v new file mode 100644 index 000000000..b19f918f5 --- /dev/null +++ b/ivtest/ivltests/final_nested_block_task_fail.v @@ -0,0 +1,12 @@ +// Check that final context is preserved when elaborating nested blocks. + +module test; + + task t; + endtask + + final begin : nested + t; + end + +endmodule diff --git a/ivtest/ivltests/func_nested_block_nb_fail.v b/ivtest/ivltests/func_nested_block_nb_fail.v new file mode 100644 index 000000000..ad1969eb8 --- /dev/null +++ b/ivtest/ivltests/func_nested_block_nb_fail.v @@ -0,0 +1,21 @@ +// Check that function context is preserved when elaborating nested blocks. + +module test; + + reg x; + integer y; + + function integer f; + input a; + begin : nested + x <= a; + f = 0; + end + endfunction + + initial begin + y = f(1'b1); + $display("FAILED"); + end + +endmodule diff --git a/ivtest/regress-vvp.list b/ivtest/regress-vvp.list index 55fa1a553..e17f69eee 100644 --- a/ivtest/regress-vvp.list +++ b/ivtest/regress-vvp.list @@ -137,9 +137,11 @@ early_sig_elab3 vvp_tests/early_sig_elab3.json eofmt_percent vvp_tests/eofmt_percent.json fdisplay3 vvp_tests/fdisplay3.json final3 vvp_tests/final3.json +final_nested_block_task_fail vvp_tests/final_nested_block_task_fail.json fmonitor1 vvp_tests/fmonitor1.json fmonitor2 vvp_tests/fmonitor2.json fread-error vvp_tests/fread-error.json +func_nested_block_nb_fail vvp_tests/func_nested_block_nb_fail.json line_directive vvp_tests/line_directive.json localparam_type vvp_tests/localparam_type.json macro_str_esc vvp_tests/macro_str_esc.json diff --git a/ivtest/vvp_tests/final_nested_block_task_fail.json b/ivtest/vvp_tests/final_nested_block_task_fail.json new file mode 100644 index 000000000..8c017453f --- /dev/null +++ b/ivtest/vvp_tests/final_nested_block_task_fail.json @@ -0,0 +1,5 @@ +{ + "type" : "CE", + "source" : "final_nested_block_task_fail.v", + "iverilog-args" : [ "-g2009" ] +} diff --git a/ivtest/vvp_tests/func_nested_block_nb_fail.json b/ivtest/vvp_tests/func_nested_block_nb_fail.json new file mode 100644 index 000000000..47984b1dd --- /dev/null +++ b/ivtest/vvp_tests/func_nested_block_nb_fail.json @@ -0,0 +1,4 @@ +{ + "type" : "CE", + "source" : "func_nested_block_nb_fail.v" +}