fpc/tests/test/tnest1.pp
Jonas Maebe 41fba0c4f7 * switched to using the stack pointer as base register for the temp allocator
instead of the frame pointer register:
      1) we exactly know the offsets of the temps from the stack pointer
         after pass 1 (based on the require parameter stack size for called
         routines), while we don't know it for the frame pointer (it depends
         on the number of saved registers)
      2) temp offsets from the stack pointer are positive while those from
         the frame pointer are negative, and we can directly encode much
         bigger positive offsets in the instructions
   o move the stack pointer register to a virtual register in
     loadparentfpn, because many instructions cannot directly operate
     on/with the stack pointer
   o add the necessary register interference edges for the stack pointer
     register

git-svn-id: trunk@29938 -
2015-02-23 22:54:03 +00:00

39 lines
481 B
ObjectPascal

{$inline on}
procedure test(l1, l2: longint);
var
a1: cardinal;
d1, d2: double;
a2: cardinal;
procedure nested; inline;
begin
l1:=1;
l2:=2;
d1:=3.0;
d2:=4.0;
end;
begin
a1:=$deadbeef;
a2:=$cafe0000;
nested;
if a1<>$deadbeef then
halt(1);
if a2<>$cafe0000 then
halt(2);
if l1<>1 then
halt(3);
if l2<>2 then
halt(4);
if d1<>3.0 then
halt(5);
if d2<>4.0 then
halt(6);
end;
begin
test(5,6);
end.