fpc/tests/webtbs/tw40041.pp
2022-12-24 17:07:27 +01:00

26 lines
452 B
ObjectPascal

{ %OPT=-O4 }
{$mode objfpc}
function ShiftPM(x: single): single; noinline;
begin
result := x + 10.0 - 1.0;
end;
function ShiftMP(x: single): single; noinline;
begin
result := x - 1.0 + 10.0;
end;
begin
if ShiftPM(5.0) <> 14.0 then
begin
writeln('ShiftPM: got ', ShiftPM(5.0):0:1, ', expected 14.0.');
halt(1);
end;
if ShiftMP(5.0) <> 14.0 then
begin
writeln('ShiftMP: got ', ShiftMP(5.0):0:1, ', expected 14.0.');
halt(2);
end;
end.