Răsfoiți Sursa

+ test for mantis #24189 (already works in trunk, still broken in 3.0)

git-svn-id: trunk@34290 -
Jonas Maebe 9 ani în urmă
părinte
comite
20cbdf75ea
2 a modificat fișierele cu 22 adăugiri și 0 ștergeri
  1. 1 0
      .gitattributes
  2. 21 0
      tests/webtbs/tw24189.pp

+ 1 - 0
.gitattributes

@@ -14828,6 +14828,7 @@ tests/webtbs/tw24072.pp svneol=native#text/pascal
 tests/webtbs/tw2409.pp svneol=native#text/plain
 tests/webtbs/tw24129.pp svneol=native#text/pascal
 tests/webtbs/tw24131.pp svneol=native#text/plain
+tests/webtbs/tw24189.pp svneol=native#text/plain
 tests/webtbs/tw24197.pp svneol=native#text/plain
 tests/webtbs/tw2421.pp svneol=native#text/plain
 tests/webtbs/tw2423.pp svneol=native#text/plain

+ 21 - 0
tests/webtbs/tw24189.pp

@@ -0,0 +1,21 @@
+{$mode objfpc}
+{$assertions on}
+
+procedure DivMod(a: Int64; b: Int64; out res, rem: Int64); inline;
+begin
+  res:=a div b; rem:=a-b*res;
+end;
+
+procedure Test;
+var
+  res, rem: Int64;
+begin
+  res:=5; DivMod(res {!}, 2, res {!}, rem);
+  Assert(res=2); // OK
+  Assert(rem=1); // "2-2*2 = -2" if inlined
+end;
+
+begin
+  test;
+end.
+