tmacpas1.pp 968 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. program tmacpas1;
  2. {Tests of mac pascal constructs, concerning two units}
  3. {$MODE MACPAS}
  4. uses
  5. umacpas1;
  6. {** Test exportable macros **}
  7. {$IFC UNDEFINED UMACPAS_COMP_VAR }
  8. {$NOTE In using unit: UMACPAS_COMP_VAR is undefined}
  9. {$ERRORC UMACPAS_COMP_VAR should be defined}
  10. {$ELSEC}
  11. {$IFC UMACPAS_COMP_VAR }
  12. {$NOTE In using unit: UMACPAS_COMP_VAR is true}
  13. {$ELSEC}
  14. {$NOTE In using unit: UMACPAS_COMP_VAR is false}
  15. {$ERRORC UMACPAS_COMP_VAR should be true}
  16. {$ENDC}
  17. {$ENDC}
  18. {$IFC UNDEFINED UMACPAS_PRE_IMPL_COMP_VAR }
  19. {$ERRORC UMACPAS_PRE_IMPL_COMP_VAR is not defined}
  20. {$ENDC}
  21. {$IFC UNDEFINED UMACPAS_PRE_IMPL_COMP_VAR }
  22. {$ERRORC UMACPAS_PRE_IMPL_COMP_VAR is defined, while it shoud not}
  23. {$ENDC}
  24. {** Test J directive for var and external for proc **}
  25. {$J+}
  26. var
  27. nisse: Integer; {Is available in Umacpas}
  28. {$J-}
  29. function Get84: Integer;
  30. external;
  31. begin
  32. Writeln(nisse);
  33. Writeln(Get84);
  34. if nisse <> 42 then
  35. halt(1);
  36. if Get84 <> 84 then
  37. halt(1);
  38. end.