ソースを参照

* restored overwritten test

git-svn-id: trunk@22776 -
florian 12 年 前
コミット
dc8a3779e5
3 ファイル変更78 行追加53 行削除
  1. 2 1
      .gitattributes
  2. 19 52
      tests/test/tasm7.pp
  3. 57 0
      tests/test/tasm8.pp

+ 2 - 1
.gitattributes

@@ -10421,7 +10421,8 @@ tests/test/tasm3.pp svneol=native#text/plain
 tests/test/tasm4.pp svneol=native#text/plain
 tests/test/tasm5.pp svneol=native#text/plain
 tests/test/tasm6.pp svneol=native#text/plain
-tests/test/tasm7.pp svneol=native#text/plain
+tests/test/tasm7.pp svneol=native#text/pascal
+tests/test/tasm8.pp svneol=native#text/plain
 tests/test/tasmread.pp svneol=native#text/plain
 tests/test/tasout.pp svneol=native#text/plain
 tests/test/tassignmentoperator1.pp svneol=native#text/pascal

+ 19 - 52
tests/test/tasm7.pp

@@ -1,57 +1,24 @@
-{ %CPU=x86_64 }
+{ %CPU=i386 }
 
-// (Almost) every of these instructions use a high register and thus generate REX.
-{$asmmode intel}
-procedure avxtest; assembler; nostackframe;
-asm
-    VADDPD         XMM0, XMM1, [RAX] + $100
-    VADDPD         YMM2, YMM3, [RAX] + $100
-
-    VBLENDPD       XMM2, XMM5, XMM7, $02
-    VBLENDPD       YMM2, YMM5, YMM7, $0F
-
-    VBLENDVPS      XMM2, XMM5, XMM7, XMM4
-    VBLENDVPS      YMM0, YMM1, YMM2, YMM5
-
-    VBROADCASTSD   YMM0, [RAX]
-
-    VPEXTRB         EAX, XMM0, $00
-
-    VPINSRD        XMM7, XMM1, EAX, $03
-
-    VZEROALL
-
-end;
-
-
-const
-  avxtest_expected : array[0..59] of byte = (
-  $C5,$F1,$58,$80,$00,$01,$00,$00,
-  $C5,$E5,$58,$90,$00,$01,$00,$00,
-  $C4,$E3,$51,$0D,$D7,$02,
-  $C4,$E3,$55,$0D,$D7,$0F,
-  $C4,$E3,$51,$4A,$D7,$40,
-  $C4,$E3,$75,$4A,$C2,$50,
-  $C4,$E2,$7D,$19,$00,
-  $C4,$E3,$79,$14,$C0,$00,
-  $C4,$E3,$71,$22,$F8,$03,
-  $C5,$FC,$77);
-
-
-
-procedure check(const id: string; const expected: array of byte; p: pointer);
+{$asmmode att}
 var
-  i : longint;
-begin
-  for i:=0 to high(expected) do
-    if expected[i]<>pbyte(p)[i] then
-      begin
-        writeln(id, ' mismatch at offset $',hexstr(i,4), ', expected=$',hexstr(expected[i],2),' actual=$',hexstr(pbyte(p)[i],2));
-        halt(1);
-      end;
+  test: array[0..2] of longint;
+
+function proc: longint; assembler;
+asm
+     call   .L1
+.L1:
+     pop    %eax
+     movl   test-.L1(%eax),%eax
+// This should also work (but it doesn't due to bugs in asmreader):
+//   movl   test-.L1+8(%eax),%eax     
 end;
 
 begin
-  check('generic', avxtest_expected, @avxtest);
-  writeln('ok');
-end.
+  test[0]:=5555;
+  test[1]:=6666;
+  test[2]:=7777;
+  if proc<>5555 then
+    Halt(1);
+  Halt(0);  
+end.

+ 57 - 0
tests/test/tasm8.pp

@@ -0,0 +1,57 @@
+{ %CPU=x86_64 }
+
+// (Almost) every of these instructions use a high register and thus generate REX.
+{$asmmode intel}
+procedure avxtest; assembler; nostackframe;
+asm
+    VADDPD         XMM0, XMM1, [RAX] + $100
+    VADDPD         YMM2, YMM3, [RAX] + $100
+
+    VBLENDPD       XMM2, XMM5, XMM7, $02
+    VBLENDPD       YMM2, YMM5, YMM7, $0F
+
+    VBLENDVPS      XMM2, XMM5, XMM7, XMM4
+    VBLENDVPS      YMM0, YMM1, YMM2, YMM5
+
+    VBROADCASTSD   YMM0, [RAX]
+
+    VPEXTRB         EAX, XMM0, $00
+
+    VPINSRD        XMM7, XMM1, EAX, $03
+
+    VZEROALL
+
+end;
+
+
+const
+  avxtest_expected : array[0..59] of byte = (
+  $C5,$F1,$58,$80,$00,$01,$00,$00,
+  $C5,$E5,$58,$90,$00,$01,$00,$00,
+  $C4,$E3,$51,$0D,$D7,$02,
+  $C4,$E3,$55,$0D,$D7,$0F,
+  $C4,$E3,$51,$4A,$D7,$40,
+  $C4,$E3,$75,$4A,$C2,$50,
+  $C4,$E2,$7D,$19,$00,
+  $C4,$E3,$79,$14,$C0,$00,
+  $C4,$E3,$71,$22,$F8,$03,
+  $C5,$FC,$77);
+
+
+
+procedure check(const id: string; const expected: array of byte; p: pointer);
+var
+  i : longint;
+begin
+  for i:=0 to high(expected) do
+    if expected[i]<>pbyte(p)[i] then
+      begin
+        writeln(id, ' mismatch at offset $',hexstr(i,4), ', expected=$',hexstr(expected[i],2),' actual=$',hexstr(pbyte(p)[i],2));
+        halt(1);
+      end;
+end;
+
+begin
+  check('generic', avxtest_expected, @avxtest);
+  writeln('ok');
+end.