Browse Source

+ 23,24,25

peter 26 năm trước cách đây
mục cha
commit
a3c299a1cd
4 tập tin đã thay đổi với 74 bổ sung6 xóa
  1. 9 6
      tests/README
  2. 14 0
      tests/ts010023.pp
  3. 26 0
      tests/ts010024.pp
  4. 25 0
      tests/ts010025.pp

+ 9 - 6
tests/README

@@ -24,16 +24,19 @@ ts010004.pp       tests forward classes
 ts010005.pp       tests method overriding
 ts010006.pp       tests libraries
 ts010015.pp       tests typed files.
-ts010016.pp       tests conversion of smallsets in normsets in consts 
+ts010016.pp       tests conversion of smallsets in normsets in consts
 ts010017.pp       tests the problem of iocheck inside iocheck routines
 ts010018.pp       tests the problem of enums inside objects
-ts010019.pp	  tests problems of name mangling
-ts010020.pp	  tests for const strings problems if const is a single char.
-ts010021.pp	  test for long mangled names (they are strings, ie no longer then
-		  255 chars (but they have to be allways shorten the same way !!)
+ts010019.pp       tests problems of name mangling
+ts010020.pp       tests for const strings problems if const is a single char.
+ts010021.pp       test for long mangled names (they are strings, ie no longer then
+                  255 chars (but they have to be allways shorten the same way !!)
 ts010022.pp       tests a problem of writing pchar in files
-ts10100.pp        tests for delphi object model
+ts010023.pp       tests set of char parameter passing
+ts010024.pp       tests att asm reference parsing
+ts010025.pp       tests intel asm reference parsing
 -
+ts10100.pp        tests for delphi object model
 ts101xx.pp
 
 tf000001.pp       stupid example that creates a GPF sometimes

+ 14 - 0
tests/ts010023.pp

@@ -0,0 +1,14 @@
+const
+  nl=#10;
+type
+  cs=set of char;
+
+function p(c:cs):boolean;
+begin
+  p:=(#10 in c);
+end;
+
+begin
+  if p([#1..#255]-[nl]) then
+   halt(1);
+end.

+ 26 - 0
tests/ts010024.pp

@@ -0,0 +1,26 @@
+{$asmmode att}
+
+const
+  Count=100;
+
+type
+  trec=record
+    a,b,c : longint;
+  end;
+
+
+var
+  r : trec;
+begin
+  asm
+    movl %es:46(%edi),%eax
+    movl 2+trec.b(%esi),%eax
+    movl trec.b(,%esi,(2*4)),%eax
+    movl r.c(,%esi,(2*4)),%eax
+    movl %fs:(0x46c),%eax
+    movl Count,%eax
+    movl Count*100,%eax
+    movl trec.b+2,%eax
+    movl trec.b+2(%esi),%eax
+  end;
+end.

+ 25 - 0
tests/ts010025.pp

@@ -0,0 +1,25 @@
+{$asmmode intel}
+
+const
+  Count=100;
+
+type
+  trec=record
+    a,b : longint;
+  end;
+
+var
+  r : trec;
+begin
+  asm
+    mov [esi+r],eax
+    mov fs:[2+trec.b],eax
+    mov [esi+2+trec.b],eax
+    mov trec[esi].b,eax
+    mov fs:[046ch],eax
+    mov eax,trec.b+2
+    mov trec[esi].b+2,eax
+    mov eax,Count
+    mov eax,Count*100
+  end;
+end.