From a1c74566b5d2e00d8f87ce96a8cffdec73b68067 Mon Sep 17 00:00:00 2001 From: Ryszard Rozak Date: Fri, 27 Oct 2023 13:56:13 +0200 Subject: [PATCH] Add another test Signed-off-by: Ryszard Rozak --- test_regress/t/t_castdyn.v | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test_regress/t/t_castdyn.v b/test_regress/t/t_castdyn.v index e9e96d5323..faa7d7542d 100644 --- a/test_regress/t/t_castdyn.v +++ b/test_regress/t/t_castdyn.v @@ -9,6 +9,10 @@ endclass class BasedA extends Base; endclass class BasedB extends Base; + static function BasedB getBasedB(bit getNull); + BasedB b = new; + return getNull ? null : b; + endfunction endclass module t (/*AUTOARG*/); @@ -61,6 +65,12 @@ module t (/*AUTOARG*/); if (i != 1) $stop; if (b != bb) $stop; + bb = BasedB::getBasedB(1); + b = bb; + i = $cast(bbo, b); + if (i != 1) $stop; + if (b != bb) $stop; + bb = new; b = bb; bao = ba;