mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 23:21:57 +02:00
+ test for new inlining (fails currently)
git-svn-id: trunk@1631 -
This commit is contained in:
parent
6279c187f9
commit
23cd46151a
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -5328,6 +5328,7 @@ tests/test/tinline1.pp svneol=native#text/plain
|
||||
tests/test/tinline2.pp svneol=native#text/plain
|
||||
tests/test/tinline3.pp svneol=native#text/plain
|
||||
tests/test/tinline4.pp svneol=native#text/plain
|
||||
tests/test/tinline5.pp -text
|
||||
tests/test/tint641.pp svneol=native#text/plain
|
||||
tests/test/tint642.pp svneol=native#text/plain
|
||||
tests/test/tint643.pp svneol=native#text/plain
|
||||
|
43
tests/test/tinline5.pp
Normal file
43
tests/test/tinline5.pp
Normal file
@ -0,0 +1,43 @@
|
||||
{$inline on}
|
||||
{$mode objfpc}
|
||||
|
||||
type
|
||||
tc = class
|
||||
lf: longint;
|
||||
procedure t(const l: longint); inline;
|
||||
end;
|
||||
|
||||
var
|
||||
a: longint;
|
||||
|
||||
procedure tc.t(const l: longint); inline;
|
||||
begin
|
||||
lf := 10;
|
||||
if (l <> 5) then
|
||||
begin
|
||||
writeln('error class');
|
||||
halt(1);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
procedure t(const l: longint); inline;
|
||||
begin
|
||||
a := 10;
|
||||
if (l <> 5) then
|
||||
begin
|
||||
writeln('error proc');
|
||||
halt(1);
|
||||
end;
|
||||
end;
|
||||
|
||||
var
|
||||
c: tc;
|
||||
|
||||
begin
|
||||
c := tc.create;
|
||||
c.lf := 5;
|
||||
c.t(c.lf);
|
||||
a := 5;
|
||||
t(a);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user