Add regression tests for invalid class new
Check that using a class new operator on a variable that is not of a class type results in an error. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
This commit is contained in:
parent
eeed05d9cd
commit
58ac6ed1f8
|
|
@ -0,0 +1,13 @@
|
||||||
|
// Check that using the class new operator on a non-class variable results in an
|
||||||
|
// error.
|
||||||
|
|
||||||
|
module test;
|
||||||
|
|
||||||
|
int i;
|
||||||
|
|
||||||
|
initial begin
|
||||||
|
i = new;
|
||||||
|
$display("FAILED");
|
||||||
|
end
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
// Check that using the class new operator on a dynamic array variable results
|
||||||
|
// in an error.
|
||||||
|
|
||||||
|
module test;
|
||||||
|
|
||||||
|
int i[];
|
||||||
|
|
||||||
|
initial begin
|
||||||
|
i = new;
|
||||||
|
$display("FAILED");
|
||||||
|
end
|
||||||
|
|
||||||
|
endmodule
|
||||||
|
|
@ -499,6 +499,8 @@ sv_class_constructor_fail CE,-g2009 ivltests
|
||||||
sv_class_empty_item normal,-g2009 ivltests
|
sv_class_empty_item normal,-g2009 ivltests
|
||||||
sv_class_extends_scoped normal,-g2009 ivltests
|
sv_class_extends_scoped normal,-g2009 ivltests
|
||||||
sv_class_localparam normal,-g2009 ivltests
|
sv_class_localparam normal,-g2009 ivltests
|
||||||
|
sv_class_new_fail1 CE,-g2009 ivltests
|
||||||
|
sv_class_new_fail2 CE,-g2009 ivltests
|
||||||
sv_class_new_init normal,-g2009 ivltests
|
sv_class_new_init normal,-g2009 ivltests
|
||||||
sv_class_in_module_decl normal,-g2009 ivltests
|
sv_class_in_module_decl normal,-g2009 ivltests
|
||||||
sv_class_method_signed1 normal,-g2009 ivltests
|
sv_class_method_signed1 normal,-g2009 ivltests
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue