mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-05 14:24:24 +02:00
31 lines
417 B
ObjectPascal
31 lines
417 B
ObjectPascal
{$mode objfpc}
|
|
uses sysutils;
|
|
{$r+}
|
|
|
|
var
|
|
l: longint;
|
|
c: cardinal;
|
|
n: longint;
|
|
begin
|
|
n := 0;
|
|
l := -1;
|
|
try
|
|
c := l;
|
|
except
|
|
writeln('caught 1!');
|
|
inc(n);
|
|
end;
|
|
c := cardinal($ffffffff);
|
|
try
|
|
l := c;
|
|
except
|
|
writeln('caught 2!');
|
|
inc(n);
|
|
end;
|
|
if n <> 2 then
|
|
begin
|
|
writeln('Still problems with range checking between longint/cardinal');
|
|
halt(1);
|
|
end;
|
|
end.
|