+ tests for mantis #21505 (bug already fixed in r21975/21983)

git-svn-id: trunk@23076 -
This commit is contained in:
Jonas Maebe 2012-11-28 21:25:28 +00:00
parent 6d8ac30a19
commit d37c790ee6
3 changed files with 50 additions and 0 deletions

2
.gitattributes vendored
View File

@ -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
View 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
View 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.