mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 16:50:25 +02:00
+ added tests, which check that 'test [reg+const*recordtype], 1' and
'test [reg+const*recordtype.recordfield], 1' produce an 'unable to determine operand size' error git-svn-id: trunk@38229 -
This commit is contained in:
parent
6fafac65fb
commit
34c9136283
4
.gitattributes
vendored
4
.gitattributes
vendored
@ -12504,6 +12504,10 @@ tests/test/tasm17.pp svneol=native#text/plain
|
||||
tests/test/tasm18.pp svneol=native#text/plain
|
||||
tests/test/tasm18a.pp svneol=native#text/plain
|
||||
tests/test/tasm18b.pp svneol=native#text/plain
|
||||
tests/test/tasm18c.pp svneol=native#text/plain
|
||||
tests/test/tasm18d.pp svneol=native#text/plain
|
||||
tests/test/tasm18e.pp svneol=native#text/plain
|
||||
tests/test/tasm18f.pp svneol=native#text/plain
|
||||
tests/test/tasm2.inc svneol=native#text/plain
|
||||
tests/test/tasm2.pp svneol=native#text/plain
|
||||
tests/test/tasm2a.pp svneol=native#text/plain
|
||||
|
35
tests/test/tasm18c.pp
Normal file
35
tests/test/tasm18c.pp
Normal file
@ -0,0 +1,35 @@
|
||||
{ %FAIL }
|
||||
{ %CPU=i8086,i386,x86_64 }
|
||||
program tasm18c;
|
||||
|
||||
{$ifdef FPC}
|
||||
{$asmmode intel}
|
||||
{$else}
|
||||
{$define CPUI8086}
|
||||
{$endif FPC}
|
||||
|
||||
const
|
||||
cval = 1;
|
||||
|
||||
type
|
||||
foo2 = packed record
|
||||
b1: byte;
|
||||
b2: byte;
|
||||
end;
|
||||
|
||||
begin
|
||||
asm
|
||||
{ this produces an error in TP7, while
|
||||
test [di + foo2*1], cval
|
||||
doesn't... go figure :) }
|
||||
{$ifdef CPUI8086}
|
||||
test [di + 1*foo2], cval
|
||||
{$endif}
|
||||
{$ifdef CPUI386}
|
||||
test [edi + 1*foo2], cval
|
||||
{$endif}
|
||||
{$ifdef CPUX86_64}
|
||||
test [rdi + 1*foo2], cval
|
||||
{$endif}
|
||||
end;
|
||||
end.
|
35
tests/test/tasm18d.pp
Normal file
35
tests/test/tasm18d.pp
Normal file
@ -0,0 +1,35 @@
|
||||
{ %FAIL }
|
||||
{ %CPU=i8086,i386,x86_64 }
|
||||
program tasm18d;
|
||||
|
||||
{$ifdef FPC}
|
||||
{$asmmode intel}
|
||||
{$else}
|
||||
{$define CPUI8086}
|
||||
{$endif FPC}
|
||||
|
||||
const
|
||||
cval = 1;
|
||||
|
||||
type
|
||||
foo2 = packed record
|
||||
b1: byte;
|
||||
b2: byte;
|
||||
end;
|
||||
|
||||
begin
|
||||
asm
|
||||
{ this produces an error in TP7, while
|
||||
test [di + foo2*5], cval
|
||||
doesn't... go figure :) }
|
||||
{$ifdef CPUI8086}
|
||||
test [di + 5*foo2], cval
|
||||
{$endif}
|
||||
{$ifdef CPUI386}
|
||||
test [edi + 5*foo2], cval
|
||||
{$endif}
|
||||
{$ifdef CPUX86_64}
|
||||
test [rdi + 5*foo2], cval
|
||||
{$endif}
|
||||
end;
|
||||
end.
|
39
tests/test/tasm18e.pp
Normal file
39
tests/test/tasm18e.pp
Normal file
@ -0,0 +1,39 @@
|
||||
{ %FAIL }
|
||||
{ %CPU=i8086,i386,x86_64 }
|
||||
program tasm18e;
|
||||
|
||||
{$ifdef FPC}
|
||||
{$asmmode intel}
|
||||
{$else}
|
||||
{$define CPUI8086}
|
||||
{$endif FPC}
|
||||
|
||||
const
|
||||
cval = 1;
|
||||
|
||||
type
|
||||
foo2 = packed record
|
||||
b1: byte;
|
||||
b2: byte;
|
||||
end;
|
||||
foo = packed record
|
||||
bb1: byte;
|
||||
fb2: foo2;
|
||||
end;
|
||||
|
||||
begin
|
||||
asm
|
||||
{ this produces an error in TP7, while
|
||||
test [di + 1*foo.fb2], cval
|
||||
doesn't... go figure :) }
|
||||
{$ifdef CPUI8086}
|
||||
test [di + 1*foo.fb2], cval
|
||||
{$endif}
|
||||
{$ifdef CPUI386}
|
||||
test [edi + 1*foo.fb2], cval
|
||||
{$endif}
|
||||
{$ifdef CPUX86_64}
|
||||
test [rdi + 1*foo.fb2], cval
|
||||
{$endif}
|
||||
end;
|
||||
end.
|
39
tests/test/tasm18f.pp
Normal file
39
tests/test/tasm18f.pp
Normal file
@ -0,0 +1,39 @@
|
||||
{ %FAIL }
|
||||
{ %CPU=i8086,i386,x86_64 }
|
||||
program tasm18e;
|
||||
|
||||
{$ifdef FPC}
|
||||
{$asmmode intel}
|
||||
{$else}
|
||||
{$define CPUI8086}
|
||||
{$endif FPC}
|
||||
|
||||
const
|
||||
cval = 1;
|
||||
|
||||
type
|
||||
foo2 = packed record
|
||||
b1: byte;
|
||||
b2: byte;
|
||||
end;
|
||||
foo = packed record
|
||||
bb1: byte;
|
||||
fb2: foo2;
|
||||
end;
|
||||
|
||||
begin
|
||||
asm
|
||||
{ this produces an error in TP7, while
|
||||
test [di + 5*foo.fb2], cval
|
||||
doesn't... go figure :) }
|
||||
{$ifdef CPUI8086}
|
||||
test [di + 5*foo.fb2], cval
|
||||
{$endif}
|
||||
{$ifdef CPUI386}
|
||||
test [edi + 5*foo.fb2], cval
|
||||
{$endif}
|
||||
{$ifdef CPUX86_64}
|
||||
test [rdi + 5*foo.fb2], cval
|
||||
{$endif}
|
||||
end;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user