fpc/tests/webtbs/tw15843.pp
Jonas Maebe 8542632ebe * fixed evaluating constant expressions consisting of more than one term and
that start with a minus in the intel assembler reader (mantis #15843)

git-svn-id: trunk@15041 -
2010-03-24 20:52:31 +00:00

22 lines
289 B
ObjectPascal

{ %opt=-Cg- }
{ %cpu=i386 }
{$asmmode intel}
var
a: array[0..3] of byte;
l: longint;
begin
a[0]:=1;
a[1]:=2;
a[2]:=3;
a[2]:=4;
asm
lea ecx,[a]
inc ecx
movzx eax, byte ptr[ecx-1+1] // bug in this line (-2)
mov [l],eax
end;
if l<>2 then
halt(1);
end.