+ inline01.pp inline test

This commit is contained in:
Jonas Maebe 2000-06-30 06:21:41 +00:00
parent 6d002dbc36
commit b440e794b6
2 changed files with 125 additions and 0 deletions

121
tests/test/inline01.pp Normal file
View File

@ -0,0 +1,121 @@
program inline01;
var
starti: longint;
i:longint;
{$INLINE ON}
procedure kkainl(var c: longint); inline;
begin
if c <> starti then
begin
writeln('bug');
halt(1);
end;
writeln('kka ',c);
c:=c+1;
if i <> starti+1 then
begin
writeln('bug');
halt(1);
end;
end;
procedure kka(var c:longint);
begin
if c <> starti then
begin
writeln('bug');
halt(1);
end;
writeln('kka ',c);
c:=c+1;
if i <> starti+1 then
begin
writeln('bug');
halt(1);
end;
end;
procedure kkb(var c:longint);inline;
begin
if c <> starti then
begin
writeln('bug');
halt(1);
end;
kka(c);
if i <> starti+1 then
begin
writeln('bug');
halt(1);
end;
writeln('kkb ',c);
end;
procedure kkb2(var c:longint);inline;
begin
if c <> starti then
begin
writeln('bug');
halt(1);
end;
kkainl(c);
if i <> starti+1 then
begin
writeln('bug');
halt(1);
end;
writeln('kkb ',c);
end;
procedure kkc(var c: longint);
begin
if c <> starti then
begin
writeln('bug');
halt(1);
end;
kkb(c);
if i <> starti+1 then
begin
writeln('bug');
halt(1);
end;
end;
procedure kkcinl(var c: longint); inline;
begin
if c <> starti then
begin
writeln('bug');
halt(1);
end;
kkb2(c);
if i <> starti+1 then
begin
writeln('bug');
halt(1);
end;
end;
begin
i:=5;
starti := 5;
kkc(i);
starti := i;
kkc(i);
starti := i;
kkb(i);
starti := i;
kkb(i);
starti := i;
kka(i);
starti := i;
kkcinl(i);
starti := i;
kkb2(i);
end.

View File

@ -32,3 +32,7 @@ case .................. testcase.pp tests case statements with byte and word
Arrays ................ testarr1.pp small test for open arrays with classes
Enumerations .......... testenm1.pp tests assignments of subrange
enumerations
Inline ................ inline01.pp tests recursive inlining, inlining
a procedure multiple times and
inlining procedures in other
inline procedures.