Add regression test for creating instances of virtual classes

Check that an error is reported when trying to create an object of a
virtual class.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
Lars-Peter Clausen 2022-12-13 21:27:09 -08:00
parent e0ec2ed386
commit 569ba887b3
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,15 @@
// Check that an error is reported when trying to create an object of a virtual
// class.
module test;
virtual class C;
endclass
C c;
initial begin
c = new; // This should fail
end
endmodule

View File

@ -554,6 +554,7 @@ sv_class_static_prop3 normal,-g2009 ivltests
sv_class_super1 normal,-g2009 ivltests sv_class_super1 normal,-g2009 ivltests
sv_class_super2 normal,-g2009 ivltests sv_class_super2 normal,-g2009 ivltests
sv_class_task1 normal,-g2009 ivltests sv_class_task1 normal,-g2009 ivltests
sv_class_virt_new_fail CE,-g2009 ivltests
sv_darray1 normal,-g2009 ivltests sv_darray1 normal,-g2009 ivltests
sv_darray2 normal,-g2009 ivltests sv_darray2 normal,-g2009 ivltests
sv_darray3 normal,-g2009 ivltests sv_darray3 normal,-g2009 ivltests