Skip to content

Commit

Permalink
Add a test with a method called on a field with super reference
Browse files Browse the repository at this point in the history
Signed-off-by: Ryszard Rozak <[email protected]>
  • Loading branch information
RRozak committed Oct 24, 2023
1 parent 7459df3 commit bcda2c8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test_regress/t/t_class_virtual.v
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,29 @@ class uvm_build_phase extends uvm_topdown_phase;
endfunction
endclass

virtual class Cls;
uvm_phase ph;
endclass

class ExtendsCls extends Cls;
function new;
uvm_build_phase bp = new;
ph = bp;
endfunction

function int get1;
return super.ph.exec_func();
endfunction
endclass

module t;
initial begin
VA va = new;
VB vb = new;
VBase b;

uvm_build_phase ph;
ExtendsCls ec;

if (va.hello() != 2) $stop;
if (vb.hello() != 3) $stop;
Expand All @@ -59,6 +75,9 @@ module t;
ph = new;
if (ph.get1() != 1) $stop;

ec = new;
if (ec.get1() != 1) $stop;

$write("*-* All Finished *-*\n");
$finish;
end
Expand Down

0 comments on commit bcda2c8

Please sign in to comment.