Add regression tests for class methods with static lifetime

Check that trying to specify a class method with static lifetime results in
an error.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-12-21 19:00:14 -08:00
parent da4ac3607a
commit 748d6d8de2
3 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,18 @@
// Check that specifing static lifetime for a class method taks results in an
// error.
module test;
class C;
// This should fail, all class methods have automatic lifetime
task static t(int x);
int y;
y = 2 * x;
endtask
endclass
initial begin
$display("FAILED");
end
endmodule

View File

@ -0,0 +1,19 @@
// Check that specifing static lifetime for a class method function results in
// an error.
module test;
class C;
// This should fail, all class methods have automatic lifetime
function static int t(int x);
int y;
y = 2 * x;
return y;
endfunction
endclass
initial begin
$display("FAILED");
end
endmodule

View File

@ -565,6 +565,8 @@ sv_class_in_module_decl normal,-g2009 ivltests
sv_class_method_call_void normal,-g2009 ivltests
sv_class_method_default1 normal,-g2009 ivltests
sv_class_method_default2 normal,-g2009 ivltests
sv_class_method_lt_static1 CE,-g2009 ivltests
sv_class_method_lt_static2 CE,-g2009 ivltests
sv_class_method_signed1 normal,-g2009 ivltests
sv_class_method_signed2 normal,-g2009 ivltests
sv_class_method_var_init normal,-g2009 ivltests