Explorar o código

* test case for inlining bug

pierre %!s(int64=25) %!d(string=hai) anos
pai
achega
00761cc37d
Modificáronse 1 ficheiros con 23 adicións e 0 borrados
  1. 23 0
      tests/test/testinl.pp

+ 23 - 0
tests/test/testinl.pp

@@ -0,0 +1,23 @@
+{$inline on}
+procedure test(var a : longint;b : longint);inline;
+
+begin
+  a:=32-b;
+end;
+
+procedure test2(var a : longint;b : longint);
+
+begin
+  a:=32-b;
+end;
+
+  var
+    a,b : longint;
+begin
+  test2(a,16);
+  Writeln('a=',a,' should be 16');
+  if (a<>16) then halt(1);
+  test(a,16);
+  Writeln('a=',a,' should be 16');
+  if (a<>16) then halt(1);
+end.