fpc/tests/tbs/tb0570.pp
Jonas Maebe 85984c2d8f * insert proper type conversions when optimising logical operations and
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 -
2010-02-12 18:13:08 +00:00

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.