Browse Source

* new tests

peter 24 years ago
parent
commit
d523065fb1
4 changed files with 58 additions and 0 deletions
  1. 12 0
      tests/tbf/tb0107.pp
  2. 10 0
      tests/tbf/tb0108.pp
  3. 22 0
      tests/tbf/tb0109.pp
  4. 14 0
      tests/tbs/tb0377.pp

+ 12 - 0
tests/tbf/tb0107.pp

@@ -0,0 +1,12 @@
+{ %FAIL }
+
+var
+  i : longint;
+  j,j2 : word;
+  k : byte;
+
+begin
+  j:=5;
+  byte(i):=j;
+  longint(j):=12;
+end.

+ 10 - 0
tests/tbf/tb0108.pp

@@ -0,0 +1,10 @@
+{ %FAIL }
+
+{$mode delphi}
+
+var
+  i : int64;
+  e : extended;
+begin
+  e:=int(i);
+end.

+ 22 - 0
tests/tbf/tb0109.pp

@@ -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 - 0
tests/tbs/tb0377.pp

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