From 43b4274a6d3b83453a2df2c28aa2d21d4d7bcac0 Mon Sep 17 00:00:00 2001 From: pierre Date: Fri, 3 Aug 2001 23:48:20 +0000 Subject: [PATCH] * fix most m68k errors due to intel assembler code --- tests/tbs/tb0001.pp | 2 ++ tests/tbs/tb0030.pp | 1 + tests/tbs/tb0037.pp | 1 + tests/tbs/tb0038.pp | 3 +++ tests/tbs/tb0071.pp | 11 +++++++++-- tests/tbs/tb0072.pp | 18 ++++++++++++++++-- tests/tbs/tb0104.pp | 1 + tests/tbs/tb0105.pp | 1 + tests/tbs/tb0106.pp | 1 + tests/tbs/tb0118.pp | 7 +++++++ tests/tbs/tb0142.pp | 5 +++++ tests/tbs/tb0144.pp | 3 +++ tests/tbs/tb0145.pp | 3 ++- tests/tbs/tb0168.pp | 1 + tests/tbs/tb0192.pp | 1 + tests/tbs/tb0193.pp | 9 ++++++++- tests/tbs/tb0194.pp | 1 + tests/tbs/tb0220.pp | 4 +++- tests/tbs/tb0236.pp | 1 + tests/tbs/tb0241.pp | 2 ++ tests/tbs/tb0244.pp | 1 + tests/tbs/tb0261.pp | 13 ++++++++++++- tests/tbs/tb0270.pp | 1 + tests/tbs/tb0272.pp | 2 +- tests/tbs/tb0275.pp | 3 ++- tests/tbs/tb0319.pp | 3 ++- tests/tbs/tb0320.pp | 3 ++- tests/tbs/tb0322.pp | 3 ++- tests/tbs/tb0367.pp | 1 + 29 files changed, 93 insertions(+), 13 deletions(-) diff --git a/tests/tbs/tb0001.pp b/tests/tbs/tb0001.pp index ed2721a242..b1d6be095a 100644 --- a/tests/tbs/tb0001.pp +++ b/tests/tbs/tb0001.pp @@ -1,3 +1,5 @@ +{ %CPU=i386 } +{ %OPT=-O2 } { Old file: tbs0002.pp } { tests for the endless bugs in the optimizer OK 0.9.2 } diff --git a/tests/tbs/tb0030.pp b/tests/tbs/tb0030.pp index 275fd0e107..356296804d 100644 --- a/tests/tbs/tb0030.pp +++ b/tests/tbs/tb0030.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { Old file: tbs0034.pp } { shows wrong line numbering when asmbler is parsed in direct mode. } diff --git a/tests/tbs/tb0037.pp b/tests/tbs/tb0037.pp index 98f3044627..334489f44a 100644 --- a/tests/tbs/tb0037.pp +++ b/tests/tbs/tb0037.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { %OPT= -Rintel } { Old file: tbs0042.pp } diff --git a/tests/tbs/tb0038.pp b/tests/tbs/tb0038.pp index 6fc53ffa66..f3e8722276 100644 --- a/tests/tbs/tb0038.pp +++ b/tests/tbs/tb0038.pp @@ -1,3 +1,6 @@ +{ %CPU=i386 } +{ %OPT=-Ratt -Anasm } +{ %NOTE=This test requires an installed Nasm } { Old file: tbs0043.pp } { shows assembler nasm output fpu opcodes problem OK 0.99.6 (PFV) } diff --git a/tests/tbs/tb0071.pp b/tests/tbs/tb0071.pp index cc091bf097..bfa0a7b6b6 100644 --- a/tests/tbs/tb0071.pp +++ b/tests/tbs/tb0071.pp @@ -1,12 +1,19 @@ -{ %OPT=-Rintel } - { Old file: tbs0078.pp } { Shows problems with longint constant in intel asm OK 0.99.1 (CEC) } { shows error with asm_size_mismatch } Begin +{$ifdef CPUI386} +{$asmmode intel } asm mov eax, 2147483647 mov eax, 2000000000 end; +{$endif CPUI386} +{$ifdef CPU68K} + asm + move.l #2147483647,d0 + move.l #2000000000,d1 + end; +{$endif CPU68K} end. diff --git a/tests/tbs/tb0072.pp b/tests/tbs/tb0072.pp index 74d7e04640..36a5d32ddc 100644 --- a/tests/tbs/tb0072.pp +++ b/tests/tbs/tb0072.pp @@ -1,14 +1,28 @@ -{ %OPT= -Rintel } { Old file: tbs0079.pp } { Shows problems with stackframe with assembler keyword OK 0.99.1 (CEC) } +{ This test does not really + give a good result + because you need to look into + the assembler to see if there is an error or not :( PM } + +{$ifdef CPUI386} +{$asmmode intel} +{$endif CPUI386} procedure nothing(x,y: longint);assembler; +{$ifdef CPUI386} asm mov eax,x mov ebx,y end; - +{$endif CPUI386} +{$ifdef CPU68K} +asm + move.l x,d0 + move.l y,d1 +end; +{$endif CPU68K} {procedure nothing(x,y: longint); begin diff --git a/tests/tbs/tb0104.pp b/tests/tbs/tb0104.pp index 5f88476260..8c4f7b5476 100644 --- a/tests/tbs/tb0104.pp +++ b/tests/tbs/tb0104.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { Old file: tbs0123.pp } { Asm, problem with intel assembler (shrd) OK 0.99.11 (PM) } diff --git a/tests/tbs/tb0105.pp b/tests/tbs/tb0105.pp index 3cece386ce..e80091bd45 100644 --- a/tests/tbs/tb0105.pp +++ b/tests/tbs/tb0105.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { %OPT= -Aas } { Old file: tbs0124.pp } diff --git a/tests/tbs/tb0106.pp b/tests/tbs/tb0106.pp index 76998f8fe7..d0d29d036d 100644 --- a/tests/tbs/tb0106.pp +++ b/tests/tbs/tb0106.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { Old file: tbs0124b.pp } { } diff --git a/tests/tbs/tb0118.pp b/tests/tbs/tb0118.pp index 1d5949cadd..08b73c1892 100644 --- a/tests/tbs/tb0118.pp +++ b/tests/tbs/tb0118.pp @@ -19,9 +19,16 @@ procedure tpo.pi2; begin end; procedure crushesi;assembler; +{$ifdef CPUI386} asm movl %eax,%esi end ['EAX','ESI']; +{$endif CPUI386} +{$ifdef CPU68K} +asm + move.l d0,a5 +end ['d0','a5']; +{$endif CPU68K} var p1 : tpt; begin diff --git a/tests/tbs/tb0142.pp b/tests/tbs/tb0142.pp index cf0cc98b40..2d786b9e8a 100644 --- a/tests/tbs/tb0142.pp +++ b/tests/tbs/tb0142.pp @@ -11,6 +11,11 @@ end; begin asm +{$ifdef CPUI386} call {$ifdef dummy}free1{$else}free2{$endif} +{$endif CPUI386} +{$ifdef CPU68K} + jsr {$ifdef dummy}free1{$else}free2{$endif} +{$endif CPU68K} end; end. diff --git a/tests/tbs/tb0144.pp b/tests/tbs/tb0144.pp index 17af17afcb..e6d5216531 100644 --- a/tests/tbs/tb0144.pp +++ b/tests/tbs/tb0144.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { Old file: tbs0174.pp } { Asm, offsets of fields are not possible yet OK 0.99.9 (PFV) } @@ -12,7 +13,9 @@ var procedure kl;assembler; asm +{$ifdef CPUI386} movl tobj.l,%eax // tobj.l should return the offset of l in tobj +{$endif CPUI386} end; diff --git a/tests/tbs/tb0145.pp b/tests/tbs/tb0145.pp index 438ff9cc6b..b6d12ff030 100644 --- a/tests/tbs/tb0145.pp +++ b/tests/tbs/tb0145.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { Old file: tbs0175.pp } { Asm, mov word,%eax should not be allowed without casting emits a warning (or error with range checking enabled) OK 0.99.11 (PM) } @@ -10,4 +11,4 @@ begin asm movl w,%ecx end; -end. \ No newline at end of file +end. diff --git a/tests/tbs/tb0168.pp b/tests/tbs/tb0168.pp index 8a57c5e325..bf9b508b82 100644 --- a/tests/tbs/tb0168.pp +++ b/tests/tbs/tb0168.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { %OPT= -Ratt } { Old file: tbs0201.pp } diff --git a/tests/tbs/tb0192.pp b/tests/tbs/tb0192.pp index fe4607e52a..601c4c5ba8 100644 --- a/tests/tbs/tb0192.pp +++ b/tests/tbs/tb0192.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { Old file: tbs0226.pp } { Asm, offset of var is not allowed as constant OK 0.99.11 (PFV) } diff --git a/tests/tbs/tb0193.pp b/tests/tbs/tb0193.pp index a10d6ca0c7..94eef632cb 100644 --- a/tests/tbs/tb0193.pp +++ b/tests/tbs/tb0193.pp @@ -4,10 +4,17 @@ function getheapsize:longint;assembler; var heapsize : longint;external name 'HEAPSIZE'; - sbrk : longint;external name '___sbrk'; +// sbrk : longint;external name '___sbrk'; asm +{$ifdef CPUI386} movl HEAPSIZE,%eax end ['EAX']; +{$endif CPUI386} +{$ifdef CPU68K} + move.l HEAPSIZE,d0 +end ['D0']; +{$endif CPU68K} + begin writeln(getheapsize); diff --git a/tests/tbs/tb0194.pp b/tests/tbs/tb0194.pp index 506a410529..78cb8adf11 100644 --- a/tests/tbs/tb0194.pp +++ b/tests/tbs/tb0194.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { Old file: tbs0228.pp } { Asm, wrong warning for size OK 0.99.11 (PFV) } diff --git a/tests/tbs/tb0220.pp b/tests/tbs/tb0220.pp index c7103c28de..b2f5fc1f83 100644 --- a/tests/tbs/tb0220.pp +++ b/tests/tbs/tb0220.pp @@ -1,7 +1,9 @@ -{ %OPT= -O1} +{ %CPU=i386 } +{ %OPT= -O1 } { Old file: tbs0259.pp } { problem with optimizer for real math (use -O1) OK 0.99.12 (PM) } +{ -O1 is not allowed for m68k } VAR time1,time2 : Real; BEGIN diff --git a/tests/tbs/tb0236.pp b/tests/tbs/tb0236.pp index 40bff2030f..14867dce20 100644 --- a/tests/tbs/tb0236.pp +++ b/tests/tbs/tb0236.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { Old file: tbs0276.pp } { Asm, intel reference parsing incompatibility OK 0.99.13 (PFV) } diff --git a/tests/tbs/tb0241.pp b/tests/tbs/tb0241.pp index 8451394c81..b59c21dba7 100644 --- a/tests/tbs/tb0241.pp +++ b/tests/tbs/tb0241.pp @@ -1,3 +1,5 @@ +{ %OPT=-al } +{ this forces use of GNU as } { Old file: tbs0282.pp } { long mangledname problem with -Aas OK 0.99.13 (PFV) } diff --git a/tests/tbs/tb0244.pp b/tests/tbs/tb0244.pp index c2f2cf4d34..a046552549 100644 --- a/tests/tbs/tb0244.pp +++ b/tests/tbs/tb0244.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { Old file: tbs0285.pp } { Asm, TYPE not support in intel mode OK 0.99.13 (PFV) } diff --git a/tests/tbs/tb0261.pp b/tests/tbs/tb0261.pp index 54f615d607..cedd1e335f 100644 --- a/tests/tbs/tb0261.pp +++ b/tests/tbs/tb0261.pp @@ -8,6 +8,7 @@ var cb : word; procedure A(B: word); assembler; inline; +{$ifdef CPUI386} asm MOV AX,B CMP AX,[CB] @@ -15,8 +16,18 @@ asm MOV [CB],AX @@10: end; +{$endif CPUI386} +{$ifdef CPU68K} +asm + move.w b,d0 + cmp.w cb,d0 + beq @L10 + move.w d0,cb +@L10: +end; +{$endif CPU68K} begin a(1); a(2); -end. \ No newline at end of file +end. diff --git a/tests/tbs/tb0270.pp b/tests/tbs/tb0270.pp index cb2ae4c663..95fa12dbf6 100644 --- a/tests/tbs/tb0270.pp +++ b/tests/tbs/tb0270.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { Old file: tbs0316.pp } { } diff --git a/tests/tbs/tb0272.pp b/tests/tbs/tb0272.pp index 82319780c9..407400d803 100644 --- a/tests/tbs/tb0272.pp +++ b/tests/tbs/tb0272.pp @@ -1,4 +1,4 @@ -{ %OPT=-Sen } +{ %OPT=-Sen -vnw } { %RESULT=217 } { Old file: tbs0318.pp } diff --git a/tests/tbs/tb0275.pp b/tests/tbs/tb0275.pp index a8347114d0..1d7014ded7 100644 --- a/tests/tbs/tb0275.pp +++ b/tests/tbs/tb0275.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } { Old file: tbs0322.pp } { } @@ -24,4 +25,4 @@ end; writeln('Wrong size for TYPE'); halt(1); end; -end. \ No newline at end of file +end. diff --git a/tests/tbs/tb0319.pp b/tests/tbs/tb0319.pp index ce82589859..6192d02000 100644 --- a/tests/tbs/tb0319.pp +++ b/tests/tbs/tb0319.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } {$asmmode att} const @@ -31,4 +32,4 @@ begin movl %fs:(0x46c),%eax {$endif} end; -end. \ No newline at end of file +end. diff --git a/tests/tbs/tb0320.pp b/tests/tbs/tb0320.pp index 26cf01ea76..b1354e3eae 100644 --- a/tests/tbs/tb0320.pp +++ b/tests/tbs/tb0320.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } {$asmmode intel} const @@ -26,4 +27,4 @@ begin mov fs:[046ch],eax {$endif} end; -end. \ No newline at end of file +end. diff --git a/tests/tbs/tb0322.pp b/tests/tbs/tb0322.pp index c89308f006..28319a6216 100644 --- a/tests/tbs/tb0322.pp +++ b/tests/tbs/tb0322.pp @@ -1,7 +1,8 @@ +{ %CPU=i386 } {$IFDEF FPC} {$ASMMODE INTEL} {$ENDIF} -{$N+} +{$N+} FUNCTION Floor(M2:Comp):LONGINT;assembler; diff --git a/tests/tbs/tb0367.pp b/tests/tbs/tb0367.pp index b9e8669b48..4168701b54 100644 --- a/tests/tbs/tb0367.pp +++ b/tests/tbs/tb0367.pp @@ -1,3 +1,4 @@ +{ %CPU=i386 } {$ifdef fpc} {$mode delphi} {$asmmode intel}