* Evaluate currency constant expressions when the currency type is 64-bit integer. Issue #28749.

git-svn-id: trunk@33334 -
This commit is contained in:
yury 2016-03-26 17:48:50 +00:00
parent 12bf033606
commit d4d70d3865
3 changed files with 19 additions and 0 deletions

1
.gitattributes vendored
View File

@ -14924,6 +14924,7 @@ tests/webtbs/tw28718b.pp svneol=native#text/plain
tests/webtbs/tw28718c.pp svneol=native#text/plain
tests/webtbs/tw28718d.pp svneol=native#text/plain
tests/webtbs/tw28748.pp svneol=native#text/plain
tests/webtbs/tw28749.pp svneol=native#text/plain
tests/webtbs/tw2876.pp svneol=native#text/plain
tests/webtbs/tw28766.pp svneol=native#text/pascal
tests/webtbs/tw28801.pp svneol=native#text/plain

View File

@ -437,6 +437,10 @@ implementation
(lt in [pointerconstn,niln]) and
(rt in [pointerconstn,niln]) and
(nodetype in [ltn,lten,gtn,gten,equaln,unequaln,subn])
) or
(
(lt = ordconstn) and (ld.typ = orddef) and is_currency(ld) and
(rt = ordconstn) and (rd.typ = orddef) and is_currency(rd)
) then
begin
t:=nil;

14
tests/webtbs/tw28749.pp Normal file
View File

@ -0,0 +1,14 @@
uses
SysUtils;
var
s: string;
c: currency;
begin
c:=Currency(0.12) + Currency(0.14);
s:=CurrToStr(c);
s:=StringReplace(s, FormatSettings.DecimalSeparator, '.', []);
writeln('s=', s);
if s <> '0.26' then
Halt(1);
writeln('OK');
end.