mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-28 21:00:28 +02:00
*** empty log message ***
This commit is contained in:
parent
6ea5534991
commit
fc39bd3f95
@ -2,5 +2,6 @@ This directory contains some tests which test the optimizer
|
||||
Register variables:
|
||||
Enumerations .......................... testreg1.pp
|
||||
Readln ................................ testreg2.pp
|
||||
Range checking ........................ testreg3.pp
|
||||
Common subexpression elimination (assembler)
|
||||
Multidimensional array index operation. testcse1.pp
|
||||
|
33
tests/testopt/testreg3.pp
Normal file
33
tests/testopt/testreg3.pp
Normal file
@ -0,0 +1,33 @@
|
||||
{ $OPT=-Or}
|
||||
program rangecse;
|
||||
|
||||
{$r+}
|
||||
|
||||
type
|
||||
pa = ^ta;
|
||||
ta = array[0..100] of longint;
|
||||
|
||||
procedure t;
|
||||
var
|
||||
i, j: longint;
|
||||
p: pa;
|
||||
begin
|
||||
new(p);
|
||||
fillchar(p^,101*sizeof(longint),0);
|
||||
p^[100] := 5;
|
||||
j := 5;
|
||||
for i:=1 to 101 do
|
||||
if j=p^[i-1] then
|
||||
begin
|
||||
writeln('found!');
|
||||
dispose(p);
|
||||
exit;
|
||||
end;
|
||||
writeln('failed..');
|
||||
dispose(p);
|
||||
halt(1);
|
||||
end;
|
||||
|
||||
begin
|
||||
t;
|
||||
end.
|
Loading…
Reference in New Issue
Block a user