From 68d89bbe0549a7a8e474983f611d2f4c70b54586 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Sat, 1 Oct 2022 17:03:56 +0200 Subject: [PATCH] Add regression test for referencing forward declared classes Check that it is possible to use a forward declared class type as the type of a property in another class. Signed-off-by: Lars-Peter Clausen --- ivtest/ivltests/sv_typedef_fwd_class2.v | 22 ++++++++++++++++++++++ ivtest/regress-sv.list | 1 + ivtest/regress-vlog95.list | 1 + 3 files changed, 24 insertions(+) create mode 100644 ivtest/ivltests/sv_typedef_fwd_class2.v diff --git a/ivtest/ivltests/sv_typedef_fwd_class2.v b/ivtest/ivltests/sv_typedef_fwd_class2.v new file mode 100644 index 000000000..702ca162e --- /dev/null +++ b/ivtest/ivltests/sv_typedef_fwd_class2.v @@ -0,0 +1,22 @@ +// Check that it is possible to use a forward declared class type as the type of +// a property in another class. + +module test; + + typedef class B; + + class C; + B b; + endclass + + class B; + endclass + + C c; + + initial begin + c = new; + $display("PASSED"); + end + +endmodule diff --git a/ivtest/regress-sv.list b/ivtest/regress-sv.list index f9456c777..66bb051c7 100644 --- a/ivtest/regress-sv.list +++ b/ivtest/regress-sv.list @@ -724,6 +724,7 @@ sv_typedef_darray_base3 normal,-g2009 ivltests sv_typedef_darray_base4 normal,-g2009 ivltests sv_typedef_fwd_base normal,-g2009 ivltests sv_typedef_fwd_class normal,-g2009 ivltests +sv_typedef_fwd_class2 normal,-g2009 ivltests sv_typedef_fwd_union normal,-g2009 ivltests sv_typedef_fwd_union_fail CE,-g2009 ivltests sv_typedef_fwd_enum1 normal,-g2009 ivltests diff --git a/ivtest/regress-vlog95.list b/ivtest/regress-vlog95.list index e520e2de3..722ab7543 100644 --- a/ivtest/regress-vlog95.list +++ b/ivtest/regress-vlog95.list @@ -442,6 +442,7 @@ sv_port_default9 CE,-g2009 ivltests sv_ps_type_class1 CE,-g2009 ivltests sv_root_class CE,-g2009 ivltests sv_typedef_fwd_class CE,-g2009 ivltests +sv_typedef_fwd_class2 CE,-g2009 ivltests sv_typedef_fwd_enum3 CE,-g2009 ivltests sv_typedef_scope3 CE,-g2009 ivltests sv_unit2b CE,-g2009 ivltests