tw1623.pp 907 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. { Source provided for Free Pascal Bug Report 1623 }
  2. { Submitted by "Henrik C. Jessen" on 2001-09-28 }
  3. { e-mail: [email protected] }
  4. PROGRAM Test;
  5. {$inline on}
  6. FUNCTION fnc(x: integer): integer; INLINE;
  7. BEGIN
  8. fnc:=x*2;
  9. END;
  10. FUNCTION lfnc(x: longint): longint; INLINE;
  11. BEGIN
  12. lfnc:=x*2;
  13. END;
  14. VAR
  15. i: Integer;
  16. j : longint;
  17. BEGIN
  18. i:=4;
  19. if fnc(i)<>8 then
  20. Begin
  21. Writeln('Error in inlined integer functions');
  22. RunError(1);
  23. End;
  24. j:=4;
  25. if lfnc(j)<>8 then
  26. Begin
  27. Writeln('Error in inlined longint functions');
  28. RunError(1);
  29. End;
  30. j:=lfnc(lfnc(4));
  31. if j<>16 then
  32. Begin
  33. Writeln('Error in inlined longint functions twice');
  34. RunError(1);
  35. End;
  36. i:=fnc(fnc(4));
  37. if i<>16 then
  38. Begin
  39. Writeln('Error in inlined integer functions twice');
  40. RunError(1);
  41. End;
  42. END.