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;