tw22133.pp 480 B

1234567891011121314151617181920212223242526272829303132
  1. program tw22133;
  2. {$mode objfpc}{$H+}
  3. type
  4. uint64 = qword;
  5. var
  6. T64:UInt64;
  7. //force checking constants in compile-time
  8. {$RANGECHECKS ON}
  9. {$inline on}
  10. function testshift(a:uint64; b: byte): uint64; inline;
  11. begin
  12. result:=a shl b;
  13. end;
  14. begin
  15. T64:=UInt64(1 shl 63);
  16. if T64<>uint64(high(int64)+1) then
  17. halt(1);
  18. T64:=UInt64(1) shl 63;
  19. if T64<>uint64(high(int64)+1) then
  20. halt(2);
  21. T64:=testshift(1,63);
  22. if T64<>uint64(high(int64)+1) then
  23. halt(3);
  24. end.