fpc/tests/webtbs/tw33607.pp
Jonas Maebe c9c1c1686c --- Merging r46880 into '.':
U    rtl/aarch64/mathu.inc
--- Recording mergeinfo for merge of r46880 into '.':
 U   .
--- Merging r40512 into '.':
A    tests/webtbs/tw33607.pp
--- Recording mergeinfo for merge of r40512 into '.':
 G   .
--- Merging r42961 into '.':
U    compiler/aarch64/aasmcpu.pas
--- Recording mergeinfo for merge of r42961 into '.':
 G   .
--- Merging r44932 into '.':
G    compiler/aarch64/aasmcpu.pas
--- Recording mergeinfo for merge of r44932 into '.':
 G   .
--- Merging r44933 into '.':
U    compiler/aarch64/racpugas.pas
--- Recording mergeinfo for merge of r44933 into '.':
 G   .
--- Merging r44998 into '.':
U    compiler/aarch64/racpu.pas
--- Recording mergeinfo for merge of r44998 into '.':
 G   .
--- Merging r45667 into '.':
G    compiler/aarch64/racpugas.pas
U    compiler/rautils.pas
A    tests/webtbs/tw37218.pp
--- Recording mergeinfo for merge of r45667 into '.':
 G   .
--- Merging r45814 into '.':
U    compiler/aarch64/rgcpu.pas
A    tests/webtbs/tw37393.pp
--- Recording mergeinfo for merge of r45814 into '.':
 G   .
--- Merging r46690 into '.':
G    compiler/aarch64/aasmcpu.pas
--- Recording mergeinfo for merge of r46690 into '.':
 G   .
--- Merging r46871 into '.':
U    compiler/aarch64/cgcpu.pas
--- Recording mergeinfo for merge of r46871 into '.':
 G   .

git-svn-id: branches/fixes_3_2@47756 -
2020-12-11 15:40:07 +00:00

52 lines
934 B
ObjectPascal

{$mode objfpc}{$H+}
{$modeSwitch advancedRecords}
type
TRectangle = record
public
Left, Bottom: Integer;
Width, Height: Cardinal;
function ScaleAround0(const Factor: Single): TRectangle;
end;
function TRectangle.ScaleAround0(const Factor: Single): TRectangle;
begin
if Width <= 0 then
begin
Result.Width := Width;
Result.Left := Left;
end else
halt(3);
Result.Height := Height;
Result.Bottom := Bottom;
end;
function Rectangle(const Left, Bottom: Integer;
const Width, Height: Cardinal): TRectangle;
begin
Rectangle.Left := Left;
Rectangle.Bottom := Bottom;
Rectangle.Width := Width;
Rectangle.Height := Height;
end;
procedure test(c: qword);
begin
if c<>0 then
halt(2);
end;
var
R, S : TRectangle;
begin
R := Rectangle(10, 20, 0, 50);
S := R.ScaleAround0(2);
if s.width<>0 then
halt(1);
test(R.ScaleAround0(2).Width);
end.