Browse Source

* test that SysUtils.Swap<>() doesn't hide System.Swap()

Sven/Sarah Barth 8 months ago
parent
commit
6ec8441744
1 changed files with 6 additions and 0 deletions
  1. 6 0
      tests/test/tmoperator13.pp

+ 6 - 0
tests/test/tmoperator13.pp

@@ -25,6 +25,7 @@ end;
 
 var
   r1, r2, r3: TMyRec;
+  w: Word;
 begin
   r1 := 42;
   r2 := 32;
@@ -36,5 +37,10 @@ begin
     Halt(2);
   if CopyCount <> 0 then
     Halt(3);
+  { ensure that SysUtils.Swap<> does not hide System.Swap }
+  w := $4321;
+  w := Swap(w);
+  if w <> $2143 then
+    Halt(4);
   WriteLn('Ok');
 end.