tinline9.pp 362 B

123456789101112131415161718192021222324252627
  1. {$ifdef fpc}
  2. {$mode objfpc}
  3. {$inline on}
  4. {$endif}
  5. function fa: ansistring;
  6. begin
  7. fa:='b';
  8. fa:=result+'a';
  9. end;
  10. function fb: ansistring;
  11. begin
  12. fb:='c';
  13. fb:=result+'d';
  14. end;
  15. procedure test(const a,b: pointer); inline;
  16. begin
  17. if (ansistring(a)<>'ba') or
  18. (ansistring(b)<>'cd') then
  19. halt(1);
  20. end;
  21. begin
  22. test(pointer(fa()),pointer(fb()));
  23. end.