|
@@ -5,15 +5,47 @@
|
|
both generate the same symbol name for the VMT
|
|
both generate the same symbol name for the VMT
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+{ Use same name as unit to test also
|
|
|
|
+ possible confusion there }
|
|
|
|
+
|
|
|
|
+{$mode objfpc}
|
|
|
|
+
|
|
|
|
+program vmt_uvmt;
|
|
|
|
+
|
|
uses
|
|
uses
|
|
uvmt, uvmt_a;
|
|
uvmt, uvmt_a;
|
|
|
|
|
|
|
|
+type
|
|
|
|
+ tclass = class(tobject)
|
|
|
|
+ end;
|
|
|
|
+ a_tclass = class(tobject)
|
|
|
|
+ end;
|
|
|
|
+
|
|
var
|
|
var
|
|
- a1 : tclass;
|
|
|
|
- a2 : a_tclass;
|
|
|
|
|
|
+ a1 : uvmt_a.tclass;
|
|
|
|
+ a2 : uvmt.a_tclass;
|
|
|
|
+ a3 : tclass;
|
|
|
|
+ a4 : a_tclass;
|
|
|
|
+ t : longint;
|
|
begin
|
|
begin
|
|
- a1 := tclass.create;
|
|
|
|
- a2 := a_tclass.create;
|
|
|
|
|
|
+ t:=6;
|
|
|
|
+ inc(t);
|
|
|
|
+ uvmt.a_int:=t;
|
|
|
|
+ inc(t);
|
|
|
|
+ uvmt_a.int:=t;
|
|
|
|
+ if (uvmt_a.int - uvmt.a_int <> 1) then
|
|
|
|
+ begin
|
|
|
|
+ Writeln('Error in generated executable');
|
|
|
|
+ if (@int = @a_int) then
|
|
|
|
+ Writeln('Both variables are at same address');
|
|
|
|
+ halt(1);
|
|
|
|
+ end;
|
|
|
|
+ a1 := uvmt_a.tclass.create;
|
|
|
|
+ a2 := uvmt.a_tclass.create;
|
|
|
|
+ a3 := tclass.create;
|
|
|
|
+ a4 := a_tclass.create;
|
|
a1.destroy;
|
|
a1.destroy;
|
|
a2.destroy;
|
|
a2.destroy;
|
|
|
|
+ a3.destroy;
|
|
|
|
+ a4.destroy;
|
|
end.
|
|
end.
|