mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 22:14:25 +02:00
* extended even more (and now also fails)
git-svn-id: trunk@8195 -
This commit is contained in:
parent
6dfb507c8a
commit
f4e6a6bea0
@ -1,4 +1,5 @@
|
|||||||
{$mode objfpc}
|
{$mode objfpc}
|
||||||
|
{$inline on}
|
||||||
|
|
||||||
type
|
type
|
||||||
pshortstring=^shortstring;
|
pshortstring=^shortstring;
|
||||||
@ -15,11 +16,11 @@ type
|
|||||||
|
|
||||||
var
|
var
|
||||||
p,p2,p3: pointer;
|
p,p2,p3: pointer;
|
||||||
failed: boolean;
|
inlined, failed: boolean;
|
||||||
|
|
||||||
procedure error(err: longint);
|
procedure error(err: longint);
|
||||||
begin
|
begin
|
||||||
writeln('error near ',err);
|
writeln('error near ',err, ' (inlined: ',inlined,')');
|
||||||
failed:=true;
|
failed:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -135,6 +136,23 @@ begin
|
|||||||
t:=f9;
|
t:=f9;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure testrecinl; inline;
|
||||||
|
var
|
||||||
|
t: tr;
|
||||||
|
begin
|
||||||
|
inlined:=true;
|
||||||
|
t.a:='x';
|
||||||
|
t:=f1(@t.a[1]);
|
||||||
|
t:=f2(t.a);
|
||||||
|
t:=f3(t.a);
|
||||||
|
t:=f4(t);
|
||||||
|
p:=@t.a;
|
||||||
|
t:=f9;
|
||||||
|
inlined:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure testrec2;
|
procedure testrec2;
|
||||||
var
|
var
|
||||||
t: tr;
|
t: tr;
|
||||||
@ -144,7 +162,20 @@ begin
|
|||||||
t:=f10;
|
t:=f10;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{$if defined(cpupowerpc) or defined(cpui386)}
|
|
||||||
|
procedure testrec2inl; inline;
|
||||||
|
var
|
||||||
|
t: tr;
|
||||||
|
begin
|
||||||
|
inlined:=true;
|
||||||
|
t.a:='x';
|
||||||
|
temp2(t.a);
|
||||||
|
t:=f10;
|
||||||
|
inlined:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{$if defined(cpupowerpc) or defined(cpupowerpc64) or defined(cpui386)}
|
||||||
function f11: tr;
|
function f11: tr;
|
||||||
begin
|
begin
|
||||||
fillchar(result,sizeof(result),0);
|
fillchar(result,sizeof(result),0);
|
||||||
@ -168,6 +199,18 @@ begin
|
|||||||
{$endif}
|
{$endif}
|
||||||
stw r3,0(r4)
|
stw r3,0(r4)
|
||||||
{$endif}
|
{$endif}
|
||||||
|
{$ifdef cpupowerpc64}
|
||||||
|
la r3,t
|
||||||
|
{$ifndef darwin}
|
||||||
|
lis r4, p3@highesta
|
||||||
|
ori r4, r4, p3@highera
|
||||||
|
sldi r4, r4, 32
|
||||||
|
oris r4, r4, p3@ha
|
||||||
|
{$else darwin}
|
||||||
|
lis r4, p3@ha
|
||||||
|
{$endif darwin}
|
||||||
|
std r3,p3@l(r4)
|
||||||
|
{$endif}
|
||||||
{$ifdef cpui386}
|
{$ifdef cpui386}
|
||||||
leal t,%eax
|
leal t,%eax
|
||||||
movl %eax,p3
|
movl %eax,p3
|
||||||
@ -178,6 +221,46 @@ begin
|
|||||||
t:=f11;
|
t:=f11;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure testrec3inl; inline;
|
||||||
|
var
|
||||||
|
t: tr;
|
||||||
|
begin
|
||||||
|
inlined:=true;
|
||||||
|
asm
|
||||||
|
{$ifdef cpupowerpc}
|
||||||
|
la r3,t
|
||||||
|
{$ifndef macos}
|
||||||
|
lis r4,p3@ha
|
||||||
|
addi r4,r4,p3@l
|
||||||
|
{$else}
|
||||||
|
lwz r4,p3(r2)
|
||||||
|
{$endif}
|
||||||
|
stw r3,0(r4)
|
||||||
|
{$endif}
|
||||||
|
{$ifdef cpupowerpc64}
|
||||||
|
la r3,t
|
||||||
|
{$ifndef darwin}
|
||||||
|
lis r4, p3@highesta
|
||||||
|
ori r4, r4, p3@highera
|
||||||
|
sldi r4, r4, 32
|
||||||
|
oris r4, r4, p3@ha
|
||||||
|
{$else darwin}
|
||||||
|
lis r4, p3@ha
|
||||||
|
{$endif darwin}
|
||||||
|
std r3,p3@l(r4)
|
||||||
|
{$endif}
|
||||||
|
{$ifdef cpui386}
|
||||||
|
leal t,%eax
|
||||||
|
movl %eax,p3
|
||||||
|
{$endif}
|
||||||
|
end;
|
||||||
|
|
||||||
|
t.a:='x';
|
||||||
|
t:=f11;
|
||||||
|
inlined:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
|
||||||
@ -193,13 +276,31 @@ begin
|
|||||||
t:=f8(t);
|
t:=f8(t);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure testarrinl; inline;
|
||||||
|
var
|
||||||
|
t: ta;
|
||||||
|
begin
|
||||||
|
inlined:=true;
|
||||||
|
t[3]:='x';
|
||||||
|
t:=f5(@t[3][1]);
|
||||||
|
t:=f6(t[3]);
|
||||||
|
t:=f7(t[3]);
|
||||||
|
t:=f8(t);
|
||||||
|
inlined:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
testrec;
|
testrec;
|
||||||
|
testrecinl;
|
||||||
testrec2;
|
testrec2;
|
||||||
|
testrec2inl;
|
||||||
{$if defined(cpupowerpc) or defined(cpui386)}
|
{$if defined(cpupowerpc) or defined(cpui386)}
|
||||||
testrec3;
|
testrec3;
|
||||||
{$endif}
|
{$endif}
|
||||||
testarr;
|
testarr;
|
||||||
|
testarrinl;
|
||||||
if failed then
|
if failed then
|
||||||
halt(1);
|
halt(1);
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user