Browse Source

* new bugs

peter 24 years ago
parent
commit
f58a8fc277
3 changed files with 56 additions and 0 deletions
  1. 2 0
      tests/tbs/tb0367.pp
  2. 17 0
      tests/tbs/tb0368.pp
  3. 37 0
      tests/tbs/tb0369.pp

+ 2 - 0
tests/tbs/tb0367.pp

@@ -1,4 +1,6 @@
 { %CPU=i386 }
+{ %VERSION=1.1 }
+
 {$ifdef fpc}
   {$mode delphi}
   {$asmmode intel}

+ 17 - 0
tests/tbs/tb0368.pp

@@ -0,0 +1,17 @@
+type
+  tproc = procedure of object;
+  trec = record
+    l1,l2 : longint;
+  end;
+var
+  pfn : tproc;
+
+begin
+  pfn:=nil;
+  if (trec(pfn).l1<>0) or
+     (trec(pfn).l2<>0) then
+   begin
+     writeln('Error!');
+     halt(1);
+   end;
+end.

+ 37 - 0
tests/tbs/tb0369.pp

@@ -0,0 +1,37 @@
+
+type
+  ptchar=^tchar;
+  tchar=record
+    c : char;
+  end;
+
+function inl(l:ptchar):ptchar;
+begin
+  inc(l);
+  inl:=l;
+end;
+
+var
+  i : longint;
+  j : ptchar;
+  s : string;
+  error : boolean;
+begin
+  error:=false;
+  s:='012345789';
+  j:=@s[1];
+  for i:=1to 8 do
+   begin
+     writeln(inl(j)^.c);
+     If (inl(j)^.c<>s[i+1]) Then
+      error:=true;
+     inc(j);
+   end;
+  if error then
+   begin
+     writeln('Error!');
+     halt(1);
+   end;
+end.
+
+