mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 06:49:23 +02:00
* Avoid compilation failure for PIC mode add a second variable to ensure .L1 is executed
git-svn-id: trunk@19179 -
This commit is contained in:
parent
07fabab526
commit
0b6d38df14
@ -4,21 +4,38 @@
|
|||||||
{$endif}
|
{$endif}
|
||||||
var
|
var
|
||||||
test : dword;
|
test : dword;
|
||||||
|
test2 : dword;
|
||||||
begin
|
begin
|
||||||
test:=$deadbeef;
|
test:=$deadbeef;
|
||||||
|
test2:=$deadbeef;
|
||||||
ASM
|
ASM
|
||||||
MOVL $0,%EAX
|
MOVL $16,%EAX
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
LEA .LLT(%RIP),%RBX
|
||||||
|
JMP (%RBX,%RAX)
|
||||||
|
{$else not FPC_PIC}
|
||||||
JMP .LLT(%RAX)
|
JMP .LLT(%RAX)
|
||||||
.align 16
|
{$endif not FPC_PIC}
|
||||||
|
.balign 16
|
||||||
.LLT:
|
.LLT:
|
||||||
.quad .L1,.L2
|
.quad .L3,.L2,.L1
|
||||||
.L2:
|
.L2:
|
||||||
MOVL $12341234,test
|
{$ifdef FPC_PIC}
|
||||||
|
MOVL $12341234,test2(%RIP)
|
||||||
|
JMP .L3(%RIP)
|
||||||
|
{$else not FPC_PIC}
|
||||||
|
MOVL $12341234,test2
|
||||||
|
JMP .L3
|
||||||
|
{$endif not FPC_PIC}
|
||||||
.L1:
|
.L1:
|
||||||
|
{$ifdef FPC_PIC}
|
||||||
|
MOVL $0,test(%RIP)
|
||||||
|
{$else not FPC_PIC}
|
||||||
MOVL $0,test
|
MOVL $0,test
|
||||||
|
{$endif not FPC_PIC}
|
||||||
|
.L3:
|
||||||
END;
|
END;
|
||||||
if test<>0 then
|
if (test<>0) or (test2<>$deadbeef) then
|
||||||
halt(1);
|
halt(1);
|
||||||
writeln('ok');
|
writeln('ok');
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user