mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 12:26:02 +02:00
+ test for mantis #24189 (already works in trunk, still broken in 3.0)
git-svn-id: trunk@34290 -
This commit is contained in:
parent
8e0ee6599c
commit
20cbdf75ea
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -14828,6 +14828,7 @@ tests/webtbs/tw24072.pp svneol=native#text/pascal
|
|||||||
tests/webtbs/tw2409.pp svneol=native#text/plain
|
tests/webtbs/tw2409.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw24129.pp svneol=native#text/pascal
|
tests/webtbs/tw24129.pp svneol=native#text/pascal
|
||||||
tests/webtbs/tw24131.pp svneol=native#text/plain
|
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/tw24197.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2421.pp svneol=native#text/plain
|
tests/webtbs/tw2421.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw2423.pp svneol=native#text/plain
|
tests/webtbs/tw2423.pp svneol=native#text/plain
|
||||||
|
21
tests/webtbs/tw24189.pp
Normal file
21
tests/webtbs/tw24189.pp
Normal file
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user