fpc/tests/ts010001.pp
pierre b3867488fb + added a makefile for tests
+ uses getref  for extracting error code
  + required command lines args can be place in the first line of
    source code
    following $OPT=
1998-10-21 11:33:26 +00:00

34 lines
486 B
ObjectPascal

{ $OPT=-S2
}
type
tclass = class of tobject;
tmyclass = class of tmyobject;
tmyobject = class
end;
{ only a stupid test routine }
function getanchestor(c : tclass) : tclass;
var
l : longint;
begin
getanchestor:=tobject;
l:=l+1;
end;
var
classref : tclass;
myclassref : tmyclass;
begin
{ simple test }
classref:=classref;
{ more difficult }
classref:=myclassref;
classref:=tobject;
classref:=getanchestor(myclassref);
end.