fpc/tests/test/tinline9.pp
Jonas Maebe 666d156e8e * disabled inlining when passing a refcounted parameter typecasted to
a non-refcounted type to a procedure, as this is incompatible with
    the inlining process

git-svn-id: trunk@8391 -
2007-09-07 10:40:26 +00:00

28 lines
362 B
ObjectPascal

{$ifdef fpc}
{$mode objfpc}
{$inline on}
{$endif}
function fa: ansistring;
begin
fa:='b';
fa:=result+'a';
end;
function fb: ansistring;
begin
fb:='c';
fb:=result+'d';
end;
procedure test(const a,b: pointer); inline;
begin
if (ansistring(a)<>'ba') or
(ansistring(b)<>'cd') then
halt(1);
end;
begin
test(pointer(fa()),pointer(fb()));
end.