Add regression test for nested class method calls
Check that an unqualified method call from a named block uses the implicit `this` signal from the containing class method. The compiler currently looks for the signal in the named-block scope and crashes. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
b4d92f7bb9
commit
f493076882
|
|
@ -0,0 +1,30 @@
|
||||||
|
// Check that an unqualified class method call works from a named block in
|
||||||
|
// another method.
|
||||||
|
|
||||||
|
module test;
|
||||||
|
|
||||||
|
class C;
|
||||||
|
function int get_value();
|
||||||
|
return 1;
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function int call_method();
|
||||||
|
begin : nested
|
||||||
|
return get_value();
|
||||||
|
end
|
||||||
|
endfunction
|
||||||
|
endclass
|
||||||
|
|
||||||
|
C object;
|
||||||
|
|
||||||
|
initial begin
|
||||||
|
object = new;
|
||||||
|
|
||||||
|
if (object.call_method() != 1) begin
|
||||||
|
$display("FAILED");
|
||||||
|
end else begin
|
||||||
|
$display("PASSED");
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
@ -285,6 +285,7 @@ sv_chained_constructor2 vvp_tests/sv_chained_constructor2.json
|
||||||
sv_chained_constructor3 vvp_tests/sv_chained_constructor3.json
|
sv_chained_constructor3 vvp_tests/sv_chained_constructor3.json
|
||||||
sv_chained_constructor4 vvp_tests/sv_chained_constructor4.json
|
sv_chained_constructor4 vvp_tests/sv_chained_constructor4.json
|
||||||
sv_chained_constructor5 vvp_tests/sv_chained_constructor5.json
|
sv_chained_constructor5 vvp_tests/sv_chained_constructor5.json
|
||||||
|
sv_class_nested_method_call vvp_tests/sv_class_nested_method_call.json
|
||||||
sv_class_prop_assign_op1 vvp_tests/sv_class_prop_assign_op1.json
|
sv_class_prop_assign_op1 vvp_tests/sv_class_prop_assign_op1.json
|
||||||
sv_class_prop_assign_op2 vvp_tests/sv_class_prop_assign_op2.json
|
sv_class_prop_assign_op2 vvp_tests/sv_class_prop_assign_op2.json
|
||||||
sv_class_prop_class_name vvp_tests/sv_class_prop_class_name.json
|
sv_class_prop_class_name vvp_tests/sv_class_prop_class_name.json
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"type" : "normal",
|
||||||
|
"source" : "sv_class_nested_method_call.v",
|
||||||
|
"iverilog-args" : [ "-g2005-sv" ],
|
||||||
|
"vlog95" : {
|
||||||
|
"__comment" : "Classes are not supported",
|
||||||
|
"type" : "CE"
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue