peter 23 years ago
parent
commit
697b015e3f
3 changed files with 27 additions and 17 deletions
  1. 7 5
      tests/test/cg/tcalext.pp
  2. 9 1
      tests/test/cg/tcalpext.pp
  3. 11 11
      tests/test/tclass4.pp

+ 7 - 5
tests/test/cg/tcalext.pp

@@ -15,14 +15,13 @@
 {          verifies the usage of external cdecl                  }
 {          modules compiled with C compilers.                    }
 {****************************************************************}
-program tcalext;
+
+
+{$ifndef USE_PASCAL_OBJECT}
 {$MODE OBJFPC}
 {$STATIC ON}
 {$R+}
 uses strings;
-
-
-{$ifndef USE_PASCAL_OBJECT}
 {$L ctest.o}
 {$endif USE_PASCAL_OBJECT}
 { Use C alignment of records }
@@ -746,7 +745,10 @@ end.
 
 {
   $Log$
-  Revision 1.6  2002-11-04 15:17:45  pierre
+  Revision 1.7  2002-11-17 21:46:17  peter
+    * fixed
+
+  Revision 1.6  2002/11/04 15:17:45  pierre
    * compatibility with C checks improved
 
   Revision 1.5  2002/09/07 15:40:51  peter

+ 9 - 1
tests/test/cg/tcalpext.pp

@@ -16,9 +16,17 @@
 { functions declared with cdecl modifier are correct             }
 {****************************************************************}
 
-
 {$define USE_PASCAL_OBJECT}
 
+{$MODE OBJFPC}
+{$STATIC ON}
+{$R+}
+{ Compile ptest.o }
+uses
+  strings,
+  ptest
+  ;
+
 
 {$ifdef USE_PASCAL_OBJECT}
   {$ifdef win32}

+ 11 - 11
tests/test/tclass4.pp

@@ -9,38 +9,38 @@ type
     constructor create;
     procedure mymethod; virtual;
   end;
-  
-  
+
+
   tobj2 = class
     constructor create;
     procedure mymethod; virtual;
   end;
-  
-  
+
+
   constructor tobj2.create;
    begin
    end;
-   
+
   procedure tobj2.mymethod;
    begin
    end;
-   
-   
+
+
   constructor tobj1.create;
    begin
    end;
-   
+
   procedure tobj1.mymethod;
    begin
    end;
-  
-  
+
+
 var
  _cla1 : tobj1;
  _cla2 : tobj2;
 Begin
   _cla1:=tobj1.create;
   _cla2:=tobj2.create;
-  tobj1(_cla2).mymethod;
+  tobj1(pointer(_cla2)).mymethod;
 end.