tb0151.pp 356 B

12345678910111213141516171819202122
  1. { %fail }
  2. {$ifdef fpc}{$mode tp}{$endif}
  3. {$ifdef ENDIAN_BIG}
  4. var
  5. i : longint;
  6. j : word;
  7. begin
  8. j:=5;
  9. i:=-1;
  10. { this is not allowed for big endian, even not in tp7 mode }
  11. byte(i):=j;
  12. writeln('i: ',i,' (should be -251)');
  13. if i<>-251 then
  14. halt(1);
  15. end.
  16. {$else}
  17. begin
  18. {$error Test is big endian only, fail for little endian}
  19. end.
  20. {$endif}