added test coverage for task and function bodies being one statement

This commit is contained in:
Zachary Snow 2019-04-19 14:31:21 -04:00
parent b0eedfe318
commit f76f9bb88b
3 changed files with 30 additions and 0 deletions

14
test/basic/tf_block.sv Normal file
View File

@ -0,0 +1,14 @@
module top;
function [2:0] f;
input [2:0] n;
n += 1;
return n + 3;
endfunction
task t;
$display("hello");
$display("world");
endtask
initial t();
initial $display("f(0) = ", f(0));
initial $display("f(1) = ", f(1));
endmodule

15
test/basic/tf_block.v Normal file
View File

@ -0,0 +1,15 @@
module top;
function [2:0] f;
input [2:0] n;
f = n + 4;
endfunction
task t;
begin
$display("hello");
$display("world");
end
endtask
initial t();
initial $display("f(0) = ", f(0));
initial $display("f(1) = ", f(1));
endmodule

1
test/basic/tf_block_tb.v Normal file
View File

@ -0,0 +1 @@
// intentionally empty