diff --git a/ivtest/ivltests/sv_class_nested_method_call.v b/ivtest/ivltests/sv_class_nested_method_call.v new file mode 100644 index 000000000..c9b2cfe3c --- /dev/null +++ b/ivtest/ivltests/sv_class_nested_method_call.v @@ -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 diff --git a/ivtest/regress-vvp.list b/ivtest/regress-vvp.list index 21d0b57b4..5453cb1ca 100644 --- a/ivtest/regress-vvp.list +++ b/ivtest/regress-vvp.list @@ -285,6 +285,7 @@ sv_chained_constructor2 vvp_tests/sv_chained_constructor2.json sv_chained_constructor3 vvp_tests/sv_chained_constructor3.json sv_chained_constructor4 vvp_tests/sv_chained_constructor4.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_op2 vvp_tests/sv_class_prop_assign_op2.json sv_class_prop_class_name vvp_tests/sv_class_prop_class_name.json diff --git a/ivtest/vvp_tests/sv_class_nested_method_call.json b/ivtest/vvp_tests/sv_class_nested_method_call.json new file mode 100644 index 000000000..c83ca1546 --- /dev/null +++ b/ivtest/vvp_tests/sv_class_nested_method_call.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" + } +}