fpc/tests/webtbs/tw36587.pp
florian 7a6bd84bc0 * cast only the longint
git-svn-id: trunk@45325 -
2020-05-10 12:52:17 +00:00

42 lines
572 B
ObjectPascal

{$R-}
{$Q-}
const
A1 = 1000000;
B1 = 60;
C1 = 6000000;
T1 = A1*B1;
T2 = A1*C1;
procedure dotest(P: longint);
var
i64: Int64;
begin
i64 := 0;
i64 := i64 + P * B1 * int64(A1);
writeln(i64);
if i64 <> P*int64(T1) then
Halt(1);
i64 := 0;
i64 := i64 + P * B1 * A1;
writeln(i64);
if i64 <> P*T1 then
Halt(2);
i64 := 0;
i64 := i64 + P * C1 * A1;
writeln(i64);
{$ifdef CPUINT64}
if i64 <> P*T2 then
{$else CPUINT64}
if i64 <> P*Longint(T2) then
{$endif CPUINT64}
Halt(3);
end;
begin
dotest(1000000);
writeln('OK.');
end.