소스 검색

* x86_64: New test for i41317

J. Gareth "Curious Kit" Moreton 2 달 전
부모
커밋
313f2a335f
1개의 변경된 파일33개의 추가작업 그리고 0개의 파일을 삭제
  1. 33 0
      tests/webtbs/tw41317.pp

+ 33 - 0
tests/webtbs/tw41317.pp

@@ -0,0 +1,33 @@
+{ %CPU=X86_64 }
+{ %OPT=-O2 }
+program tw41317;
+
+{$MODE OBJFPC}
+
+function Test(A: DWord; B: Int64): Int64; noinline;
+begin
+   while (True) do
+   begin
+      if (B > 0) then
+      begin
+         // B is -1, so this line does not run
+         B := A;
+      end;
+      Result := B;
+      break;
+   end;
+end;
+
+var
+   V: Int64;
+begin
+   V := Test(0, -1);
+   Write('Testing 32-to-64-bit CMOV result: ', V, ' (should be -1)...');
+   if V <> -1 then
+   begin
+     WriteLn(' FAIL!');
+     Halt(1);
+   end;
+
+   WriteLn(#10'ok');
+end.