Browse Source

+ test for new inlining (fails currently)

git-svn-id: trunk@1631 -
Jonas Maebe 20 years ago
parent
commit
23cd46151a
2 changed files with 44 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 43 0
      tests/test/tinline5.pp

+ 1 - 0
.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

+ 43 - 0
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.