fpc/tests/tbs/tb0602.pp
2016-06-20 15:55:10 +00:00

25 lines
359 B
ObjectPascal

{ This test explicity generates
dec(w,2) with w=1 of unsigned type word,
this generates range check error.
Thus, we need an explicit $R- }
{$R-}
{$ifdef fpc}
{$mode delphi}
{$endif}
procedure test;
var
w: word;
arr: array[0..1] of word;
begin
arr[1]:=2;
w:=1;
dec(w,arr[w]);
if cardinal(w)<>$ffff then
halt(1);
end;
begin
test;
end.