From 20cbdf75ea34f03b5af98b6d8b00dfaedf38b304 Mon Sep 17 00:00:00 2001 From: Jonas Maebe Date: Fri, 12 Aug 2016 13:40:19 +0000 Subject: [PATCH] + test for mantis #24189 (already works in trunk, still broken in 3.0) git-svn-id: trunk@34290 - --- .gitattributes | 1 + tests/webtbs/tw24189.pp | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 tests/webtbs/tw24189.pp diff --git a/.gitattributes b/.gitattributes index 20c56e58b7..5c2d56a712 100644 --- a/.gitattributes +++ b/.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 diff --git a/tests/webtbs/tw24189.pp b/tests/webtbs/tw24189.pp new file mode 100644 index 0000000000..37a04a113f --- /dev/null +++ b/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. +