Browse Source

Text for merge request #226

Jonas Maebe 3 years ago
parent
commit
9b11509dd0
1 changed files with 34 additions and 0 deletions
  1. 34 0
      tests/webtbs/twm0226.pp

+ 34 - 0
tests/webtbs/twm0226.pp

@@ -0,0 +1,34 @@
+{ %cpu=x86-64 }
+
+program test;
+
+type
+  rec1 = record
+    onlyfield: Single;
+  end;
+
+  rec2 = record
+    onlyfield: Double;
+  end;
+
+function fn(a1: rec1; a2: rec2): boolean; ms_abi_cdecl; assembler; nostackframe;
+asm
+  xorl %eax, %eax
+  cmpl $0x3f800000, %ecx
+  jne .Lend
+  movq $0x4000000000000000, %rcx
+  cmpq %rcx,%rdx
+  jne .Lend
+  movl $1, %eax
+.Lend:
+end;
+
+var
+  myrec1: rec1;
+  myrec2: rec2;
+begin
+  myrec1.onlyfield := 1.0;
+  myrec2.onlyfield := 2.0;
+  if not fn(myrec1, myrec2) then
+    halt(1);
+end.