mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 17:29:10 +02:00
+ bug256-258
This commit is contained in:
parent
67eb0c83da
commit
0e57fc0f34
@ -18,7 +18,6 @@ Type
|
|||||||
Procedure VirtualMethod; virtual;
|
Procedure VirtualMethod; virtual;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
Constructor Y.Init(NewA:LongInt);
|
Constructor Y.Init(NewA:LongInt);
|
||||||
Begin
|
Begin
|
||||||
A:=NewA;
|
A:=NewA;
|
||||||
|
14
tests/tbs0220.pp
Normal file
14
tests/tbs0220.pp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
type
|
||||||
|
a = array[0..100] of char;
|
||||||
|
|
||||||
|
var
|
||||||
|
a1 : a;
|
||||||
|
s : string;
|
||||||
|
begin
|
||||||
|
a1[0]:='1';a1[2]:='2';a1[3]:='3';
|
||||||
|
a1[4]:='4';a1[5]:='5';a1[6]:='6';
|
||||||
|
a1[7]:='7';a1[8]:='8';a1[9]:='9';
|
||||||
|
a1[10]:='0';a1[11]:='1';
|
||||||
|
s:=Copy(a1,1,10);
|
||||||
|
if s<>'1234567890' then halt(1);
|
||||||
|
end.
|
13
tests/tbs0221.pp
Normal file
13
tests/tbs0221.pp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
var
|
||||||
|
r : double;
|
||||||
|
c : char;
|
||||||
|
begin
|
||||||
|
r:=1.;
|
||||||
|
c:=^.; { this compile in tp7, c should contain 'n'/#110 }
|
||||||
|
if c<>#110 then
|
||||||
|
begin
|
||||||
|
Writeln('FPC does not support ^. character!');
|
||||||
|
Halt(1);
|
||||||
|
end;
|
||||||
|
end.
|
13
tests/tbs0256.pp
Normal file
13
tests/tbs0256.pp
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
{$mode tp}
|
||||||
|
|
||||||
|
{$undef dummy }
|
||||||
|
|
||||||
|
{$ifdef dummy}
|
||||||
|
procedure test;
|
||||||
|
begin
|
||||||
|
foreach({$ifndef TP}@{$endif}add_to_browserlog);
|
||||||
|
end;
|
||||||
|
{$endif BrowserLog}
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
18
tests/tbs0257.pp
Normal file
18
tests/tbs0257.pp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{$mode tp}
|
||||||
|
|
||||||
|
type proc = procedure(a : longint);
|
||||||
|
procedure test(b : longint);
|
||||||
|
begin
|
||||||
|
Writeln('Test ',b);
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
t : proc;
|
||||||
|
|
||||||
|
begin
|
||||||
|
t:=test;
|
||||||
|
t:=proc(test);
|
||||||
|
test(3);
|
||||||
|
t(5);
|
||||||
|
end.
|
||||||
|
|
43
tests/tbs0258.pp
Normal file
43
tests/tbs0258.pp
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
program test_set;
|
||||||
|
|
||||||
|
var error : boolean;
|
||||||
|
|
||||||
|
|
||||||
|
procedure test;
|
||||||
|
|
||||||
|
var
|
||||||
|
i : longint;
|
||||||
|
x : array [1..32] of byte;
|
||||||
|
|
||||||
|
begin
|
||||||
|
error:=false;
|
||||||
|
for i:=1 to 32 do x[i]:=$ff;
|
||||||
|
i:=1;
|
||||||
|
if i in [1,3,5,8,11,14,15] then
|
||||||
|
writeln('1 is in [1,3,5,8,11,14,15]')
|
||||||
|
else
|
||||||
|
writeln('Error in set');
|
||||||
|
i:=135;
|
||||||
|
if i in [1,3,5,8,11,14,15] then
|
||||||
|
begin
|
||||||
|
writeln('Error : 135 is in [1,3,5,8,11,14,15]');
|
||||||
|
error:=true;
|
||||||
|
end;
|
||||||
|
for i:=1 to 32 do x[i]:=0;
|
||||||
|
i:=135;
|
||||||
|
if i in [1,3,5,8,11,14,15] then
|
||||||
|
begin
|
||||||
|
writeln('Second try Error : 135 is in [1,3,5,8,11,14,15]')
|
||||||
|
error:=true;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
if error then
|
||||||
|
writeln('Result of 135 in [1,3,5,8,11,14,15] depends on x array !!');
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
test;
|
||||||
|
if error then halt(1);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user