mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 23:39:26 +02:00
* new tests
This commit is contained in:
parent
8b3905de23
commit
d523065fb1
12
tests/tbf/tb0107.pp
Normal file
12
tests/tbf/tb0107.pp
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
{ %FAIL }
|
||||||
|
|
||||||
|
var
|
||||||
|
i : longint;
|
||||||
|
j,j2 : word;
|
||||||
|
k : byte;
|
||||||
|
|
||||||
|
begin
|
||||||
|
j:=5;
|
||||||
|
byte(i):=j;
|
||||||
|
longint(j):=12;
|
||||||
|
end.
|
10
tests/tbf/tb0108.pp
Normal file
10
tests/tbf/tb0108.pp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
{ %FAIL }
|
||||||
|
|
||||||
|
{$mode delphi}
|
||||||
|
|
||||||
|
var
|
||||||
|
i : int64;
|
||||||
|
e : extended;
|
||||||
|
begin
|
||||||
|
e:=int(i);
|
||||||
|
end.
|
22
tests/tbf/tb0109.pp
Normal file
22
tests/tbf/tb0109.pp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{ %fail }
|
||||||
|
|
||||||
|
{$mode delphi}
|
||||||
|
|
||||||
|
type
|
||||||
|
tcl1=class
|
||||||
|
end;
|
||||||
|
|
||||||
|
tcl2=class(tcl1)
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure p1(var p:tcl1);
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
t : tcl2;
|
||||||
|
begin
|
||||||
|
t:=tcl2.create;
|
||||||
|
{ in delphi the passed argument must match exact }
|
||||||
|
p1(t);
|
||||||
|
end.
|
14
tests/tbs/tb0377.pp
Normal file
14
tests/tbs/tb0377.pp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{$ifdef fpc}{$mode tp}{$endif}
|
||||||
|
|
||||||
|
var
|
||||||
|
i : longint;
|
||||||
|
j : word;
|
||||||
|
begin
|
||||||
|
j:=5;
|
||||||
|
i:=-1;
|
||||||
|
{ this is allowed in tp7 }
|
||||||
|
byte(i):=j;
|
||||||
|
writeln('i: ',i,' (should be -251)');
|
||||||
|
if i<>-251 then
|
||||||
|
halt(1);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user