mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-07 16:28:22 +02:00

compares by avoiding unnecessary sign extensions (fixes bug reported in http://lists.freepascal.org/lists/fpc-pascal/2010-January/023907.html ) * never throw away int2int type conversions on bitpacked loads, because in these cases the proper bits still need to be selected git-svn-id: trunk@14892 -
37 lines
827 B
ObjectPascal
37 lines
827 B
ObjectPascal
program rangtest ;
|
|
|
|
type
|
|
trange = 0..2030 ;
|
|
ytrange = 1990..2030 ;
|
|
|
|
CONST
|
|
lrange = low ( trange ) ;
|
|
hrange = high ( trange ) ;
|
|
ylrange = low ( ytrange ) ;
|
|
yhrange = high ( ytrange ) ;
|
|
|
|
var
|
|
bbb : trange ;
|
|
kkk : longint ;
|
|
xyzzy : array [ ytrange, 1..100 ] of
|
|
record
|
|
xyzp : longint ;
|
|
xyzb : boolean ;
|
|
end ;
|
|
|
|
begin (*$r+,s+,o+*)
|
|
bbb := 0 ;
|
|
kkk := 1 ;
|
|
IF ( bbb >= ylrange ) // this IFstatement can not be found in the assembler file
|
|
AND ( bbb <= yhrange ) // and the program stops with range error
|
|
THEN begin //
|
|
WITH xyzzy[bbb,kkk] DO
|
|
BEGIN
|
|
halt(1);
|
|
xyzp := 2 ;
|
|
xyzb := True ;
|
|
END ;
|
|
end
|
|
else writeln ( 'out' ) ;
|
|
end.
|