mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 10:28:15 +02:00
25 lines
359 B
ObjectPascal
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.
|