mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 17:47:56 +02:00
* Check that uvmt.a_int and uvmt_a.int variables have different location
git-svn-id: trunk@18916 -
This commit is contained in:
parent
09a50cc538
commit
0a3ac5a89d
@ -5,15 +5,47 @@
|
||||
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
|
||||
uvmt, uvmt_a;
|
||||
|
||||
type
|
||||
tclass = class(tobject)
|
||||
end;
|
||||
a_tclass = class(tobject)
|
||||
end;
|
||||
|
||||
var
|
||||
a1 : tclass;
|
||||
a2 : a_tclass;
|
||||
a1 : uvmt_a.tclass;
|
||||
a2 : uvmt.a_tclass;
|
||||
a3 : tclass;
|
||||
a4 : a_tclass;
|
||||
t : longint;
|
||||
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;
|
||||
a2.destroy;
|
||||
a3.destroy;
|
||||
a4.destroy;
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user