tw41148.pp 619 B

12345678910111213141516171819202122232425262728293031323334
  1. { %OPT=-O3 -OoNOCONSTPROP }
  2. { Test adding a typecast Boolean to a 64-bit integer }
  3. program tw41148;
  4. {$mode objfpc}
  5. procedure v64(out code: int32);
  6. var
  7. v: uint64;
  8. r : record
  9. b: boolean;
  10. end;
  11. begin
  12. r.b := true;
  13. v := uint64(High(int64)) + uint64(r.b);
  14. WriteLn(' Calculated: ' , BinStr(v, 64));
  15. if v <> uint64($8000000000000000) then
  16. begin
  17. WriteLn('FAIL - expected: 1000000000000000000000000000000000000000000000000000000000000000');
  18. code := 1;
  19. end
  20. else
  21. code := 0;
  22. end;
  23. var
  24. code: int32;
  25. begin
  26. v64(code);
  27. if code <> 0 then
  28. Halt(code);
  29. WriteLn('ok');
  30. end.