mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-06 11:47:19 +01:00
* new bugs
This commit is contained in:
parent
24e4003aa3
commit
bf9add1688
44
tests/webtbs/tw2494.pp
Normal file
44
tests/webtbs/tw2494.pp
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
{ Source provided for Free Pascal Bug Report 2494 }
|
||||||
|
{ Submitted by "Alan Mead" on 2003-05-17 }
|
||||||
|
{ e-mail: cubrewer@yahoo.com }
|
||||||
|
program dummy;
|
||||||
|
|
||||||
|
type
|
||||||
|
matrix_element = array[1..1] of byte;
|
||||||
|
big_matrix = array[1..1000000,1..610] of matrix_element;
|
||||||
|
|
||||||
|
longarray = array[0..0] of real;
|
||||||
|
|
||||||
|
{var
|
||||||
|
a : big_matrix;}
|
||||||
|
|
||||||
|
var p:pointer;
|
||||||
|
l : ^longarray;
|
||||||
|
size, storage : longint;
|
||||||
|
i,j:longint;
|
||||||
|
done:boolean;
|
||||||
|
|
||||||
|
begin
|
||||||
|
ReturnNilIfGrowHeapFails:=true;
|
||||||
|
writeln('Total heap available is ',MemAvail,' bytes');
|
||||||
|
writeln('Largest block available is ',MaxAvail,' bytes');
|
||||||
|
done := false;
|
||||||
|
size := 40000000;
|
||||||
|
repeat
|
||||||
|
size := round(size * 1.1);
|
||||||
|
storage := size * sizeof(real);
|
||||||
|
writeln('size=',size,' (storage=',storage,')');
|
||||||
|
getmem(l,storage);
|
||||||
|
if (l=nil) then
|
||||||
|
begin
|
||||||
|
done := true;
|
||||||
|
writeln('getmem() failed');
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
writeln('getmem() was successful');
|
||||||
|
freemem(l,storage);
|
||||||
|
end;
|
||||||
|
until (done);
|
||||||
|
end.
|
||||||
|
|
||||||
18
tests/webtbs/tw2503.pp
Normal file
18
tests/webtbs/tw2503.pp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{$mode delphi}
|
||||||
|
|
||||||
|
type
|
||||||
|
THyperPuperText = class
|
||||||
|
Procedure Hyper; OVERLOAD;
|
||||||
|
Procedure Hyper(n: integer); OVERLOAD;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure THyperPuperText.Hyper(n: integer);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
Procedure THyperPuperText.Hyper;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
end.
|
||||||
24
tests/webtbs/tw2504.pp
Normal file
24
tests/webtbs/tw2504.pp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{$ifdef fpc}{$mode delphi}{$endif}
|
||||||
|
|
||||||
|
type
|
||||||
|
BRec = record
|
||||||
|
fu: Function:Longint;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
a : Longint;
|
||||||
|
b : BRec;
|
||||||
|
|
||||||
|
function f1:longint;
|
||||||
|
begin
|
||||||
|
result:=10;
|
||||||
|
end;
|
||||||
|
|
||||||
|
begin
|
||||||
|
b.fu:=f1;
|
||||||
|
// a:=b.fu(); // works well
|
||||||
|
a:=b.fu; // causes "Error: incompatible types"
|
||||||
|
writeln(a);
|
||||||
|
if a<>10 then
|
||||||
|
halt(1);
|
||||||
|
end.
|
||||||
Loading…
Reference in New Issue
Block a user