tmacpas2.pp 814 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. {$MODE MACPAS}
  2. {Tests of mac pascal constructs}
  3. program tmacpas2;
  4. var
  5. success: Boolean = true;
  6. procedure Proc;
  7. begin
  8. {** Exit with proc name as argument **}
  9. Exit(Proc);
  10. end;
  11. const
  12. a = true;
  13. b = true;
  14. c = false;
  15. var
  16. p: pointer;
  17. l,i: longint;
  18. begin
  19. {** Test & and | as alias for AND and OR **}
  20. if not (a & b) then
  21. success:= false;
  22. if not (c | b) then
  23. success:= false;
  24. {** Test that Ord() can take pointer values **}
  25. p:= pointer(4711);
  26. l:= Ord(p);
  27. if l <> 4711 then
  28. success:= false;
  29. i:= 0;
  30. while true do
  31. begin
  32. i:= i+1;
  33. if i = 1 then
  34. Cycle;
  35. Leave;
  36. end;
  37. if i<> 2 then
  38. success:= false;
  39. if success then
  40. Writeln('Whole test succeded')
  41. else
  42. begin
  43. Writeln('Whole test failed');
  44. halt(1);
  45. end;
  46. end.