mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-16 10:09:34 +02:00
+ tests for mantis #21505 (bug already fixed in r21975/21983)
git-svn-id: trunk@23076 -
This commit is contained in:
parent
6d8ac30a19
commit
d37c790ee6
2
.gitattributes
vendored
2
.gitattributes
vendored
@ -12905,6 +12905,8 @@ tests/webtbs/tw21443.pp svneol=native#text/plain
|
||||
tests/webtbs/tw2145.pp svneol=native#text/plain
|
||||
tests/webtbs/tw21457.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw21472.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw21505.pp svneol=native#text/plain
|
||||
tests/webtbs/tw21505a.pp svneol=native#text/plain
|
||||
tests/webtbs/tw21538.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw21550.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw21551.pp svneol=native#text/plain
|
||||
|
12
tests/webtbs/tw21505.pp
Normal file
12
tests/webtbs/tw21505.pp
Normal file
@ -0,0 +1,12 @@
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
operator >< (A, B: Integer): Integer;
|
||||
begin
|
||||
Result := A - B;
|
||||
end;
|
||||
|
||||
begin
|
||||
Writeln(2 >< 3);
|
||||
if (2 >< 3) <> -1 then
|
||||
halt(1);
|
||||
end.
|
36
tests/webtbs/tw21505a.pp
Normal file
36
tests/webtbs/tw21505a.pp
Normal file
@ -0,0 +1,36 @@
|
||||
{$mode objfpc}{$H+}
|
||||
|
||||
type
|
||||
PPosList = ^TPosList;
|
||||
TPosList = record
|
||||
elem : Double;
|
||||
tail : ^TPosList;
|
||||
end;
|
||||
|
||||
operator >< (e : single; list : PPosList) : PPosList;
|
||||
begin
|
||||
new (result);
|
||||
result^.elem := e;
|
||||
result^.tail := list;
|
||||
end;
|
||||
|
||||
var
|
||||
list : PPosList;
|
||||
begin
|
||||
// This makes Fatal: Internal error 2008022101
|
||||
// list := 1.0 >< 3.0 >< 5.0 >< 7.0 >< 9.0 >< nil;
|
||||
// This says Error: Operation "><" not supported for types "ShortInt" and "Pointer"
|
||||
list := 1.0 >< (3.0 >< (5.0 >< (7.0 >< (9.0 >< nil))));
|
||||
if list^.elem<>1.0 then
|
||||
halt(1);
|
||||
if list^.tail^.elem<>3.0 then
|
||||
halt(2);
|
||||
if list^.tail^.tail^.elem<>5.0 then
|
||||
halt(3);
|
||||
if list^.tail^.tail^.tail^.elem<>7.0 then
|
||||
halt(4);
|
||||
if list^.tail^.tail^.tail^.tail^.elem<>9.0 then
|
||||
halt(5);
|
||||
if list^.tail^.tail^.tail^.tail^.tail<>nil then
|
||||
halt(6);
|
||||
end.
|
Loading…
Reference in New Issue
Block a user