Browse Source

*** empty log message ***

carl 23 years ago
parent
commit
e792ab5ab1
3 changed files with 72 additions and 0 deletions
  1. 25 0
      tests/tbf/tb0125.pp
  2. 25 0
      tests/tbf/tb0126.pp
  3. 22 0
      tests/tbs/tb0408.pp

+ 25 - 0
tests/tbf/tb0125.pp

@@ -0,0 +1,25 @@
+{ %fail }
+{ Returns this error under Delphi :
+{  Error: Types of actual and formal var parameters must be identical }
+{$ifdef fpc}
+{$mode objfpc}
+{$endif}
+type
+  tsymbol = class
+  end;
+  
+  tderivedsymbol = class(tsymbol)
+  end;
+  
+  
+
+procedure testclass(var t: tsymbol);
+begin
+end;
+
+var
+ myclass : tderivedsymbol;
+begin
+ myclass  := tderivedsymbol.create;
+ testclass(myclass);
+end.

+ 25 - 0
tests/tbf/tb0126.pp

@@ -0,0 +1,25 @@
+{ %fail }
+{ This program should fail compilation, since
+  the declaration is not the same as the actual
+  implementation, checked against Delphi 3 -
+  the class keyword is missing in front 
+  of procedure tmyclass.myproc
+}
+{$ifdef fpc}
+{$mode objfpc}
+{$endif}
+type
+   tmyclass = class
+    class procedure myproc;virtual;
+   end;
+   
+   { missing class keyword in front of procedure }
+   procedure tmyclass.myproc;
+    begin
+    end;
+    
+
+Begin
+end.
+    
+  

+ 22 - 0
tests/tbs/tb0408.pp

@@ -0,0 +1,22 @@
+{ This passes under Delphi and Borland pascal      }
+{ for objects, classes don't pass, cf. /tbf/tb0125 }
+type
+  
+  tobjsymbol = object
+  end;
+  
+  tobjderivedsymbol = object(tobjsymbol)
+  end;
+  
+
+
+procedure testobject(var t: tobjsymbol);
+begin
+end;
+
+
+var
+ myobject : tobjderivedsymbol;
+begin
+ testobject(myobject);
+end.