From 23cd46151ac08d559824bf5a5903353a3c1b7320 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Wed, 2 Nov 2005 15:11:17 +0000 Subject: [PATCH] + test for new inlining (fails currently) git-svn-id: trunk@1631 - --- .gitattributes | 1 + tests/test/tinline5.pp | 43 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 tests/test/tinline5.pp diff --git a/.gitattributes b/.gitattributes index b90ca7e693..8e03d8aad8 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/tests/test/tinline5.pp b/tests/test/tinline5.pp new file mode 100644 index 0000000000..e784cc246c --- /dev/null +++ b/tests/test/tinline5.pp @@ -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.