tw18082.pp 503 B

1234567891011121314151617181920212223242526272829
  1. var
  2. l: longint;
  3. {$ifdef cpu64}
  4. i: int64;
  5. {$endif}
  6. begin
  7. l:=-123;
  8. if interlockedcompareexchange(l,-1,124)<>-123 then
  9. halt(1);
  10. if l<>-123 then
  11. halt(2);
  12. if interlockedcompareexchange(l,-1,-123)<>-123 then
  13. halt(3);
  14. if l<>-1 then
  15. halt(4);
  16. {$ifdef cpu64}
  17. i:=-123;
  18. if interlockedcompareexchange64(i,-1,124)<>-123 then
  19. halt(5);
  20. if i<>-123 then
  21. halt(6);
  22. if interlockedcompareexchange64(i,-1,-123)<>-123 then
  23. halt(7);
  24. if i<>-1 then
  25. halt(8);
  26. {$endif}
  27. end.