Browse Source

+ finished procedural variable testsuit
+ finished method testsuit

carl 23 years ago
parent
commit
fcbb1eea4e

+ 2128 - 0
tests/test/cg/tcalobj1.pp

@@ -0,0 +1,2128 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{  Copyright (c) 2002 Carl Eric Codere                           }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondtypeconv()                               }
+{                 secondtryexcept()                              }
+{****************************************************************}
+{ DEFINES:                                                       }
+{            FPC     = Target is FreePascal compiler             }
+{****************************************************************}
+{ REMARKS: This tests secondcalln(), genentrycode() and          }
+{ genexitcode().                                                 }
+{                                                                }
+{                                                                }
+{****************************************************************}
+program tcalobj1;
+{$STATIC ON}
+{$R+}
+
+ const
+ { should be defined depending on CPU target }
+ {$ifdef cpu68k}
+   BIG_INDEX = 8000;
+   SMALL_INDEX  = 13;
+ {$endif}
+ {$ifdef cpu86}
+   BIG_INDEX = 33000;
+   SMALL_INDEX = 13;     { value should not be aligned! }
+ {$endif}
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = 2*RESULT_U8BIT;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = $500F0000;
+   RESULT_S32REAL = 1777.12;
+   RESULT_S64REAL = 3444.24;
+   RESULT_BOOL8BIT = 1;
+   RESULT_BOOL16BIT = 1;
+   RESULT_BOOL32BIT = 1;
+   RESULT_PCHAR = 'Hello world';
+   RESULT_BIGSTRING = 'Hello world';
+   RESULT_SMALLSTRING = 'H';
+   RESULT_CHAR = 'I';
+   RESULT_BOOLEAN = TRUE;
+   
+ type
+   
+   tprocedure = procedure;
+   
+   tsmallrecord = packed record
+     b: byte;
+     w: word;
+   end;
+   
+   tlargerecord = packed record
+     b: array[1..BIG_INDEX] of byte;
+   end;
+   
+   tsmallarray = packed array[1..SMALL_INDEX] of byte;
+   
+   tsmallsetenum = 
+   (A_A,A_B,A_C,A_D);
+   
+   tsmallset = set of tsmallsetenum;
+   tlargeset = set of char;
+   
+   tsmallstring = string[2];
+
+
+ var
+  global_u8bit : byte;
+  global_u16bit : word;
+  global_s32bit : longint;
+  global_s32real : single;
+  global_s64real : double;
+  global_ptr : pchar;
+  global_proc : tprocedure;
+  global_bigstring : shortstring;
+  global_boolean : boolean;
+  global_char : char;
+  global_s64bit : int64;
+  value_s64bit : int64;
+  value_ansistring : ansistring;
+  value_u8bit : byte;
+  value_u16bit : word;
+  value_s32bit : longint;
+  value_s32real : single;
+  value_s64real  : double;
+  value_proc : tprocedure;
+  value_ptr : pchar;
+  value_smallrec : tsmallrecord;
+  value_largerec : tlargerecord;
+  value_smallset : tsmallset;
+  value_smallstring : tsmallstring;
+  value_bigstring   : shortstring;
+  value_largeset : tlargeset;
+  value_smallarray : tsmallarray;
+  value_boolean : boolean;
+  value_char : char;
+  
+     procedure fail;
+     begin
+       WriteLn('Failure.');
+       halt(1);
+     end;
+     
+     
+     procedure clear_globals;
+      begin
+       global_u8bit := 0;
+       global_u16bit := 0;
+       global_s32bit := 0;
+       global_s32real := 0.0;
+       global_s64real := 0.0;
+       global_ptr := nil;
+       global_proc := nil;
+       global_bigstring := '';
+       global_boolean := false;
+       global_char := #0;
+       global_s64bit := 0;
+      end;
+      
+      
+     procedure clear_values;
+      begin
+       value_u8bit := 0;
+       value_u16bit := 0;
+       value_s32bit := 0;
+       value_s32real := 0.0;
+       value_s64real  := 0.0;
+       value_proc := nil;
+       value_ptr := nil;
+       fillchar(value_smallrec, sizeof(value_smallrec), #0);
+       fillchar(value_largerec, sizeof(value_largerec), #0);
+       value_smallset := [];
+       value_smallstring := '';
+       value_bigstring   := '';
+       value_largeset := [];
+       fillchar(value_smallarray, sizeof(value_smallarray), #0);
+       value_boolean := false;
+       value_char:=#0;
+       value_ansistring := '';
+       value_s64bit := 0;
+      end;
+      
+      
+      function getu8: byte;
+       begin
+         getu8 := RESULT_U8BIT;
+       end;
+
+
+type
+
+ { object without vmt }
+ pnovmtobject = ^tnovmtobject;
+ tnovmtobject = object
+ public
+   object_bigstring : shortstring;
+   object_u16bit : word;
+   { no parameter testing }
+   procedure method_public_none;
+   procedure method_public_static_none; static;
+   procedure method_call_private_none;
+   procedure method_call_private_static_none; static;
+   { simple value parameter testing }
+   procedure method_public_u8(x : byte);
+   procedure method_public_static_u8(x: byte); static;
+   procedure method_call_private_u8(x: byte);
+   procedure method_call_private_static_u8(x: byte); static;
+   function  func_array_mixed_nested(b: byte): tsmallarray;
+ private
+   procedure method_private_none;
+   procedure method_private_static_none; static;
+   function func_getu16bit : word;
+   { simple value parameter testing }
+   procedure method_private_u8(x: byte);
+   procedure method_private_static_u8(x: byte); static;
+ end;
+ 
+ 
+ { object with vmt }
+ pvmtobject = ^tvmtobject;
+ tvmtobject = object
+ public
+   object_u8bit : byte;
+   object_u16bit : word;
+   object_bigstring : shortstring;
+   object_s32bit : longint;
+   object_s64bit : int64;
+   constructor constructor_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);
+   constructor constructor_init;   
+   destructor destructor_params_done;
+   procedure method_normal_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);
+   procedure method_virtual_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);virtual;
+   procedure method_virtual_overriden_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);virtual;
+   procedure method_static_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);static;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+      
+   { virtual methods which call other methods }
+   procedure method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
+   procedure method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
+   procedure method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
+   procedure method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
+   procedure method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
+      
+ end;
+ 
+ pheritedvmtobject = ^theritedvmtobject;
+ theritedvmtobject = object(tvmtobject)
+   constructor constructor_params_mixed_call_virtual(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);
+   constructor constructor_params_mixed_call_overriden(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);
+   constructor constructor_params_mixed_call_static(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);
+   constructor constructor_params_mixed_call_normal(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);
+   constructor constructor_params_mixed_call_inherited(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);
+   procedure method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
+    
+   { normal methods which call other methods }
+   procedure method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   procedure method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   procedure method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   procedure method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   procedure method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+
+   { virtual methods which call other methods }
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;
+   
+ end;
+ 
+ pfailvmtobject = ^tfailvmtobject;
+ tfailvmtobject = object(tvmtobject)
+ public
+    constructor constructor_public_none;
+ end;
+ 
+ 
+ 
+{**************************************************************************}
+{                             NO VMT OBJECT                                }
+{**************************************************************************}
+ 
+  {****************** NO PARAMETERS ******************}
+ procedure tnovmtobject.method_public_none;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+  
+  
+ procedure tnovmtobject.method_public_static_none;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+
+
+ procedure tnovmtobject.method_call_private_none;
+   begin
+       method_private_none;
+       method_private_static_none;
+   end;
+   
+ procedure tnovmtobject.method_call_private_static_none; 
+   begin
+     method_private_static_none;
+   end;
+   
+   
+ procedure tnovmtobject.method_private_none;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+  
+  
+ procedure tnovmtobject.method_private_static_none;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+
+  {******************** PARAMETERS ******************}
+  
+  procedure tnovmtobject.method_public_u8(x : byte);
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_public_static_u8(x: byte); 
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_call_private_u8(x: byte);
+   begin
+     method_private_static_u8(x);
+     method_private_u8(x);
+   end;
+   
+  procedure tnovmtobject. method_call_private_static_u8(x: byte); 
+   begin
+     method_private_static_u8(x);
+   end;
+
+   procedure tnovmtobject.method_private_u8(x: byte);
+    begin
+      Inc(global_u16bit,x);
+    end;
+    
+   procedure tnovmtobject.method_private_static_u8(x: byte); 
+    begin
+      Inc(global_u16bit,x);
+    end;
+
+
+  function tnovmtobject.func_getu16bit : word;
+   begin
+     func_getu16bit := object_u16bit;
+   end;
+
+  { 
+    complex testing, nested field access, with parameters and 
+    comple return value.
+    
+    On exit : global_u8bit := x;
+              global_u16bit := object_u16bit (from func_getu16bit);
+              global_s32bit :=  RESULT_S32BIT
+              global_bigstring := object_bigstring
+              global_s64bit := x;
+  }
+  function tnovmtobject.func_array_mixed_nested(b: byte): tsmallarray;
+
+    procedure nested_one_proc(l: longint);
+     begin
+       global_u16bit := func_getu16bit;
+       global_s32bit := l;
+     end;
+     
+    procedure nested_two_proc(l : longint);
+     begin
+       global_s64bit := l;  
+     end;
+
+     
+
+   function nested_one_func(level1_b : byte; s: shortstring): byte;
+     var
+      s1 : shortstring;
+   
+      function nested_two_func(level2_b : byte; s :shortstring): byte;
+        begin
+          nested_two_func:=level2_b;
+          global_bigstring := s;
+          nested_one_proc(RESULT_S32BIT);
+        end;
+       
+    begin
+      s1:=s;
+      nested_one_func := nested_two_func(level1_b,s1);
+      nested_two_proc(level1_b);
+    end;
+    
+    
+ var
+  local_b: byte;
+  smallarray: tsmallarray;
+ begin
+  fillchar(smallarray, sizeof(smallarray), #0);
+  smallarray[1] := RESULT_U8BIT; 
+  smallarray[SMALL_INDEX] := RESULT_U8BIT;
+  func_array_mixed_nested := smallarray;
+  local_b:=b;
+  global_u8bit := nested_one_func(local_b, object_bigstring);
+ end;
+ 
+{**************************************************************************}
+{                             FAILED OBJECT                                }
+{**************************************************************************}
+constructor tfailvmtobject.constructor_public_none;
+ begin
+    { this calls the constructor fail special keyword }
+    fail;
+ end;
+ 
+{**************************************************************************}
+{                               VMT  OBJECT                                }
+{**************************************************************************}
+constructor tvmtobject.constructor_params_mixed(u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+ 
+constructor tvmtobject.constructor_init;   
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+destructor tvmtobject.destructor_params_done;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+ 
+procedure tvmtobject.method_normal_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+procedure tvmtobject.method_virtual_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+{ this one should be overriden } 
+procedure tvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+ begin
+    RunError(211);
+ end;
+ 
+{ can't access field of instances in static methods } 
+procedure tvmtobject.method_static_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+ begin
+   global_u8bit := u8;
+   global_u16bit := u16;
+   global_bigstring := bigstring;
+   global_s32bit := s32;
+   global_s64bit := s64;
+ end;
+
+procedure tvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+procedure tvmtobject.method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure tvmtobject.method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure tvmtobject.method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure tvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+{**************************************************************************}
+{                          INHERITED VMT OBJECT                            }
+{**************************************************************************}
+constructor theritedvmtobject.constructor_params_mixed_call_virtual(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+
+constructor theritedvmtobject.constructor_params_mixed_call_overriden(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+     
+constructor theritedvmtobject.constructor_params_mixed_call_static(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_static_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_normal(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_inherited
+   (u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   inherited constructor_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+    
+{ this one should be overriden } 
+procedure theritedvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+
+procedure theritedvmtobject.method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure theritedvmtobject.method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure theritedvmtobject.method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure theritedvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+  begin
+   Inherited method_normal_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+procedure theritedvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);
+  begin
+   Inherited method_virtual_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+
+procedure testnovmtobject;
+var
+  novmtobject : tnovmtobject;
+  failed : boolean;
+begin
+  {******************** STATIC / METHOD SIMPLE CALL **********************}
+  Write('No parameter / method call testing...');
+  failed := false;
+ 
+  clear_globals;
+  clear_values;
+ 
+  tnovmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  novmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  tnovmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+ 
+  novmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_call_private_none;
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+  
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+  Write('Simple parameter (LOC_CONSTANT) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  { parameter is LOC_CONSTANT }
+  novmtobject.method_public_u8(RESULT_U8BIT);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+ 
+  Write('Simple parameter (LOC_REFERENCE) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_u8(value_u8bit);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  value_u8bit := RESULT_U8BIT;
+  tnovmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+   
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_call_private_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+ 
+  value_u8bit := RESULT_U8BIT;   
+  novmtobject.method_call_private_static_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+ 
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+ 
+  Write('Simple parameter (LOC_REGISTER) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_u8(getu8);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(getu8);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(getu8);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+ if failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+  Write('Simple parameter / complex return / nested method access testing...');
+  
+  clear_globals; 
+  clear_values;
+  failed := false;
+  novmtobject.object_bigstring := RESULT_BIGSTRING;
+  novmtobject.object_u16bit := RESULT_U16BIT;
+    
+  value_smallarray := novmtobject.func_array_mixed_nested(RESULT_U8BIT);
+  if (value_smallarray[1] <> RESULT_U8BIT) or (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) then
+    failed := true;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  if global_bigstring <> RESULT_BIGSTRING then
+    failed := true;
+  if global_u16bit <> RESULT_U16BIT then
+    failed := true;
+  if global_s32bit <> RESULT_S32BIT then
+    failed := true;
+  if global_s64bit <> RESULT_U8BIT then
+    failed := true;
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+end;
+
+
+procedure testfailedobject;
+var
+  failedobject : tfailvmtobject;
+ begin
+  Write('Testing constructor return value...'); 
+  if failedobject.constructor_public_none then
+    fail
+  else
+    Writeln('Passed!');
+ end;
+ 
+ 
+ procedure testvmtobject;
+  var
+   vmtobject : tvmtobject;
+   failed : boolean;
+  begin
+  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call...');
+    vmtobject.constructor_params_mixed(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed(value_u8bit, value_u16bit, value_bigstring, 
+       value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+  end;
+  
+  
+ procedure testheritedvmtobject;
+  var
+   vmtobject : theritedvmtobject;
+   failed : boolean;
+  begin
+    {********************** CONSTRUCTOR TESTING ************************}  
+    {********************** DESTRUCTOR  TESTING ************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
+    vmtobject.constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, 
+       RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_inherited(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_virtual(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_virtual(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_overriden(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_overriden(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
+    vmtobject.constructor_params_mixed_call_normal(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_normal(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
+    vmtobject.constructor_params_mixed_call_static(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_static(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    {************************* METHOD TESTING **************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call...');
+    vmtobject.method_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
+    vmtobject.method_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { ********************************************************************
+      This calls methods which in turn call other methods, or a constructor 
+      or a destructor.
+      *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
+    vmtobject.method_normal_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
+    vmtobject.method_normal_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static method call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
+    vmtobject.method_normal_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
+    vmtobject.method_normal_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+ { ********************************************************************
+      This calls virtual methods which in turn call other methods, 
+      or a constructor  or a destructor.
+   *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
+    vmtobject.method_virtual_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
+    vmtobject.method_virtual_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static virtual call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
+    vmtobject.method_virtual_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
+    vmtobject.method_virtual_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+
+  end;
+  
+
+begin
+  WriteLN('*********************** NO VMT OBJECT TESTS ********************');
+  testnovmtobject;   
+  WriteLN('************************ VMT OBJECT FAIL  **********************');
+  testfailedobject;
+  WriteLN('************************* VMT OBJECT TESTS *********************');
+  testvmtobject;
+  testheritedvmtobject;
+end.
+
+{
+  $Log$
+  Revision 1.1  2002-05-05 13:58:50  carl
+  + finished procedural variable testsuit
+  + finished method testsuit
+
+}

+ 2129 - 0
tests/test/cg/tcalobj2.pp

@@ -0,0 +1,2129 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{  Copyright (c) 2002 Carl Eric Codere                           }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondtypeconv()                               }
+{                 secondtryexcept()                              }
+{****************************************************************}
+{ DEFINES:                                                       }
+{            FPC     = Target is FreePascal compiler             }
+{****************************************************************}
+{ REMARKS: This tests secondcalln(), genentrycode() and          }
+{ genexitcode() for standard object with the pascal              }
+{ calling convention.                                            }
+{                                                                }
+{****************************************************************}
+program tcalobj2;
+{$STATIC ON}
+{$R+}
+
+ const
+ { should be defined depending on CPU target }
+ {$ifdef cpu68k}
+   BIG_INDEX = 8000;
+   SMALL_INDEX  = 13;
+ {$endif}
+ {$ifdef cpu86}
+   BIG_INDEX = 33000;
+   SMALL_INDEX = 13;     { value should not be aligned! }
+ {$endif}
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = 2*RESULT_U8BIT;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = $500F0000;
+   RESULT_S32REAL = 1777.12;
+   RESULT_S64REAL = 3444.24;
+   RESULT_BOOL8BIT = 1;
+   RESULT_BOOL16BIT = 1;
+   RESULT_BOOL32BIT = 1;
+   RESULT_PCHAR = 'Hello world';
+   RESULT_BIGSTRING = 'Hello world';
+   RESULT_SMALLSTRING = 'H';
+   RESULT_CHAR = 'I';
+   RESULT_BOOLEAN = TRUE;
+   
+ type
+   
+   tprocedure = procedure;
+   
+   tsmallrecord = packed record
+     b: byte;
+     w: word;
+   end;
+   
+   tlargerecord = packed record
+     b: array[1..BIG_INDEX] of byte;
+   end;
+   
+   tsmallarray = packed array[1..SMALL_INDEX] of byte;
+   
+   tsmallsetenum = 
+   (A_A,A_B,A_C,A_D);
+   
+   tsmallset = set of tsmallsetenum;
+   tlargeset = set of char;
+   
+   tsmallstring = string[2];
+
+
+ var
+  global_u8bit : byte;
+  global_u16bit : word;
+  global_s32bit : longint;
+  global_s32real : single;
+  global_s64real : double;
+  global_ptr : pchar;
+  global_proc : tprocedure;
+  global_bigstring : shortstring;
+  global_boolean : boolean;
+  global_char : char;
+  global_s64bit : int64;
+  value_s64bit : int64;
+  value_ansistring : ansistring;
+  value_u8bit : byte;
+  value_u16bit : word;
+  value_s32bit : longint;
+  value_s32real : single;
+  value_s64real  : double;
+  value_proc : tprocedure;
+  value_ptr : pchar;
+  value_smallrec : tsmallrecord;
+  value_largerec : tlargerecord;
+  value_smallset : tsmallset;
+  value_smallstring : tsmallstring;
+  value_bigstring   : shortstring;
+  value_largeset : tlargeset;
+  value_smallarray : tsmallarray;
+  value_boolean : boolean;
+  value_char : char;
+  
+     procedure fail;
+     begin
+       WriteLn('Failure.');
+       halt(1);
+     end;
+     
+     
+     procedure clear_globals;
+      begin
+       global_u8bit := 0;
+       global_u16bit := 0;
+       global_s32bit := 0;
+       global_s32real := 0.0;
+       global_s64real := 0.0;
+       global_ptr := nil;
+       global_proc := nil;
+       global_bigstring := '';
+       global_boolean := false;
+       global_char := #0;
+       global_s64bit := 0;
+      end;
+      
+      
+     procedure clear_values;
+      begin
+       value_u8bit := 0;
+       value_u16bit := 0;
+       value_s32bit := 0;
+       value_s32real := 0.0;
+       value_s64real  := 0.0;
+       value_proc := nil;
+       value_ptr := nil;
+       fillchar(value_smallrec, sizeof(value_smallrec), #0);
+       fillchar(value_largerec, sizeof(value_largerec), #0);
+       value_smallset := [];
+       value_smallstring := '';
+       value_bigstring   := '';
+       value_largeset := [];
+       fillchar(value_smallarray, sizeof(value_smallarray), #0);
+       value_boolean := false;
+       value_char:=#0;
+       value_ansistring := '';
+       value_s64bit := 0;
+      end;
+      
+      
+      function getu8: byte;
+       begin
+         getu8 := RESULT_U8BIT;
+       end;
+
+
+type
+
+ { object without vmt }
+ pnovmtobject = ^tnovmtobject;
+ tnovmtobject = object
+ public
+   object_bigstring : shortstring;
+   object_u16bit : word;
+   { no parameter testing }
+   procedure method_public_none;pascal;
+   procedure method_public_static_none; static;pascal;
+   procedure method_call_private_none;pascal;
+   procedure method_call_private_static_none; static;pascal;
+   { simple value parameter testing }
+   procedure method_public_u8(x : byte);pascal;
+   procedure method_public_static_u8(x: byte); static;pascal;
+   procedure method_call_private_u8(x: byte);pascal;
+   procedure method_call_private_static_u8(x: byte); static;pascal;
+   function  func_array_mixed_nested(b: byte): tsmallarray;pascal;
+ private
+   procedure method_private_none;pascal;
+   procedure method_private_static_none; static;pascal;
+   function func_getu16bit : word;pascal;
+   { simple value parameter testing }
+   procedure method_private_u8(x: byte);pascal;
+   procedure method_private_static_u8(x: byte); static;pascal;
+ end;
+ 
+ 
+ { object with vmt }
+ pvmtobject = ^tvmtobject;
+ tvmtobject = object
+ public
+   object_u8bit : byte;
+   object_u16bit : word;
+   object_bigstring : shortstring;
+   object_s32bit : longint;
+   object_s64bit : int64;
+   constructor constructor_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);pascal;
+   constructor constructor_init;pascal;
+   destructor destructor_params_done;pascal;
+   procedure method_normal_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);pascal;
+   procedure method_virtual_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);virtual;pascal;
+   procedure method_virtual_overriden_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);virtual;pascal;
+   procedure method_static_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);static;pascal;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+      
+   { virtual methods which call other methods }
+   procedure method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;pascal;
+   procedure method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;pascal;
+   procedure method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;pascal;
+   procedure method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;pascal;
+   procedure method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;pascal;
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;pascal;
+      
+ end;
+ 
+ pheritedvmtobject = ^theritedvmtobject;
+ theritedvmtobject = object(tvmtobject)
+   constructor constructor_params_mixed_call_virtual(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);pascal;
+   constructor constructor_params_mixed_call_overriden(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);pascal;
+   constructor constructor_params_mixed_call_static(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);pascal;
+   constructor constructor_params_mixed_call_normal(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);pascal;
+   constructor constructor_params_mixed_call_inherited(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);pascal;
+   procedure method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;pascal;
+    
+   { normal methods which call other methods }
+   procedure method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   procedure method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   procedure method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   procedure method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   procedure method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+
+   { virtual methods which call other methods }
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;pascal;
+   
+ end;
+ 
+ pfailvmtobject = ^tfailvmtobject;
+ tfailvmtobject = object(tvmtobject)
+ public
+    constructor constructor_public_none;pascal;
+ end;
+ 
+ 
+ 
+{**************************************************************************}
+{                             NO VMT OBJECT                                }
+{**************************************************************************}
+ 
+  {****************** NO PARAMETERS ******************}
+ procedure tnovmtobject.method_public_none;pascal;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+  
+  
+ procedure tnovmtobject.method_public_static_none;pascal;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+
+
+ procedure tnovmtobject.method_call_private_none;pascal;
+   begin
+       method_private_none;
+       method_private_static_none;
+   end;
+   
+ procedure tnovmtobject.method_call_private_static_none;pascal;
+   begin
+     method_private_static_none;
+   end;
+   
+   
+ procedure tnovmtobject.method_private_none;pascal;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+  
+  
+ procedure tnovmtobject.method_private_static_none;pascal;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+
+  {******************** PARAMETERS ******************}
+  
+  procedure tnovmtobject.method_public_u8(x : byte);pascal;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_public_static_u8(x: byte);pascal;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_call_private_u8(x: byte);pascal;
+   begin
+     method_private_static_u8(x);
+     method_private_u8(x);
+   end;
+   
+  procedure tnovmtobject. method_call_private_static_u8(x: byte);pascal;
+   begin
+     method_private_static_u8(x);
+   end;
+
+   procedure tnovmtobject.method_private_u8(x: byte);pascal;
+    begin
+      Inc(global_u16bit,x);
+    end;
+    
+   procedure tnovmtobject.method_private_static_u8(x: byte);pascal;
+    begin
+      Inc(global_u16bit,x);
+    end;
+
+
+  function tnovmtobject.func_getu16bit : word;pascal;
+   begin
+     func_getu16bit := object_u16bit;
+   end;
+
+  { 
+    complex testing, nested field access, with parameters and 
+    comple return value.
+    
+    On exit : global_u8bit := x;
+              global_u16bit := object_u16bit (from func_getu16bit);
+              global_s32bit :=  RESULT_S32BIT
+              global_bigstring := object_bigstring
+              global_s64bit := x;
+  }
+  function tnovmtobject.func_array_mixed_nested(b: byte): tsmallarray;pascal;
+
+    procedure nested_one_proc(l: longint);
+     begin
+       global_u16bit := func_getu16bit;
+       global_s32bit := l;
+     end;
+     
+    procedure nested_two_proc(l : longint);
+     begin
+       global_s64bit := l;  
+     end;
+
+     
+
+   function nested_one_func(level1_b : byte; s: shortstring): byte;
+     var
+      s1 : shortstring;
+   
+      function nested_two_func(level2_b : byte; s :shortstring): byte;
+        begin
+          nested_two_func:=level2_b;
+          global_bigstring := s;
+          nested_one_proc(RESULT_S32BIT);
+        end;
+       
+    begin
+      s1:=s;
+      nested_one_func := nested_two_func(level1_b,s1);
+      nested_two_proc(level1_b);
+    end;
+    
+    
+ var
+  local_b: byte;
+  smallarray: tsmallarray;
+ begin
+  fillchar(smallarray, sizeof(smallarray), #0);
+  smallarray[1] := RESULT_U8BIT; 
+  smallarray[SMALL_INDEX] := RESULT_U8BIT;
+  func_array_mixed_nested := smallarray;
+  local_b:=b;
+  global_u8bit := nested_one_func(local_b, object_bigstring);
+ end;
+ 
+{**************************************************************************}
+{                             FAILED OBJECT                                }
+{**************************************************************************}
+constructor tfailvmtobject.constructor_public_none;pascal;
+ begin
+    { this calls the constructor fail special keyword }
+    fail;
+ end;
+ 
+{**************************************************************************}
+{                               VMT  OBJECT                                }
+{**************************************************************************}
+constructor tvmtobject.constructor_params_mixed(u8 :byte; u16: word; 
+   bigstring: shortstring; s32: longint; s64: int64);pascal;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+ 
+constructor tvmtobject.constructor_init;pascal;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+destructor tvmtobject.destructor_params_done;pascal;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+ 
+procedure tvmtobject.method_normal_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+procedure tvmtobject.method_virtual_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+{ this one should be overriden } 
+procedure tvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+ begin
+    RunError(211);
+ end;
+ 
+{ can't access field of instances in static methods } 
+procedure tvmtobject.method_static_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+ begin
+   global_u8bit := u8;
+   global_u16bit := u16;
+   global_bigstring := bigstring;
+   global_s32bit := s32;
+   global_s64bit := s64;
+ end;
+
+procedure tvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+procedure tvmtobject.method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure tvmtobject.method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure tvmtobject.method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure tvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+{**************************************************************************}
+{                          INHERITED VMT OBJECT                            }
+{**************************************************************************}
+constructor theritedvmtobject.constructor_params_mixed_call_virtual(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+
+constructor theritedvmtobject.constructor_params_mixed_call_overriden(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+     
+constructor theritedvmtobject.constructor_params_mixed_call_static(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_static_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_normal(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_inherited
+   (u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   inherited constructor_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+    
+{ this one should be overriden } 
+procedure theritedvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+
+procedure theritedvmtobject.method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure theritedvmtobject.method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure theritedvmtobject.method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure theritedvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+  begin
+   Inherited method_normal_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+procedure theritedvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);pascal;
+  begin
+   Inherited method_virtual_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+
+procedure testnovmtobject;
+var
+  novmtobject : tnovmtobject;
+  failed : boolean;
+begin
+  {******************** STATIC / METHOD SIMPLE CALL **********************}
+  Write('No parameter / method call testing...');
+  failed := false;
+ 
+  clear_globals;
+  clear_values;
+ 
+  tnovmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  novmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  tnovmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+ 
+  novmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_call_private_none;
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+  
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+  Write('Simple parameter (LOC_CONSTANT) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  { parameter is LOC_CONSTANT }
+  novmtobject.method_public_u8(RESULT_U8BIT);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+ 
+  Write('Simple parameter (LOC_REFERENCE) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_u8(value_u8bit);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  value_u8bit := RESULT_U8BIT;
+  tnovmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+   
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_call_private_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+ 
+  value_u8bit := RESULT_U8BIT;   
+  novmtobject.method_call_private_static_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+ 
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+ 
+  Write('Simple parameter (LOC_REGISTER) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_u8(getu8);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(getu8);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(getu8);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+ if failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+  Write('Simple parameter / complex return / nested method access testing...');
+  
+  clear_globals; 
+  clear_values;
+  failed := false;
+  novmtobject.object_bigstring := RESULT_BIGSTRING;
+  novmtobject.object_u16bit := RESULT_U16BIT;
+    
+  value_smallarray := novmtobject.func_array_mixed_nested(RESULT_U8BIT);
+  if (value_smallarray[1] <> RESULT_U8BIT) or (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) then
+    failed := true;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  if global_bigstring <> RESULT_BIGSTRING then
+    failed := true;
+  if global_u16bit <> RESULT_U16BIT then
+    failed := true;
+  if global_s32bit <> RESULT_S32BIT then
+    failed := true;
+  if global_s64bit <> RESULT_U8BIT then
+    failed := true;
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+end;
+
+
+procedure testfailedobject;
+var
+  failedobject : tfailvmtobject;
+ begin
+  Write('Testing constructor return value...'); 
+  if failedobject.constructor_public_none then
+    fail
+  else
+    Writeln('Passed!');
+ end;
+ 
+ 
+ procedure testvmtobject;
+  var
+   vmtobject : tvmtobject;
+   failed : boolean;
+  begin
+  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call...');
+    vmtobject.constructor_params_mixed(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed(value_u8bit, value_u16bit, value_bigstring, 
+       value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+  end;
+  
+  
+ procedure testheritedvmtobject;
+  var
+   vmtobject : theritedvmtobject;
+   failed : boolean;
+  begin
+    {********************** CONSTRUCTOR TESTING ************************}  
+    {********************** DESTRUCTOR  TESTING ************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
+    vmtobject.constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, 
+       RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_inherited(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_virtual(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_virtual(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_overriden(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_overriden(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
+    vmtobject.constructor_params_mixed_call_normal(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_normal(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
+    vmtobject.constructor_params_mixed_call_static(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_static(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    {************************* METHOD TESTING **************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call...');
+    vmtobject.method_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
+    vmtobject.method_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { ********************************************************************
+      This calls methods which in turn call other methods, or a constructor 
+      or a destructor.
+      *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
+    vmtobject.method_normal_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
+    vmtobject.method_normal_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static method call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
+    vmtobject.method_normal_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
+    vmtobject.method_normal_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+ { ********************************************************************
+      This calls virtual methods which in turn call other methods, 
+      or a constructor  or a destructor.
+   *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
+    vmtobject.method_virtual_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
+    vmtobject.method_virtual_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static virtual call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
+    vmtobject.method_virtual_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
+    vmtobject.method_virtual_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+
+  end;
+  
+
+begin
+  WriteLN('*********************** NO VMT OBJECT TESTS ********************');
+  testnovmtobject;   
+  WriteLN('************************ VMT OBJECT FAIL  **********************');
+  testfailedobject;
+  WriteLN('************************* VMT OBJECT TESTS *********************');
+  testvmtobject;
+  testheritedvmtobject;
+end.
+
+{
+  $Log$
+  Revision 1.1  2002-05-05 13:58:50  carl
+  + finished procedural variable testsuit
+  + finished method testsuit
+
+}

+ 2129 - 0
tests/test/cg/tcalobj3.pp

@@ -0,0 +1,2129 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{  Copyright (c) 2002 Carl Eric Codere                           }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondtypeconv()                               }
+{                 secondtryexcept()                              }
+{****************************************************************}
+{ DEFINES:                                                       }
+{            FPC     = Target is FreePascal compiler             }
+{****************************************************************}
+{ REMARKS: This tests secondcalln(), genentrycode() and          }
+{ genexitcode() for standard object with the cdecl               }
+{ calling convention.                                            }
+{                                                                }
+{****************************************************************}
+program tcalobj3;
+{$STATIC ON}
+{$R+}
+
+ const
+ { should be defined depending on CPU target }
+ {$ifdef cpu68k}
+   BIG_INDEX = 8000;
+   SMALL_INDEX  = 13;
+ {$endif}
+ {$ifdef cpu86}
+   BIG_INDEX = 33000;
+   SMALL_INDEX = 13;     { value should not be aligned! }
+ {$endif}
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = 2*RESULT_U8BIT;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = $500F0000;
+   RESULT_S32REAL = 1777.12;
+   RESULT_S64REAL = 3444.24;
+   RESULT_BOOL8BIT = 1;
+   RESULT_BOOL16BIT = 1;
+   RESULT_BOOL32BIT = 1;
+   RESULT_PCHAR = 'Hello world';
+   RESULT_BIGSTRING = 'Hello world';
+   RESULT_SMALLSTRING = 'H';
+   RESULT_CHAR = 'I';
+   RESULT_BOOLEAN = TRUE;
+   
+ type
+   
+   tprocedure = procedure;
+   
+   tsmallrecord = packed record
+     b: byte;
+     w: word;
+   end;
+   
+   tlargerecord = packed record
+     b: array[1..BIG_INDEX] of byte;
+   end;
+   
+   tsmallarray = packed array[1..SMALL_INDEX] of byte;
+   
+   tsmallsetenum = 
+   (A_A,A_B,A_C,A_D);
+   
+   tsmallset = set of tsmallsetenum;
+   tlargeset = set of char;
+   
+   tsmallstring = string[2];
+
+
+ var
+  global_u8bit : byte;
+  global_u16bit : word;
+  global_s32bit : longint;
+  global_s32real : single;
+  global_s64real : double;
+  global_ptr : pchar;
+  global_proc : tprocedure;
+  global_bigstring : shortstring;
+  global_boolean : boolean;
+  global_char : char;
+  global_s64bit : int64;
+  value_s64bit : int64;
+  value_ansistring : ansistring;
+  value_u8bit : byte;
+  value_u16bit : word;
+  value_s32bit : longint;
+  value_s32real : single;
+  value_s64real  : double;
+  value_proc : tprocedure;
+  value_ptr : pchar;
+  value_smallrec : tsmallrecord;
+  value_largerec : tlargerecord;
+  value_smallset : tsmallset;
+  value_smallstring : tsmallstring;
+  value_bigstring   : shortstring;
+  value_largeset : tlargeset;
+  value_smallarray : tsmallarray;
+  value_boolean : boolean;
+  value_char : char;
+  
+     procedure fail;
+     begin
+       WriteLn('Failure.');
+       halt(1);
+     end;
+     
+     
+     procedure clear_globals;
+      begin
+       global_u8bit := 0;
+       global_u16bit := 0;
+       global_s32bit := 0;
+       global_s32real := 0.0;
+       global_s64real := 0.0;
+       global_ptr := nil;
+       global_proc := nil;
+       global_bigstring := '';
+       global_boolean := false;
+       global_char := #0;
+       global_s64bit := 0;
+      end;
+      
+      
+     procedure clear_values;
+      begin
+       value_u8bit := 0;
+       value_u16bit := 0;
+       value_s32bit := 0;
+       value_s32real := 0.0;
+       value_s64real  := 0.0;
+       value_proc := nil;
+       value_ptr := nil;
+       fillchar(value_smallrec, sizeof(value_smallrec), #0);
+       fillchar(value_largerec, sizeof(value_largerec), #0);
+       value_smallset := [];
+       value_smallstring := '';
+       value_bigstring   := '';
+       value_largeset := [];
+       fillchar(value_smallarray, sizeof(value_smallarray), #0);
+       value_boolean := false;
+       value_char:=#0;
+       value_ansistring := '';
+       value_s64bit := 0;
+      end;
+      
+      
+      function getu8: byte;
+       begin
+         getu8 := RESULT_U8BIT;
+       end;
+
+
+type
+
+ { object without vmt }
+ pnovmtobject = ^tnovmtobject;
+ tnovmtobject = object
+ public
+   object_bigstring : shortstring;
+   object_u16bit : word;
+   { no parameter testing }
+   procedure method_public_none;cdecl;
+   procedure method_public_static_none; static;cdecl;
+   procedure method_call_private_none;cdecl;
+   procedure method_call_private_static_none; static;cdecl;
+   { simple value parameter testing }
+   procedure method_public_u8(x : byte);cdecl;
+   procedure method_public_static_u8(x: byte); static;cdecl;
+   procedure method_call_private_u8(x: byte);cdecl;
+   procedure method_call_private_static_u8(x: byte); static;cdecl;
+   function  func_array_mixed_nested(b: byte): tsmallarray;cdecl;
+ private
+   procedure method_private_none;cdecl;
+   procedure method_private_static_none; static;cdecl;
+   function func_getu16bit : word;cdecl;
+   { simple value parameter testing }
+   procedure method_private_u8(x: byte);cdecl;
+   procedure method_private_static_u8(x: byte); static;cdecl;
+ end;
+ 
+ 
+ { object with vmt }
+ pvmtobject = ^tvmtobject;
+ tvmtobject = object
+ public
+   object_u8bit : byte;
+   object_u16bit : word;
+   object_bigstring : shortstring;
+   object_s32bit : longint;
+   object_s64bit : int64;
+   constructor constructor_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   constructor constructor_init;cdecl;
+   destructor destructor_params_done;cdecl;
+   procedure method_normal_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   procedure method_virtual_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);virtual;cdecl;
+   procedure method_virtual_overriden_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);virtual;cdecl;
+   procedure method_static_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);static;cdecl;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+      
+   { virtual methods which call other methods }
+   procedure method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;cdecl;
+   procedure method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;cdecl;
+   procedure method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;cdecl;
+   procedure method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;cdecl;
+   procedure method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;cdecl;
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;cdecl;
+      
+ end;
+ 
+ pheritedvmtobject = ^theritedvmtobject;
+ theritedvmtobject = object(tvmtobject)
+   constructor constructor_params_mixed_call_virtual(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   constructor constructor_params_mixed_call_overriden(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   constructor constructor_params_mixed_call_static(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   constructor constructor_params_mixed_call_normal(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   constructor constructor_params_mixed_call_inherited(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   procedure method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;cdecl;
+    
+   { normal methods which call other methods }
+   procedure method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   procedure method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   procedure method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   procedure method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   procedure method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+
+   { virtual methods which call other methods }
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;cdecl;
+   
+ end;
+ 
+ pfailvmtobject = ^tfailvmtobject;
+ tfailvmtobject = object(tvmtobject)
+ public
+    constructor constructor_public_none;cdecl;
+ end;
+ 
+ 
+ 
+{**************************************************************************}
+{                             NO VMT OBJECT                                }
+{**************************************************************************}
+ 
+  {****************** NO PARAMETERS ******************}
+ procedure tnovmtobject.method_public_none;cdecl;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+  
+  
+ procedure tnovmtobject.method_public_static_none;cdecl;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+
+
+ procedure tnovmtobject.method_call_private_none;cdecl;
+   begin
+       method_private_none;
+       method_private_static_none;
+   end;
+   
+ procedure tnovmtobject.method_call_private_static_none;cdecl;
+   begin
+     method_private_static_none;
+   end;
+   
+   
+ procedure tnovmtobject.method_private_none;cdecl;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+  
+  
+ procedure tnovmtobject.method_private_static_none;cdecl;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+
+  {******************** PARAMETERS ******************}
+  
+  procedure tnovmtobject.method_public_u8(x : byte);cdecl;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_public_static_u8(x: byte);cdecl;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_call_private_u8(x: byte);cdecl;
+   begin
+     method_private_static_u8(x);
+     method_private_u8(x);
+   end;
+   
+  procedure tnovmtobject. method_call_private_static_u8(x: byte);cdecl;
+   begin
+     method_private_static_u8(x);
+   end;
+
+   procedure tnovmtobject.method_private_u8(x: byte);cdecl;
+    begin
+      Inc(global_u16bit,x);
+    end;
+    
+   procedure tnovmtobject.method_private_static_u8(x: byte);cdecl;
+    begin
+      Inc(global_u16bit,x);
+    end;
+
+
+  function tnovmtobject.func_getu16bit : word;cdecl;
+   begin
+     func_getu16bit := object_u16bit;
+   end;
+
+  { 
+    complex testing, nested field access, with parameters and 
+    comple return value.
+    
+    On exit : global_u8bit := x;
+              global_u16bit := object_u16bit (from func_getu16bit);
+              global_s32bit :=  RESULT_S32BIT
+              global_bigstring := object_bigstring
+              global_s64bit := x;
+  }
+  function tnovmtobject.func_array_mixed_nested(b: byte): tsmallarray;cdecl;
+
+    procedure nested_one_proc(l: longint);
+     begin
+       global_u16bit := func_getu16bit;
+       global_s32bit := l;
+     end;
+     
+    procedure nested_two_proc(l : longint);
+     begin
+       global_s64bit := l;  
+     end;
+
+     
+
+   function nested_one_func(level1_b : byte; s: shortstring): byte;
+     var
+      s1 : shortstring;
+   
+      function nested_two_func(level2_b : byte; s :shortstring): byte;
+        begin
+          nested_two_func:=level2_b;
+          global_bigstring := s;
+          nested_one_proc(RESULT_S32BIT);
+        end;
+       
+    begin
+      s1:=s;
+      nested_one_func := nested_two_func(level1_b,s1);
+      nested_two_proc(level1_b);
+    end;
+    
+    
+ var
+  local_b: byte;
+  smallarray: tsmallarray;
+ begin
+  fillchar(smallarray, sizeof(smallarray), #0);
+  smallarray[1] := RESULT_U8BIT; 
+  smallarray[SMALL_INDEX] := RESULT_U8BIT;
+  func_array_mixed_nested := smallarray;
+  local_b:=b;
+  global_u8bit := nested_one_func(local_b, object_bigstring);
+ end;
+ 
+{**************************************************************************}
+{                             FAILED OBJECT                                }
+{**************************************************************************}
+constructor tfailvmtobject.constructor_public_none;cdecl;
+ begin
+    { this calls the constructor fail special keyword }
+    fail;
+ end;
+ 
+{**************************************************************************}
+{                               VMT  OBJECT                                }
+{**************************************************************************}
+constructor tvmtobject.constructor_params_mixed(u8 :byte; u16: word; 
+   bigstring: shortstring; s32: longint; s64: int64);cdecl;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+ 
+constructor tvmtobject.constructor_init;cdecl;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+destructor tvmtobject.destructor_params_done;cdecl;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+ 
+procedure tvmtobject.method_normal_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+procedure tvmtobject.method_virtual_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+{ this one should be overriden } 
+procedure tvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+ begin
+    RunError(211);
+ end;
+ 
+{ can't access field of instances in static methods } 
+procedure tvmtobject.method_static_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+ begin
+   global_u8bit := u8;
+   global_u16bit := u16;
+   global_bigstring := bigstring;
+   global_s32bit := s32;
+   global_s64bit := s64;
+ end;
+
+procedure tvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+procedure tvmtobject.method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure tvmtobject.method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure tvmtobject.method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure tvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+{**************************************************************************}
+{                          INHERITED VMT OBJECT                            }
+{**************************************************************************}
+constructor theritedvmtobject.constructor_params_mixed_call_virtual(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+
+constructor theritedvmtobject.constructor_params_mixed_call_overriden(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+     
+constructor theritedvmtobject.constructor_params_mixed_call_static(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_static_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_normal(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_inherited
+   (u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   inherited constructor_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+    
+{ this one should be overriden } 
+procedure theritedvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+
+procedure theritedvmtobject.method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure theritedvmtobject.method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure theritedvmtobject.method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure theritedvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+  begin
+   Inherited method_normal_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+procedure theritedvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);cdecl;
+  begin
+   Inherited method_virtual_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+
+procedure testnovmtobject;
+var
+  novmtobject : tnovmtobject;
+  failed : boolean;
+begin
+  {******************** STATIC / METHOD SIMPLE CALL **********************}
+  Write('No parameter / method call testing...');
+  failed := false;
+ 
+  clear_globals;
+  clear_values;
+ 
+  tnovmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  novmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  tnovmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+ 
+  novmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_call_private_none;
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+  
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+  Write('Simple parameter (LOC_CONSTANT) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  { parameter is LOC_CONSTANT }
+  novmtobject.method_public_u8(RESULT_U8BIT);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+ 
+  Write('Simple parameter (LOC_REFERENCE) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_u8(value_u8bit);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  value_u8bit := RESULT_U8BIT;
+  tnovmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+   
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_call_private_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+ 
+  value_u8bit := RESULT_U8BIT;   
+  novmtobject.method_call_private_static_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+ 
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+ 
+  Write('Simple parameter (LOC_REGISTER) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_u8(getu8);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(getu8);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(getu8);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+ if failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+  Write('Simple parameter / complex return / nested method access testing...');
+  
+  clear_globals; 
+  clear_values;
+  failed := false;
+  novmtobject.object_bigstring := RESULT_BIGSTRING;
+  novmtobject.object_u16bit := RESULT_U16BIT;
+    
+  value_smallarray := novmtobject.func_array_mixed_nested(RESULT_U8BIT);
+  if (value_smallarray[1] <> RESULT_U8BIT) or (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) then
+    failed := true;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  if global_bigstring <> RESULT_BIGSTRING then
+    failed := true;
+  if global_u16bit <> RESULT_U16BIT then
+    failed := true;
+  if global_s32bit <> RESULT_S32BIT then
+    failed := true;
+  if global_s64bit <> RESULT_U8BIT then
+    failed := true;
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+end;
+
+
+procedure testfailedobject;
+var
+  failedobject : tfailvmtobject;
+ begin
+  Write('Testing constructor return value...'); 
+  if failedobject.constructor_public_none then
+    fail
+  else
+    Writeln('Passed!');
+ end;
+ 
+ 
+ procedure testvmtobject;
+  var
+   vmtobject : tvmtobject;
+   failed : boolean;
+  begin
+  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call...');
+    vmtobject.constructor_params_mixed(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed(value_u8bit, value_u16bit, value_bigstring, 
+       value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+  end;
+  
+  
+ procedure testheritedvmtobject;
+  var
+   vmtobject : theritedvmtobject;
+   failed : boolean;
+  begin
+    {********************** CONSTRUCTOR TESTING ************************}  
+    {********************** DESTRUCTOR  TESTING ************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
+    vmtobject.constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, 
+       RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_inherited(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_virtual(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_virtual(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_overriden(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_overriden(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
+    vmtobject.constructor_params_mixed_call_normal(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_normal(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
+    vmtobject.constructor_params_mixed_call_static(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_static(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    {************************* METHOD TESTING **************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call...');
+    vmtobject.method_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
+    vmtobject.method_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { ********************************************************************
+      This calls methods which in turn call other methods, or a constructor 
+      or a destructor.
+      *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
+    vmtobject.method_normal_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
+    vmtobject.method_normal_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static method call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
+    vmtobject.method_normal_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
+    vmtobject.method_normal_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+ { ********************************************************************
+      This calls virtual methods which in turn call other methods, 
+      or a constructor  or a destructor.
+   *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
+    vmtobject.method_virtual_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
+    vmtobject.method_virtual_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static virtual call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
+    vmtobject.method_virtual_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
+    vmtobject.method_virtual_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+
+  end;
+  
+
+begin
+  WriteLN('*********************** NO VMT OBJECT TESTS ********************');
+  testnovmtobject;   
+  WriteLN('************************ VMT OBJECT FAIL  **********************');
+  testfailedobject;
+  WriteLN('************************* VMT OBJECT TESTS *********************');
+  testvmtobject;
+  testheritedvmtobject;
+end.
+
+{
+  $Log$
+  Revision 1.1  2002-05-05 13:58:50  carl
+  + finished procedural variable testsuit
+  + finished method testsuit
+
+}

+ 2129 - 0
tests/test/cg/tcalobj4.pp

@@ -0,0 +1,2129 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{  Copyright (c) 2002 Carl Eric Codere                           }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondtypeconv()                               }
+{                 secondtryexcept()                              }
+{****************************************************************}
+{ DEFINES:                                                       }
+{            FPC     = Target is FreePascal compiler             }
+{****************************************************************}
+{ REMARKS: This tests secondcalln(), genentrycode() and          }
+{ genexitcode() for standard object with the popstack            }
+{ calling convention.                                            }
+{                                                                }
+{****************************************************************}
+program tcalobj4;
+{$STATIC ON}
+{$R+}
+
+ const
+ { should be defined depending on CPU target }
+ {$ifdef cpu68k}
+   BIG_INDEX = 8000;
+   SMALL_INDEX  = 13;
+ {$endif}
+ {$ifdef cpu86}
+   BIG_INDEX = 33000;
+   SMALL_INDEX = 13;     { value should not be aligned! }
+ {$endif}
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = 2*RESULT_U8BIT;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = $500F0000;
+   RESULT_S32REAL = 1777.12;
+   RESULT_S64REAL = 3444.24;
+   RESULT_BOOL8BIT = 1;
+   RESULT_BOOL16BIT = 1;
+   RESULT_BOOL32BIT = 1;
+   RESULT_PCHAR = 'Hello world';
+   RESULT_BIGSTRING = 'Hello world';
+   RESULT_SMALLSTRING = 'H';
+   RESULT_CHAR = 'I';
+   RESULT_BOOLEAN = TRUE;
+   
+ type
+   
+   tprocedure = procedure;
+   
+   tsmallrecord = packed record
+     b: byte;
+     w: word;
+   end;
+   
+   tlargerecord = packed record
+     b: array[1..BIG_INDEX] of byte;
+   end;
+   
+   tsmallarray = packed array[1..SMALL_INDEX] of byte;
+   
+   tsmallsetenum = 
+   (A_A,A_B,A_C,A_D);
+   
+   tsmallset = set of tsmallsetenum;
+   tlargeset = set of char;
+   
+   tsmallstring = string[2];
+
+
+ var
+  global_u8bit : byte;
+  global_u16bit : word;
+  global_s32bit : longint;
+  global_s32real : single;
+  global_s64real : double;
+  global_ptr : pchar;
+  global_proc : tprocedure;
+  global_bigstring : shortstring;
+  global_boolean : boolean;
+  global_char : char;
+  global_s64bit : int64;
+  value_s64bit : int64;
+  value_ansistring : ansistring;
+  value_u8bit : byte;
+  value_u16bit : word;
+  value_s32bit : longint;
+  value_s32real : single;
+  value_s64real  : double;
+  value_proc : tprocedure;
+  value_ptr : pchar;
+  value_smallrec : tsmallrecord;
+  value_largerec : tlargerecord;
+  value_smallset : tsmallset;
+  value_smallstring : tsmallstring;
+  value_bigstring   : shortstring;
+  value_largeset : tlargeset;
+  value_smallarray : tsmallarray;
+  value_boolean : boolean;
+  value_char : char;
+  
+     procedure fail;
+     begin
+       WriteLn('Failure.');
+       halt(1);
+     end;
+     
+     
+     procedure clear_globals;
+      begin
+       global_u8bit := 0;
+       global_u16bit := 0;
+       global_s32bit := 0;
+       global_s32real := 0.0;
+       global_s64real := 0.0;
+       global_ptr := nil;
+       global_proc := nil;
+       global_bigstring := '';
+       global_boolean := false;
+       global_char := #0;
+       global_s64bit := 0;
+      end;
+      
+      
+     procedure clear_values;
+      begin
+       value_u8bit := 0;
+       value_u16bit := 0;
+       value_s32bit := 0;
+       value_s32real := 0.0;
+       value_s64real  := 0.0;
+       value_proc := nil;
+       value_ptr := nil;
+       fillchar(value_smallrec, sizeof(value_smallrec), #0);
+       fillchar(value_largerec, sizeof(value_largerec), #0);
+       value_smallset := [];
+       value_smallstring := '';
+       value_bigstring   := '';
+       value_largeset := [];
+       fillchar(value_smallarray, sizeof(value_smallarray), #0);
+       value_boolean := false;
+       value_char:=#0;
+       value_ansistring := '';
+       value_s64bit := 0;
+      end;
+      
+      
+      function getu8: byte;
+       begin
+         getu8 := RESULT_U8BIT;
+       end;
+
+
+type
+
+ { object without vmt }
+ pnovmtobject = ^tnovmtobject;
+ tnovmtobject = object
+ public
+   object_bigstring : shortstring;
+   object_u16bit : word;
+   { no parameter testing }
+   procedure method_public_none;popstack;
+   procedure method_public_static_none; static;popstack;
+   procedure method_call_private_none;popstack;
+   procedure method_call_private_static_none; static;popstack;
+   { simple value parameter testing }
+   procedure method_public_u8(x : byte);popstack;
+   procedure method_public_static_u8(x: byte); static;popstack;
+   procedure method_call_private_u8(x: byte);popstack;
+   procedure method_call_private_static_u8(x: byte); static;popstack;
+   function  func_array_mixed_nested(b: byte): tsmallarray;popstack;
+ private
+   procedure method_private_none;popstack;
+   procedure method_private_static_none; static;popstack;
+   function func_getu16bit : word;popstack;
+   { simple value parameter testing }
+   procedure method_private_u8(x: byte);popstack;
+   procedure method_private_static_u8(x: byte); static;popstack;
+ end;
+ 
+ 
+ { object with vmt }
+ pvmtobject = ^tvmtobject;
+ tvmtobject = object
+ public
+   object_u8bit : byte;
+   object_u16bit : word;
+   object_bigstring : shortstring;
+   object_s32bit : longint;
+   object_s64bit : int64;
+   constructor constructor_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);popstack;
+   constructor constructor_init;popstack;
+   destructor destructor_params_done;popstack;
+   procedure method_normal_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);popstack;
+   procedure method_virtual_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);virtual;popstack;
+   procedure method_virtual_overriden_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);virtual;popstack;
+   procedure method_static_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);static;popstack;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+      
+   { virtual methods which call other methods }
+   procedure method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;popstack;
+   procedure method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;popstack;
+   procedure method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;popstack;
+   procedure method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;popstack;
+   procedure method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;popstack;
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;popstack;
+      
+ end;
+ 
+ pheritedvmtobject = ^theritedvmtobject;
+ theritedvmtobject = object(tvmtobject)
+   constructor constructor_params_mixed_call_virtual(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);popstack;
+   constructor constructor_params_mixed_call_overriden(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);popstack;
+   constructor constructor_params_mixed_call_static(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);popstack;
+   constructor constructor_params_mixed_call_normal(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);popstack;
+   constructor constructor_params_mixed_call_inherited(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);popstack;
+   procedure method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;popstack;
+    
+   { normal methods which call other methods }
+   procedure method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   procedure method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   procedure method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   procedure method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   procedure method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+
+   { virtual methods which call other methods }
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;popstack;
+   
+ end;
+ 
+ pfailvmtobject = ^tfailvmtobject;
+ tfailvmtobject = object(tvmtobject)
+ public
+    constructor constructor_public_none;popstack;
+ end;
+ 
+ 
+ 
+{**************************************************************************}
+{                             NO VMT OBJECT                                }
+{**************************************************************************}
+ 
+  {****************** NO PARAMETERS ******************}
+ procedure tnovmtobject.method_public_none;popstack;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+  
+  
+ procedure tnovmtobject.method_public_static_none;popstack;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+
+
+ procedure tnovmtobject.method_call_private_none;popstack;
+   begin
+       method_private_none;
+       method_private_static_none;
+   end;
+   
+ procedure tnovmtobject.method_call_private_static_none;popstack;
+   begin
+     method_private_static_none;
+   end;
+   
+   
+ procedure tnovmtobject.method_private_none;popstack;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+  
+  
+ procedure tnovmtobject.method_private_static_none;popstack;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+
+  {******************** PARAMETERS ******************}
+  
+  procedure tnovmtobject.method_public_u8(x : byte);popstack;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_public_static_u8(x: byte);popstack;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_call_private_u8(x: byte);popstack;
+   begin
+     method_private_static_u8(x);
+     method_private_u8(x);
+   end;
+   
+  procedure tnovmtobject. method_call_private_static_u8(x: byte);popstack;
+   begin
+     method_private_static_u8(x);
+   end;
+
+   procedure tnovmtobject.method_private_u8(x: byte);popstack;
+    begin
+      Inc(global_u16bit,x);
+    end;
+    
+   procedure tnovmtobject.method_private_static_u8(x: byte);popstack;
+    begin
+      Inc(global_u16bit,x);
+    end;
+
+
+  function tnovmtobject.func_getu16bit : word;popstack;
+   begin
+     func_getu16bit := object_u16bit;
+   end;
+
+  { 
+    complex testing, nested field access, with parameters and 
+    comple return value.
+    
+    On exit : global_u8bit := x;
+              global_u16bit := object_u16bit (from func_getu16bit);
+              global_s32bit :=  RESULT_S32BIT
+              global_bigstring := object_bigstring
+              global_s64bit := x;
+  }
+  function tnovmtobject.func_array_mixed_nested(b: byte): tsmallarray;popstack;
+
+    procedure nested_one_proc(l: longint);
+     begin
+       global_u16bit := func_getu16bit;
+       global_s32bit := l;
+     end;
+     
+    procedure nested_two_proc(l : longint);
+     begin
+       global_s64bit := l;  
+     end;
+
+     
+
+   function nested_one_func(level1_b : byte; s: shortstring): byte;
+     var
+      s1 : shortstring;
+   
+      function nested_two_func(level2_b : byte; s :shortstring): byte;
+        begin
+          nested_two_func:=level2_b;
+          global_bigstring := s;
+          nested_one_proc(RESULT_S32BIT);
+        end;
+       
+    begin
+      s1:=s;
+      nested_one_func := nested_two_func(level1_b,s1);
+      nested_two_proc(level1_b);
+    end;
+    
+    
+ var
+  local_b: byte;
+  smallarray: tsmallarray;
+ begin
+  fillchar(smallarray, sizeof(smallarray), #0);
+  smallarray[1] := RESULT_U8BIT; 
+  smallarray[SMALL_INDEX] := RESULT_U8BIT;
+  func_array_mixed_nested := smallarray;
+  local_b:=b;
+  global_u8bit := nested_one_func(local_b, object_bigstring);
+ end;
+ 
+{**************************************************************************}
+{                             FAILED OBJECT                                }
+{**************************************************************************}
+constructor tfailvmtobject.constructor_public_none;popstack;
+ begin
+    { this calls the constructor fail special keyword }
+    fail;
+ end;
+ 
+{**************************************************************************}
+{                               VMT  OBJECT                                }
+{**************************************************************************}
+constructor tvmtobject.constructor_params_mixed(u8 :byte; u16: word; 
+   bigstring: shortstring; s32: longint; s64: int64);popstack;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+ 
+constructor tvmtobject.constructor_init;popstack;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+destructor tvmtobject.destructor_params_done;popstack;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+ 
+procedure tvmtobject.method_normal_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+procedure tvmtobject.method_virtual_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+{ this one should be overriden } 
+procedure tvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+ begin
+    RunError(211);
+ end;
+ 
+{ can't access field of instances in static methods } 
+procedure tvmtobject.method_static_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+ begin
+   global_u8bit := u8;
+   global_u16bit := u16;
+   global_bigstring := bigstring;
+   global_s32bit := s32;
+   global_s64bit := s64;
+ end;
+
+procedure tvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+procedure tvmtobject.method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure tvmtobject.method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure tvmtobject.method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure tvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+{**************************************************************************}
+{                          INHERITED VMT OBJECT                            }
+{**************************************************************************}
+constructor theritedvmtobject.constructor_params_mixed_call_virtual(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+
+constructor theritedvmtobject.constructor_params_mixed_call_overriden(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+     
+constructor theritedvmtobject.constructor_params_mixed_call_static(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_static_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_normal(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_inherited
+   (u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   inherited constructor_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+    
+{ this one should be overriden } 
+procedure theritedvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+
+procedure theritedvmtobject.method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure theritedvmtobject.method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure theritedvmtobject.method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure theritedvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+  begin
+   Inherited method_normal_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+procedure theritedvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);popstack;
+  begin
+   Inherited method_virtual_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+
+procedure testnovmtobject;
+var
+  novmtobject : tnovmtobject;
+  failed : boolean;
+begin
+  {******************** STATIC / METHOD SIMPLE CALL **********************}
+  Write('No parameter / method call testing...');
+  failed := false;
+ 
+  clear_globals;
+  clear_values;
+ 
+  tnovmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  novmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  tnovmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+ 
+  novmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_call_private_none;
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+  
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+  Write('Simple parameter (LOC_CONSTANT) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  { parameter is LOC_CONSTANT }
+  novmtobject.method_public_u8(RESULT_U8BIT);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+ 
+  Write('Simple parameter (LOC_REFERENCE) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_u8(value_u8bit);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  value_u8bit := RESULT_U8BIT;
+  tnovmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+   
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_call_private_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+ 
+  value_u8bit := RESULT_U8BIT;   
+  novmtobject.method_call_private_static_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+ 
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+ 
+  Write('Simple parameter (LOC_REGISTER) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_u8(getu8);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(getu8);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(getu8);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+ if failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+  Write('Simple parameter / complex return / nested method access testing...');
+  
+  clear_globals; 
+  clear_values;
+  failed := false;
+  novmtobject.object_bigstring := RESULT_BIGSTRING;
+  novmtobject.object_u16bit := RESULT_U16BIT;
+    
+  value_smallarray := novmtobject.func_array_mixed_nested(RESULT_U8BIT);
+  if (value_smallarray[1] <> RESULT_U8BIT) or (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) then
+    failed := true;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  if global_bigstring <> RESULT_BIGSTRING then
+    failed := true;
+  if global_u16bit <> RESULT_U16BIT then
+    failed := true;
+  if global_s32bit <> RESULT_S32BIT then
+    failed := true;
+  if global_s64bit <> RESULT_U8BIT then
+    failed := true;
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+end;
+
+
+procedure testfailedobject;
+var
+  failedobject : tfailvmtobject;
+ begin
+  Write('Testing constructor return value...'); 
+  if failedobject.constructor_public_none then
+    fail
+  else
+    Writeln('Passed!');
+ end;
+ 
+ 
+ procedure testvmtobject;
+  var
+   vmtobject : tvmtobject;
+   failed : boolean;
+  begin
+  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call...');
+    vmtobject.constructor_params_mixed(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed(value_u8bit, value_u16bit, value_bigstring, 
+       value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+  end;
+  
+  
+ procedure testheritedvmtobject;
+  var
+   vmtobject : theritedvmtobject;
+   failed : boolean;
+  begin
+    {********************** CONSTRUCTOR TESTING ************************}  
+    {********************** DESTRUCTOR  TESTING ************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
+    vmtobject.constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, 
+       RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_inherited(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_virtual(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_virtual(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_overriden(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_overriden(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
+    vmtobject.constructor_params_mixed_call_normal(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_normal(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
+    vmtobject.constructor_params_mixed_call_static(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_static(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    {************************* METHOD TESTING **************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call...');
+    vmtobject.method_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
+    vmtobject.method_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { ********************************************************************
+      This calls methods which in turn call other methods, or a constructor 
+      or a destructor.
+      *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
+    vmtobject.method_normal_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
+    vmtobject.method_normal_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static method call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
+    vmtobject.method_normal_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
+    vmtobject.method_normal_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+ { ********************************************************************
+      This calls virtual methods which in turn call other methods, 
+      or a constructor  or a destructor.
+   *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
+    vmtobject.method_virtual_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
+    vmtobject.method_virtual_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static virtual call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
+    vmtobject.method_virtual_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
+    vmtobject.method_virtual_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+
+  end;
+  
+
+begin
+  WriteLN('*********************** NO VMT OBJECT TESTS ********************');
+  testnovmtobject;   
+  WriteLN('************************ VMT OBJECT FAIL  **********************');
+  testfailedobject;
+  WriteLN('************************* VMT OBJECT TESTS *********************');
+  testvmtobject;
+  testheritedvmtobject;
+end.
+
+{
+  $Log$
+  Revision 1.1  2002-05-05 13:58:50  carl
+  + finished procedural variable testsuit
+  + finished method testsuit
+
+}

+ 2129 - 0
tests/test/cg/tcalobj5.pp

@@ -0,0 +1,2129 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{  Copyright (c) 2002 Carl Eric Codere                           }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondtypeconv()                               }
+{                 secondtryexcept()                              }
+{****************************************************************}
+{ DEFINES:                                                       }
+{            FPC     = Target is FreePascal compiler             }
+{****************************************************************}
+{ REMARKS: This tests secondcalln(), genentrycode() and          }
+{ genexitcode() for standard object with the safecall            }
+{ calling convention.                                            }
+{                                                                }
+{****************************************************************}
+program tcalobj5;
+{$STATIC ON}
+{$R+}
+
+ const
+ { should be defined depending on CPU target }
+ {$ifdef cpu68k}
+   BIG_INDEX = 8000;
+   SMALL_INDEX  = 13;
+ {$endif}
+ {$ifdef cpu86}
+   BIG_INDEX = 33000;
+   SMALL_INDEX = 13;     { value should not be aligned! }
+ {$endif}
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = 2*RESULT_U8BIT;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = $500F0000;
+   RESULT_S32REAL = 1777.12;
+   RESULT_S64REAL = 3444.24;
+   RESULT_BOOL8BIT = 1;
+   RESULT_BOOL16BIT = 1;
+   RESULT_BOOL32BIT = 1;
+   RESULT_PCHAR = 'Hello world';
+   RESULT_BIGSTRING = 'Hello world';
+   RESULT_SMALLSTRING = 'H';
+   RESULT_CHAR = 'I';
+   RESULT_BOOLEAN = TRUE;
+   
+ type
+   
+   tprocedure = procedure;
+   
+   tsmallrecord = packed record
+     b: byte;
+     w: word;
+   end;
+   
+   tlargerecord = packed record
+     b: array[1..BIG_INDEX] of byte;
+   end;
+   
+   tsmallarray = packed array[1..SMALL_INDEX] of byte;
+   
+   tsmallsetenum = 
+   (A_A,A_B,A_C,A_D);
+   
+   tsmallset = set of tsmallsetenum;
+   tlargeset = set of char;
+   
+   tsmallstring = string[2];
+
+
+ var
+  global_u8bit : byte;
+  global_u16bit : word;
+  global_s32bit : longint;
+  global_s32real : single;
+  global_s64real : double;
+  global_ptr : pchar;
+  global_proc : tprocedure;
+  global_bigstring : shortstring;
+  global_boolean : boolean;
+  global_char : char;
+  global_s64bit : int64;
+  value_s64bit : int64;
+  value_ansistring : ansistring;
+  value_u8bit : byte;
+  value_u16bit : word;
+  value_s32bit : longint;
+  value_s32real : single;
+  value_s64real  : double;
+  value_proc : tprocedure;
+  value_ptr : pchar;
+  value_smallrec : tsmallrecord;
+  value_largerec : tlargerecord;
+  value_smallset : tsmallset;
+  value_smallstring : tsmallstring;
+  value_bigstring   : shortstring;
+  value_largeset : tlargeset;
+  value_smallarray : tsmallarray;
+  value_boolean : boolean;
+  value_char : char;
+  
+     procedure fail;
+     begin
+       WriteLn('Failure.');
+       halt(1);
+     end;
+     
+     
+     procedure clear_globals;
+      begin
+       global_u8bit := 0;
+       global_u16bit := 0;
+       global_s32bit := 0;
+       global_s32real := 0.0;
+       global_s64real := 0.0;
+       global_ptr := nil;
+       global_proc := nil;
+       global_bigstring := '';
+       global_boolean := false;
+       global_char := #0;
+       global_s64bit := 0;
+      end;
+      
+      
+     procedure clear_values;
+      begin
+       value_u8bit := 0;
+       value_u16bit := 0;
+       value_s32bit := 0;
+       value_s32real := 0.0;
+       value_s64real  := 0.0;
+       value_proc := nil;
+       value_ptr := nil;
+       fillchar(value_smallrec, sizeof(value_smallrec), #0);
+       fillchar(value_largerec, sizeof(value_largerec), #0);
+       value_smallset := [];
+       value_smallstring := '';
+       value_bigstring   := '';
+       value_largeset := [];
+       fillchar(value_smallarray, sizeof(value_smallarray), #0);
+       value_boolean := false;
+       value_char:=#0;
+       value_ansistring := '';
+       value_s64bit := 0;
+      end;
+      
+      
+      function getu8: byte;
+       begin
+         getu8 := RESULT_U8BIT;
+       end;
+
+
+type
+
+ { object without vmt }
+ pnovmtobject = ^tnovmtobject;
+ tnovmtobject = object
+ public
+   object_bigstring : shortstring;
+   object_u16bit : word;
+   { no parameter testing }
+   procedure method_public_none;safecall;
+   procedure method_public_static_none; static;safecall;
+   procedure method_call_private_none;safecall;
+   procedure method_call_private_static_none; static;safecall;
+   { simple value parameter testing }
+   procedure method_public_u8(x : byte);safecall;
+   procedure method_public_static_u8(x: byte); static;safecall;
+   procedure method_call_private_u8(x: byte);safecall;
+   procedure method_call_private_static_u8(x: byte); static;safecall;
+   function  func_array_mixed_nested(b: byte): tsmallarray;safecall;
+ private
+   procedure method_private_none;safecall;
+   procedure method_private_static_none; static;safecall;
+   function func_getu16bit : word;safecall;
+   { simple value parameter testing }
+   procedure method_private_u8(x: byte);safecall;
+   procedure method_private_static_u8(x: byte); static;safecall;
+ end;
+ 
+ 
+ { object with vmt }
+ pvmtobject = ^tvmtobject;
+ tvmtobject = object
+ public
+   object_u8bit : byte;
+   object_u16bit : word;
+   object_bigstring : shortstring;
+   object_s32bit : longint;
+   object_s64bit : int64;
+   constructor constructor_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);safecall;
+   constructor constructor_init;safecall;
+   destructor destructor_params_done;safecall;
+   procedure method_normal_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);safecall;
+   procedure method_virtual_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
+   procedure method_virtual_overriden_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
+   procedure method_static_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);static;safecall;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+      
+   { virtual methods which call other methods }
+   procedure method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
+   procedure method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
+   procedure method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
+   procedure method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
+   procedure method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
+      
+ end;
+ 
+ pheritedvmtobject = ^theritedvmtobject;
+ theritedvmtobject = object(tvmtobject)
+   constructor constructor_params_mixed_call_virtual(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);safecall;
+   constructor constructor_params_mixed_call_overriden(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);safecall;
+   constructor constructor_params_mixed_call_static(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);safecall;
+   constructor constructor_params_mixed_call_normal(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);safecall;
+   constructor constructor_params_mixed_call_inherited(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);safecall;
+   procedure method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
+    
+   { normal methods which call other methods }
+   procedure method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   procedure method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   procedure method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   procedure method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   procedure method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+
+   { virtual methods which call other methods }
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;safecall;
+   
+ end;
+ 
+ pfailvmtobject = ^tfailvmtobject;
+ tfailvmtobject = object(tvmtobject)
+ public
+    constructor constructor_public_none;safecall;
+ end;
+ 
+ 
+ 
+{**************************************************************************}
+{                             NO VMT OBJECT                                }
+{**************************************************************************}
+ 
+  {****************** NO PARAMETERS ******************}
+ procedure tnovmtobject.method_public_none;safecall;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+  
+  
+ procedure tnovmtobject.method_public_static_none;safecall;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+
+
+ procedure tnovmtobject.method_call_private_none;safecall;
+   begin
+       method_private_none;
+       method_private_static_none;
+   end;
+   
+ procedure tnovmtobject.method_call_private_static_none;safecall;
+   begin
+     method_private_static_none;
+   end;
+   
+   
+ procedure tnovmtobject.method_private_none;safecall;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+  
+  
+ procedure tnovmtobject.method_private_static_none;safecall;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+
+  {******************** PARAMETERS ******************}
+  
+  procedure tnovmtobject.method_public_u8(x : byte);safecall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_public_static_u8(x: byte);safecall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_call_private_u8(x: byte);safecall;
+   begin
+     method_private_static_u8(x);
+     method_private_u8(x);
+   end;
+   
+  procedure tnovmtobject. method_call_private_static_u8(x: byte);safecall;
+   begin
+     method_private_static_u8(x);
+   end;
+
+   procedure tnovmtobject.method_private_u8(x: byte);safecall;
+    begin
+      Inc(global_u16bit,x);
+    end;
+    
+   procedure tnovmtobject.method_private_static_u8(x: byte);safecall;
+    begin
+      Inc(global_u16bit,x);
+    end;
+
+
+  function tnovmtobject.func_getu16bit : word;safecall;
+   begin
+     func_getu16bit := object_u16bit;
+   end;
+
+  { 
+    complex testing, nested field access, with parameters and 
+    comple return value.
+    
+    On exit : global_u8bit := x;
+              global_u16bit := object_u16bit (from func_getu16bit);
+              global_s32bit :=  RESULT_S32BIT
+              global_bigstring := object_bigstring
+              global_s64bit := x;
+  }
+  function tnovmtobject.func_array_mixed_nested(b: byte): tsmallarray;safecall;
+
+    procedure nested_one_proc(l: longint);
+     begin
+       global_u16bit := func_getu16bit;
+       global_s32bit := l;
+     end;
+     
+    procedure nested_two_proc(l : longint);
+     begin
+       global_s64bit := l;  
+     end;
+
+     
+
+   function nested_one_func(level1_b : byte; s: shortstring): byte;
+     var
+      s1 : shortstring;
+   
+      function nested_two_func(level2_b : byte; s :shortstring): byte;
+        begin
+          nested_two_func:=level2_b;
+          global_bigstring := s;
+          nested_one_proc(RESULT_S32BIT);
+        end;
+       
+    begin
+      s1:=s;
+      nested_one_func := nested_two_func(level1_b,s1);
+      nested_two_proc(level1_b);
+    end;
+    
+    
+ var
+  local_b: byte;
+  smallarray: tsmallarray;
+ begin
+  fillchar(smallarray, sizeof(smallarray), #0);
+  smallarray[1] := RESULT_U8BIT; 
+  smallarray[SMALL_INDEX] := RESULT_U8BIT;
+  func_array_mixed_nested := smallarray;
+  local_b:=b;
+  global_u8bit := nested_one_func(local_b, object_bigstring);
+ end;
+ 
+{**************************************************************************}
+{                             FAILED OBJECT                                }
+{**************************************************************************}
+constructor tfailvmtobject.constructor_public_none;safecall;
+ begin
+    { this calls the constructor fail special keyword }
+    fail;
+ end;
+ 
+{**************************************************************************}
+{                               VMT  OBJECT                                }
+{**************************************************************************}
+constructor tvmtobject.constructor_params_mixed(u8 :byte; u16: word; 
+   bigstring: shortstring; s32: longint; s64: int64);safecall;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+ 
+constructor tvmtobject.constructor_init;safecall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+destructor tvmtobject.destructor_params_done;safecall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+ 
+procedure tvmtobject.method_normal_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+procedure tvmtobject.method_virtual_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+{ this one should be overriden } 
+procedure tvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+ begin
+    RunError(211);
+ end;
+ 
+{ can't access field of instances in static methods } 
+procedure tvmtobject.method_static_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+ begin
+   global_u8bit := u8;
+   global_u16bit := u16;
+   global_bigstring := bigstring;
+   global_s32bit := s32;
+   global_s64bit := s64;
+ end;
+
+procedure tvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+procedure tvmtobject.method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure tvmtobject.method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure tvmtobject.method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure tvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+{**************************************************************************}
+{                          INHERITED VMT OBJECT                            }
+{**************************************************************************}
+constructor theritedvmtobject.constructor_params_mixed_call_virtual(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+
+constructor theritedvmtobject.constructor_params_mixed_call_overriden(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+     
+constructor theritedvmtobject.constructor_params_mixed_call_static(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_static_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_normal(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_inherited
+   (u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   inherited constructor_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+    
+{ this one should be overriden } 
+procedure theritedvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+
+procedure theritedvmtobject.method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure theritedvmtobject.method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure theritedvmtobject.method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure theritedvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+  begin
+   Inherited method_normal_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+procedure theritedvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);safecall;
+  begin
+   Inherited method_virtual_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+
+procedure testnovmtobject;
+var
+  novmtobject : tnovmtobject;
+  failed : boolean;
+begin
+  {******************** STATIC / METHOD SIMPLE CALL **********************}
+  Write('No parameter / method call testing...');
+  failed := false;
+ 
+  clear_globals;
+  clear_values;
+ 
+  tnovmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  novmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  tnovmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+ 
+  novmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_call_private_none;
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+  
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+  Write('Simple parameter (LOC_CONSTANT) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  { parameter is LOC_CONSTANT }
+  novmtobject.method_public_u8(RESULT_U8BIT);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+ 
+  Write('Simple parameter (LOC_REFERENCE) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_u8(value_u8bit);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  value_u8bit := RESULT_U8BIT;
+  tnovmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+   
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_call_private_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+ 
+  value_u8bit := RESULT_U8BIT;   
+  novmtobject.method_call_private_static_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+ 
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+ 
+  Write('Simple parameter (LOC_REGISTER) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_u8(getu8);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(getu8);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(getu8);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+ if failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+  Write('Simple parameter / complex return / nested method access testing...');
+  
+  clear_globals; 
+  clear_values;
+  failed := false;
+  novmtobject.object_bigstring := RESULT_BIGSTRING;
+  novmtobject.object_u16bit := RESULT_U16BIT;
+    
+  value_smallarray := novmtobject.func_array_mixed_nested(RESULT_U8BIT);
+  if (value_smallarray[1] <> RESULT_U8BIT) or (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) then
+    failed := true;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  if global_bigstring <> RESULT_BIGSTRING then
+    failed := true;
+  if global_u16bit <> RESULT_U16BIT then
+    failed := true;
+  if global_s32bit <> RESULT_S32BIT then
+    failed := true;
+  if global_s64bit <> RESULT_U8BIT then
+    failed := true;
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+end;
+
+
+procedure testfailedobject;
+var
+  failedobject : tfailvmtobject;
+ begin
+  Write('Testing constructor return value...'); 
+  if failedobject.constructor_public_none then
+    fail
+  else
+    Writeln('Passed!');
+ end;
+ 
+ 
+ procedure testvmtobject;
+  var
+   vmtobject : tvmtobject;
+   failed : boolean;
+  begin
+  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call...');
+    vmtobject.constructor_params_mixed(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed(value_u8bit, value_u16bit, value_bigstring, 
+       value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+  end;
+  
+  
+ procedure testheritedvmtobject;
+  var
+   vmtobject : theritedvmtobject;
+   failed : boolean;
+  begin
+    {********************** CONSTRUCTOR TESTING ************************}  
+    {********************** DESTRUCTOR  TESTING ************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
+    vmtobject.constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, 
+       RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_inherited(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_virtual(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_virtual(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_overriden(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_overriden(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
+    vmtobject.constructor_params_mixed_call_normal(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_normal(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
+    vmtobject.constructor_params_mixed_call_static(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_static(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    {************************* METHOD TESTING **************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call...');
+    vmtobject.method_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
+    vmtobject.method_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { ********************************************************************
+      This calls methods which in turn call other methods, or a constructor 
+      or a destructor.
+      *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
+    vmtobject.method_normal_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
+    vmtobject.method_normal_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static method call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
+    vmtobject.method_normal_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
+    vmtobject.method_normal_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+ { ********************************************************************
+      This calls virtual methods which in turn call other methods, 
+      or a constructor  or a destructor.
+   *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
+    vmtobject.method_virtual_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
+    vmtobject.method_virtual_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static virtual call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
+    vmtobject.method_virtual_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
+    vmtobject.method_virtual_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+
+  end;
+  
+
+begin
+  WriteLN('*********************** NO VMT OBJECT TESTS ********************');
+  testnovmtobject;   
+  WriteLN('************************ VMT OBJECT FAIL  **********************');
+  testfailedobject;
+  WriteLN('************************* VMT OBJECT TESTS *********************');
+  testvmtobject;
+  testheritedvmtobject;
+end.
+
+{
+  $Log$
+  Revision 1.1  2002-05-05 13:58:50  carl
+  + finished procedural variable testsuit
+  + finished method testsuit
+
+}

+ 2129 - 0
tests/test/cg/tcalobj6.pp

@@ -0,0 +1,2129 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{  Copyright (c) 2002 Carl Eric Codere                           }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondtypeconv()                               }
+{                 secondtryexcept()                              }
+{****************************************************************}
+{ DEFINES:                                                       }
+{            FPC     = Target is FreePascal compiler             }
+{****************************************************************}
+{ REMARKS: This tests secondcalln(), genentrycode() and          }
+{ genexitcode() for standard object with the register            }
+{ calling convention.                                            }
+{                                                                }
+{****************************************************************}
+program tcalobj6;
+{$STATIC ON}
+{$R+}
+
+ const
+ { should be defined depending on CPU target }
+ {$ifdef cpu68k}
+   BIG_INDEX = 8000;
+   SMALL_INDEX  = 13;
+ {$endif}
+ {$ifdef cpu86}
+   BIG_INDEX = 33000;
+   SMALL_INDEX = 13;     { value should not be aligned! }
+ {$endif}
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = 2*RESULT_U8BIT;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = $500F0000;
+   RESULT_S32REAL = 1777.12;
+   RESULT_S64REAL = 3444.24;
+   RESULT_BOOL8BIT = 1;
+   RESULT_BOOL16BIT = 1;
+   RESULT_BOOL32BIT = 1;
+   RESULT_PCHAR = 'Hello world';
+   RESULT_BIGSTRING = 'Hello world';
+   RESULT_SMALLSTRING = 'H';
+   RESULT_CHAR = 'I';
+   RESULT_BOOLEAN = TRUE;
+   
+ type
+   
+   tprocedure = procedure;
+   
+   tsmallrecord = packed record
+     b: byte;
+     w: word;
+   end;
+   
+   tlargerecord = packed record
+     b: array[1..BIG_INDEX] of byte;
+   end;
+   
+   tsmallarray = packed array[1..SMALL_INDEX] of byte;
+   
+   tsmallsetenum = 
+   (A_A,A_B,A_C,A_D);
+   
+   tsmallset = set of tsmallsetenum;
+   tlargeset = set of char;
+   
+   tsmallstring = string[2];
+
+
+ var
+  global_u8bit : byte;
+  global_u16bit : word;
+  global_s32bit : longint;
+  global_s32real : single;
+  global_s64real : double;
+  global_ptr : pchar;
+  global_proc : tprocedure;
+  global_bigstring : shortstring;
+  global_boolean : boolean;
+  global_char : char;
+  global_s64bit : int64;
+  value_s64bit : int64;
+  value_ansistring : ansistring;
+  value_u8bit : byte;
+  value_u16bit : word;
+  value_s32bit : longint;
+  value_s32real : single;
+  value_s64real  : double;
+  value_proc : tprocedure;
+  value_ptr : pchar;
+  value_smallrec : tsmallrecord;
+  value_largerec : tlargerecord;
+  value_smallset : tsmallset;
+  value_smallstring : tsmallstring;
+  value_bigstring   : shortstring;
+  value_largeset : tlargeset;
+  value_smallarray : tsmallarray;
+  value_boolean : boolean;
+  value_char : char;
+  
+     procedure fail;
+     begin
+       WriteLn('Failure.');
+       halt(1);
+     end;
+     
+     
+     procedure clear_globals;
+      begin
+       global_u8bit := 0;
+       global_u16bit := 0;
+       global_s32bit := 0;
+       global_s32real := 0.0;
+       global_s64real := 0.0;
+       global_ptr := nil;
+       global_proc := nil;
+       global_bigstring := '';
+       global_boolean := false;
+       global_char := #0;
+       global_s64bit := 0;
+      end;
+      
+      
+     procedure clear_values;
+      begin
+       value_u8bit := 0;
+       value_u16bit := 0;
+       value_s32bit := 0;
+       value_s32real := 0.0;
+       value_s64real  := 0.0;
+       value_proc := nil;
+       value_ptr := nil;
+       fillchar(value_smallrec, sizeof(value_smallrec), #0);
+       fillchar(value_largerec, sizeof(value_largerec), #0);
+       value_smallset := [];
+       value_smallstring := '';
+       value_bigstring   := '';
+       value_largeset := [];
+       fillchar(value_smallarray, sizeof(value_smallarray), #0);
+       value_boolean := false;
+       value_char:=#0;
+       value_ansistring := '';
+       value_s64bit := 0;
+      end;
+      
+      
+      function getu8: byte;
+       begin
+         getu8 := RESULT_U8BIT;
+       end;
+
+
+type
+
+ { object without vmt }
+ pnovmtobject = ^tnovmtobject;
+ tnovmtobject = object
+ public
+   object_bigstring : shortstring;
+   object_u16bit : word;
+   { no parameter testing }
+   procedure method_public_none;register;
+   procedure method_public_static_none; static;register;
+   procedure method_call_private_none;register;
+   procedure method_call_private_static_none; static;register;
+   { simple value parameter testing }
+   procedure method_public_u8(x : byte);register;
+   procedure method_public_static_u8(x: byte); static;register;
+   procedure method_call_private_u8(x: byte);register;
+   procedure method_call_private_static_u8(x: byte); static;register;
+   function  func_array_mixed_nested(b: byte): tsmallarray;register;
+ private
+   procedure method_private_none;register;
+   procedure method_private_static_none; static;register;
+   function func_getu16bit : word;register;
+   { simple value parameter testing }
+   procedure method_private_u8(x: byte);register;
+   procedure method_private_static_u8(x: byte); static;register;
+ end;
+ 
+ 
+ { object with vmt }
+ pvmtobject = ^tvmtobject;
+ tvmtobject = object
+ public
+   object_u8bit : byte;
+   object_u16bit : word;
+   object_bigstring : shortstring;
+   object_s32bit : longint;
+   object_s64bit : int64;
+   constructor constructor_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);register;
+   constructor constructor_init;register;
+   destructor destructor_params_done;register;
+   procedure method_normal_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);register;
+   procedure method_virtual_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);virtual;register;
+   procedure method_virtual_overriden_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);virtual;register;
+   procedure method_static_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);static;register;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+      
+   { virtual methods which call other methods }
+   procedure method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;register;
+   procedure method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;register;
+   procedure method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;register;
+   procedure method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;register;
+   procedure method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;register;
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;register;
+      
+ end;
+ 
+ pheritedvmtobject = ^theritedvmtobject;
+ theritedvmtobject = object(tvmtobject)
+   constructor constructor_params_mixed_call_virtual(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);register;
+   constructor constructor_params_mixed_call_overriden(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);register;
+   constructor constructor_params_mixed_call_static(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);register;
+   constructor constructor_params_mixed_call_normal(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);register;
+   constructor constructor_params_mixed_call_inherited(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);register;
+   procedure method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;register;
+    
+   { normal methods which call other methods }
+   procedure method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   procedure method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   procedure method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   procedure method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   procedure method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+
+   { virtual methods which call other methods }
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;register;
+   
+ end;
+ 
+ pfailvmtobject = ^tfailvmtobject;
+ tfailvmtobject = object(tvmtobject)
+ public
+    constructor constructor_public_none;register;
+ end;
+ 
+ 
+ 
+{**************************************************************************}
+{                             NO VMT OBJECT                                }
+{**************************************************************************}
+ 
+  {****************** NO PARAMETERS ******************}
+ procedure tnovmtobject.method_public_none;register;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+  
+  
+ procedure tnovmtobject.method_public_static_none;register;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+
+
+ procedure tnovmtobject.method_call_private_none;register;
+   begin
+       method_private_none;
+       method_private_static_none;
+   end;
+   
+ procedure tnovmtobject.method_call_private_static_none;register;
+   begin
+     method_private_static_none;
+   end;
+   
+   
+ procedure tnovmtobject.method_private_none;register;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+  
+  
+ procedure tnovmtobject.method_private_static_none;register;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+
+  {******************** PARAMETERS ******************}
+  
+  procedure tnovmtobject.method_public_u8(x : byte);register;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_public_static_u8(x: byte);register;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_call_private_u8(x: byte);register;
+   begin
+     method_private_static_u8(x);
+     method_private_u8(x);
+   end;
+   
+  procedure tnovmtobject. method_call_private_static_u8(x: byte);register;
+   begin
+     method_private_static_u8(x);
+   end;
+
+   procedure tnovmtobject.method_private_u8(x: byte);register;
+    begin
+      Inc(global_u16bit,x);
+    end;
+    
+   procedure tnovmtobject.method_private_static_u8(x: byte);register;
+    begin
+      Inc(global_u16bit,x);
+    end;
+
+
+  function tnovmtobject.func_getu16bit : word;register;
+   begin
+     func_getu16bit := object_u16bit;
+   end;
+
+  { 
+    complex testing, nested field access, with parameters and 
+    comple return value.
+    
+    On exit : global_u8bit := x;
+              global_u16bit := object_u16bit (from func_getu16bit);
+              global_s32bit :=  RESULT_S32BIT
+              global_bigstring := object_bigstring
+              global_s64bit := x;
+  }
+  function tnovmtobject.func_array_mixed_nested(b: byte): tsmallarray;register;
+
+    procedure nested_one_proc(l: longint);
+     begin
+       global_u16bit := func_getu16bit;
+       global_s32bit := l;
+     end;
+     
+    procedure nested_two_proc(l : longint);
+     begin
+       global_s64bit := l;  
+     end;
+
+     
+
+   function nested_one_func(level1_b : byte; s: shortstring): byte;
+     var
+      s1 : shortstring;
+   
+      function nested_two_func(level2_b : byte; s :shortstring): byte;
+        begin
+          nested_two_func:=level2_b;
+          global_bigstring := s;
+          nested_one_proc(RESULT_S32BIT);
+        end;
+       
+    begin
+      s1:=s;
+      nested_one_func := nested_two_func(level1_b,s1);
+      nested_two_proc(level1_b);
+    end;
+    
+    
+ var
+  local_b: byte;
+  smallarray: tsmallarray;
+ begin
+  fillchar(smallarray, sizeof(smallarray), #0);
+  smallarray[1] := RESULT_U8BIT; 
+  smallarray[SMALL_INDEX] := RESULT_U8BIT;
+  func_array_mixed_nested := smallarray;
+  local_b:=b;
+  global_u8bit := nested_one_func(local_b, object_bigstring);
+ end;
+ 
+{**************************************************************************}
+{                             FAILED OBJECT                                }
+{**************************************************************************}
+constructor tfailvmtobject.constructor_public_none;register;
+ begin
+    { this calls the constructor fail special keyword }
+    fail;
+ end;
+ 
+{**************************************************************************}
+{                               VMT  OBJECT                                }
+{**************************************************************************}
+constructor tvmtobject.constructor_params_mixed(u8 :byte; u16: word; 
+   bigstring: shortstring; s32: longint; s64: int64);register;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+ 
+constructor tvmtobject.constructor_init;register;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+destructor tvmtobject.destructor_params_done;register;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+ 
+procedure tvmtobject.method_normal_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+procedure tvmtobject.method_virtual_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+{ this one should be overriden } 
+procedure tvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+ begin
+    RunError(211);
+ end;
+ 
+{ can't access field of instances in static methods } 
+procedure tvmtobject.method_static_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+ begin
+   global_u8bit := u8;
+   global_u16bit := u16;
+   global_bigstring := bigstring;
+   global_s32bit := s32;
+   global_s64bit := s64;
+ end;
+
+procedure tvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+procedure tvmtobject.method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure tvmtobject.method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure tvmtobject.method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure tvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+{**************************************************************************}
+{                          INHERITED VMT OBJECT                            }
+{**************************************************************************}
+constructor theritedvmtobject.constructor_params_mixed_call_virtual(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+
+constructor theritedvmtobject.constructor_params_mixed_call_overriden(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+     
+constructor theritedvmtobject.constructor_params_mixed_call_static(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_static_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_normal(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_inherited
+   (u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   inherited constructor_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+    
+{ this one should be overriden } 
+procedure theritedvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+
+procedure theritedvmtobject.method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure theritedvmtobject.method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure theritedvmtobject.method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure theritedvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+  begin
+   Inherited method_normal_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+procedure theritedvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);register;
+  begin
+   Inherited method_virtual_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+
+procedure testnovmtobject;
+var
+  novmtobject : tnovmtobject;
+  failed : boolean;
+begin
+  {******************** STATIC / METHOD SIMPLE CALL **********************}
+  Write('No parameter / method call testing...');
+  failed := false;
+ 
+  clear_globals;
+  clear_values;
+ 
+  tnovmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  novmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  tnovmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+ 
+  novmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_call_private_none;
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+  
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+  Write('Simple parameter (LOC_CONSTANT) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  { parameter is LOC_CONSTANT }
+  novmtobject.method_public_u8(RESULT_U8BIT);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+ 
+  Write('Simple parameter (LOC_REFERENCE) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_u8(value_u8bit);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  value_u8bit := RESULT_U8BIT;
+  tnovmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+   
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_call_private_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+ 
+  value_u8bit := RESULT_U8BIT;   
+  novmtobject.method_call_private_static_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+ 
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+ 
+  Write('Simple parameter (LOC_REGISTER) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_u8(getu8);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(getu8);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(getu8);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+ if failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+  Write('Simple parameter / complex return / nested method access testing...');
+  
+  clear_globals; 
+  clear_values;
+  failed := false;
+  novmtobject.object_bigstring := RESULT_BIGSTRING;
+  novmtobject.object_u16bit := RESULT_U16BIT;
+    
+  value_smallarray := novmtobject.func_array_mixed_nested(RESULT_U8BIT);
+  if (value_smallarray[1] <> RESULT_U8BIT) or (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) then
+    failed := true;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  if global_bigstring <> RESULT_BIGSTRING then
+    failed := true;
+  if global_u16bit <> RESULT_U16BIT then
+    failed := true;
+  if global_s32bit <> RESULT_S32BIT then
+    failed := true;
+  if global_s64bit <> RESULT_U8BIT then
+    failed := true;
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+end;
+
+
+procedure testfailedobject;
+var
+  failedobject : tfailvmtobject;
+ begin
+  Write('Testing constructor return value...'); 
+  if failedobject.constructor_public_none then
+    fail
+  else
+    Writeln('Passed!');
+ end;
+ 
+ 
+ procedure testvmtobject;
+  var
+   vmtobject : tvmtobject;
+   failed : boolean;
+  begin
+  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call...');
+    vmtobject.constructor_params_mixed(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed(value_u8bit, value_u16bit, value_bigstring, 
+       value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+  end;
+  
+  
+ procedure testheritedvmtobject;
+  var
+   vmtobject : theritedvmtobject;
+   failed : boolean;
+  begin
+    {********************** CONSTRUCTOR TESTING ************************}  
+    {********************** DESTRUCTOR  TESTING ************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
+    vmtobject.constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, 
+       RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_inherited(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_virtual(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_virtual(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_overriden(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_overriden(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
+    vmtobject.constructor_params_mixed_call_normal(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_normal(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
+    vmtobject.constructor_params_mixed_call_static(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_static(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    {************************* METHOD TESTING **************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call...');
+    vmtobject.method_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
+    vmtobject.method_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { ********************************************************************
+      This calls methods which in turn call other methods, or a constructor 
+      or a destructor.
+      *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
+    vmtobject.method_normal_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
+    vmtobject.method_normal_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static method call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
+    vmtobject.method_normal_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
+    vmtobject.method_normal_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+ { ********************************************************************
+      This calls virtual methods which in turn call other methods, 
+      or a constructor  or a destructor.
+   *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
+    vmtobject.method_virtual_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
+    vmtobject.method_virtual_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static virtual call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
+    vmtobject.method_virtual_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
+    vmtobject.method_virtual_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+
+  end;
+  
+
+begin
+  WriteLN('*********************** NO VMT OBJECT TESTS ********************');
+  testnovmtobject;   
+  WriteLN('************************ VMT OBJECT FAIL  **********************');
+  testfailedobject;
+  WriteLN('************************* VMT OBJECT TESTS *********************');
+  testvmtobject;
+  testheritedvmtobject;
+end.
+
+{
+  $Log$
+  Revision 1.1  2002-05-05 13:58:50  carl
+  + finished procedural variable testsuit
+  + finished method testsuit
+
+}

+ 2129 - 0
tests/test/cg/tcalobj7.pp

@@ -0,0 +1,2129 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{  Copyright (c) 2002 Carl Eric Codere                           }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondtypeconv()                               }
+{                 secondtryexcept()                              }
+{****************************************************************}
+{ DEFINES:                                                       }
+{            FPC     = Target is FreePascal compiler             }
+{****************************************************************}
+{ REMARKS: This tests secondcalln(), genentrycode() and          }
+{ genexitcode() for standard object with the stdcall             }
+{ calling convention.                                            }
+{                                                                }
+{****************************************************************}
+program tcalobj7;
+{$STATIC ON}
+{$R+}
+
+ const
+ { should be defined depending on CPU target }
+ {$ifdef cpu68k}
+   BIG_INDEX = 8000;
+   SMALL_INDEX  = 13;
+ {$endif}
+ {$ifdef cpu86}
+   BIG_INDEX = 33000;
+   SMALL_INDEX = 13;     { value should not be aligned! }
+ {$endif}
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = 2*RESULT_U8BIT;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = $500F0000;
+   RESULT_S32REAL = 1777.12;
+   RESULT_S64REAL = 3444.24;
+   RESULT_BOOL8BIT = 1;
+   RESULT_BOOL16BIT = 1;
+   RESULT_BOOL32BIT = 1;
+   RESULT_PCHAR = 'Hello world';
+   RESULT_BIGSTRING = 'Hello world';
+   RESULT_SMALLSTRING = 'H';
+   RESULT_CHAR = 'I';
+   RESULT_BOOLEAN = TRUE;
+   
+ type
+   
+   tprocedure = procedure;
+   
+   tsmallrecord = packed record
+     b: byte;
+     w: word;
+   end;
+   
+   tlargerecord = packed record
+     b: array[1..BIG_INDEX] of byte;
+   end;
+   
+   tsmallarray = packed array[1..SMALL_INDEX] of byte;
+   
+   tsmallsetenum = 
+   (A_A,A_B,A_C,A_D);
+   
+   tsmallset = set of tsmallsetenum;
+   tlargeset = set of char;
+   
+   tsmallstring = string[2];
+
+
+ var
+  global_u8bit : byte;
+  global_u16bit : word;
+  global_s32bit : longint;
+  global_s32real : single;
+  global_s64real : double;
+  global_ptr : pchar;
+  global_proc : tprocedure;
+  global_bigstring : shortstring;
+  global_boolean : boolean;
+  global_char : char;
+  global_s64bit : int64;
+  value_s64bit : int64;
+  value_ansistring : ansistring;
+  value_u8bit : byte;
+  value_u16bit : word;
+  value_s32bit : longint;
+  value_s32real : single;
+  value_s64real  : double;
+  value_proc : tprocedure;
+  value_ptr : pchar;
+  value_smallrec : tsmallrecord;
+  value_largerec : tlargerecord;
+  value_smallset : tsmallset;
+  value_smallstring : tsmallstring;
+  value_bigstring   : shortstring;
+  value_largeset : tlargeset;
+  value_smallarray : tsmallarray;
+  value_boolean : boolean;
+  value_char : char;
+  
+     procedure fail;
+     begin
+       WriteLn('Failure.');
+       halt(1);
+     end;
+     
+     
+     procedure clear_globals;
+      begin
+       global_u8bit := 0;
+       global_u16bit := 0;
+       global_s32bit := 0;
+       global_s32real := 0.0;
+       global_s64real := 0.0;
+       global_ptr := nil;
+       global_proc := nil;
+       global_bigstring := '';
+       global_boolean := false;
+       global_char := #0;
+       global_s64bit := 0;
+      end;
+      
+      
+     procedure clear_values;
+      begin
+       value_u8bit := 0;
+       value_u16bit := 0;
+       value_s32bit := 0;
+       value_s32real := 0.0;
+       value_s64real  := 0.0;
+       value_proc := nil;
+       value_ptr := nil;
+       fillchar(value_smallrec, sizeof(value_smallrec), #0);
+       fillchar(value_largerec, sizeof(value_largerec), #0);
+       value_smallset := [];
+       value_smallstring := '';
+       value_bigstring   := '';
+       value_largeset := [];
+       fillchar(value_smallarray, sizeof(value_smallarray), #0);
+       value_boolean := false;
+       value_char:=#0;
+       value_ansistring := '';
+       value_s64bit := 0;
+      end;
+      
+      
+      function getu8: byte;
+       begin
+         getu8 := RESULT_U8BIT;
+       end;
+
+
+type
+
+ { object without vmt }
+ pnovmtobject = ^tnovmtobject;
+ tnovmtobject = object
+ public
+   object_bigstring : shortstring;
+   object_u16bit : word;
+   { no parameter testing }
+   procedure method_public_none;stdcall;
+   procedure method_public_static_none; static;stdcall;
+   procedure method_call_private_none;stdcall;
+   procedure method_call_private_static_none; static;stdcall;
+   { simple value parameter testing }
+   procedure method_public_u8(x : byte);stdcall;
+   procedure method_public_static_u8(x: byte); static;stdcall;
+   procedure method_call_private_u8(x: byte);stdcall;
+   procedure method_call_private_static_u8(x: byte); static;stdcall;
+   function  func_array_mixed_nested(b: byte): tsmallarray;stdcall;
+ private
+   procedure method_private_none;stdcall;
+   procedure method_private_static_none; static;stdcall;
+   function func_getu16bit : word;stdcall;
+   { simple value parameter testing }
+   procedure method_private_u8(x: byte);stdcall;
+   procedure method_private_static_u8(x: byte); static;stdcall;
+ end;
+ 
+ 
+ { object with vmt }
+ pvmtobject = ^tvmtobject;
+ tvmtobject = object
+ public
+   object_u8bit : byte;
+   object_u16bit : word;
+   object_bigstring : shortstring;
+   object_s32bit : longint;
+   object_s64bit : int64;
+   constructor constructor_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   constructor constructor_init;stdcall;
+   destructor destructor_params_done;stdcall;
+   procedure method_normal_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   procedure method_virtual_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);virtual;stdcall;
+   procedure method_virtual_overriden_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);virtual;stdcall;
+   procedure method_static_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);static;stdcall;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+      
+   { virtual methods which call other methods }
+   procedure method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;stdcall;
+   procedure method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;stdcall;
+   procedure method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;stdcall;
+   procedure method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;stdcall;
+   procedure method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;stdcall;
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;stdcall;
+      
+ end;
+ 
+ pheritedvmtobject = ^theritedvmtobject;
+ theritedvmtobject = object(tvmtobject)
+   constructor constructor_params_mixed_call_virtual(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   constructor constructor_params_mixed_call_overriden(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   constructor constructor_params_mixed_call_static(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   constructor constructor_params_mixed_call_normal(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   constructor constructor_params_mixed_call_inherited(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   procedure method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;stdcall;
+    
+   { normal methods which call other methods }
+   procedure method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   procedure method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   procedure method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   procedure method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   procedure method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+
+   { virtual methods which call other methods }
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;stdcall;
+   
+ end;
+ 
+ pfailvmtobject = ^tfailvmtobject;
+ tfailvmtobject = object(tvmtobject)
+ public
+    constructor constructor_public_none;stdcall;
+ end;
+ 
+ 
+ 
+{**************************************************************************}
+{                             NO VMT OBJECT                                }
+{**************************************************************************}
+ 
+  {****************** NO PARAMETERS ******************}
+ procedure tnovmtobject.method_public_none;stdcall;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+  
+  
+ procedure tnovmtobject.method_public_static_none;stdcall;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+
+
+ procedure tnovmtobject.method_call_private_none;stdcall;
+   begin
+       method_private_none;
+       method_private_static_none;
+   end;
+   
+ procedure tnovmtobject.method_call_private_static_none;stdcall;
+   begin
+     method_private_static_none;
+   end;
+   
+   
+ procedure tnovmtobject.method_private_none;stdcall;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+  
+  
+ procedure tnovmtobject.method_private_static_none;stdcall;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+
+  {******************** PARAMETERS ******************}
+  
+  procedure tnovmtobject.method_public_u8(x : byte);stdcall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_public_static_u8(x: byte);stdcall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_call_private_u8(x: byte);stdcall;
+   begin
+     method_private_static_u8(x);
+     method_private_u8(x);
+   end;
+   
+  procedure tnovmtobject. method_call_private_static_u8(x: byte);stdcall;
+   begin
+     method_private_static_u8(x);
+   end;
+
+   procedure tnovmtobject.method_private_u8(x: byte);stdcall;
+    begin
+      Inc(global_u16bit,x);
+    end;
+    
+   procedure tnovmtobject.method_private_static_u8(x: byte);stdcall;
+    begin
+      Inc(global_u16bit,x);
+    end;
+
+
+  function tnovmtobject.func_getu16bit : word;stdcall;
+   begin
+     func_getu16bit := object_u16bit;
+   end;
+
+  { 
+    complex testing, nested field access, with parameters and 
+    comple return value.
+    
+    On exit : global_u8bit := x;
+              global_u16bit := object_u16bit (from func_getu16bit);
+              global_s32bit :=  RESULT_S32BIT
+              global_bigstring := object_bigstring
+              global_s64bit := x;
+  }
+  function tnovmtobject.func_array_mixed_nested(b: byte): tsmallarray;stdcall;
+
+    procedure nested_one_proc(l: longint);
+     begin
+       global_u16bit := func_getu16bit;
+       global_s32bit := l;
+     end;
+     
+    procedure nested_two_proc(l : longint);
+     begin
+       global_s64bit := l;  
+     end;
+
+     
+
+   function nested_one_func(level1_b : byte; s: shortstring): byte;
+     var
+      s1 : shortstring;
+   
+      function nested_two_func(level2_b : byte; s :shortstring): byte;
+        begin
+          nested_two_func:=level2_b;
+          global_bigstring := s;
+          nested_one_proc(RESULT_S32BIT);
+        end;
+       
+    begin
+      s1:=s;
+      nested_one_func := nested_two_func(level1_b,s1);
+      nested_two_proc(level1_b);
+    end;
+    
+    
+ var
+  local_b: byte;
+  smallarray: tsmallarray;
+ begin
+  fillchar(smallarray, sizeof(smallarray), #0);
+  smallarray[1] := RESULT_U8BIT; 
+  smallarray[SMALL_INDEX] := RESULT_U8BIT;
+  func_array_mixed_nested := smallarray;
+  local_b:=b;
+  global_u8bit := nested_one_func(local_b, object_bigstring);
+ end;
+ 
+{**************************************************************************}
+{                             FAILED OBJECT                                }
+{**************************************************************************}
+constructor tfailvmtobject.constructor_public_none;stdcall;
+ begin
+    { this calls the constructor fail special keyword }
+    fail;
+ end;
+ 
+{**************************************************************************}
+{                               VMT  OBJECT                                }
+{**************************************************************************}
+constructor tvmtobject.constructor_params_mixed(u8 :byte; u16: word; 
+   bigstring: shortstring; s32: longint; s64: int64);stdcall;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+ 
+constructor tvmtobject.constructor_init;stdcall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+destructor tvmtobject.destructor_params_done;stdcall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+ 
+procedure tvmtobject.method_normal_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+procedure tvmtobject.method_virtual_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+{ this one should be overriden } 
+procedure tvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+ begin
+    RunError(211);
+ end;
+ 
+{ can't access field of instances in static methods } 
+procedure tvmtobject.method_static_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+ begin
+   global_u8bit := u8;
+   global_u16bit := u16;
+   global_bigstring := bigstring;
+   global_s32bit := s32;
+   global_s64bit := s64;
+ end;
+
+procedure tvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+procedure tvmtobject.method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure tvmtobject.method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure tvmtobject.method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure tvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+{**************************************************************************}
+{                          INHERITED VMT OBJECT                            }
+{**************************************************************************}
+constructor theritedvmtobject.constructor_params_mixed_call_virtual(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+
+constructor theritedvmtobject.constructor_params_mixed_call_overriden(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+     
+constructor theritedvmtobject.constructor_params_mixed_call_static(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_static_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_normal(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_inherited
+   (u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   inherited constructor_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+    
+{ this one should be overriden } 
+procedure theritedvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+
+procedure theritedvmtobject.method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure theritedvmtobject.method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure theritedvmtobject.method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure theritedvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+  begin
+   Inherited method_normal_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+procedure theritedvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);stdcall;
+  begin
+   Inherited method_virtual_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+
+procedure testnovmtobject;
+var
+  novmtobject : tnovmtobject;
+  failed : boolean;
+begin
+  {******************** STATIC / METHOD SIMPLE CALL **********************}
+  Write('No parameter / method call testing...');
+  failed := false;
+ 
+  clear_globals;
+  clear_values;
+ 
+  tnovmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  novmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  tnovmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+ 
+  novmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_call_private_none;
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+  
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+  Write('Simple parameter (LOC_CONSTANT) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  { parameter is LOC_CONSTANT }
+  novmtobject.method_public_u8(RESULT_U8BIT);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+ 
+  Write('Simple parameter (LOC_REFERENCE) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_u8(value_u8bit);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  value_u8bit := RESULT_U8BIT;
+  tnovmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+   
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_call_private_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+ 
+  value_u8bit := RESULT_U8BIT;   
+  novmtobject.method_call_private_static_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+ 
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+ 
+  Write('Simple parameter (LOC_REGISTER) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_u8(getu8);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(getu8);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(getu8);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+ if failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+  Write('Simple parameter / complex return / nested method access testing...');
+  
+  clear_globals; 
+  clear_values;
+  failed := false;
+  novmtobject.object_bigstring := RESULT_BIGSTRING;
+  novmtobject.object_u16bit := RESULT_U16BIT;
+    
+  value_smallarray := novmtobject.func_array_mixed_nested(RESULT_U8BIT);
+  if (value_smallarray[1] <> RESULT_U8BIT) or (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) then
+    failed := true;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  if global_bigstring <> RESULT_BIGSTRING then
+    failed := true;
+  if global_u16bit <> RESULT_U16BIT then
+    failed := true;
+  if global_s32bit <> RESULT_S32BIT then
+    failed := true;
+  if global_s64bit <> RESULT_U8BIT then
+    failed := true;
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+end;
+
+
+procedure testfailedobject;
+var
+  failedobject : tfailvmtobject;
+ begin
+  Write('Testing constructor return value...'); 
+  if failedobject.constructor_public_none then
+    fail
+  else
+    Writeln('Passed!');
+ end;
+ 
+ 
+ procedure testvmtobject;
+  var
+   vmtobject : tvmtobject;
+   failed : boolean;
+  begin
+  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call...');
+    vmtobject.constructor_params_mixed(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed(value_u8bit, value_u16bit, value_bigstring, 
+       value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+  end;
+  
+  
+ procedure testheritedvmtobject;
+  var
+   vmtobject : theritedvmtobject;
+   failed : boolean;
+  begin
+    {********************** CONSTRUCTOR TESTING ************************}  
+    {********************** DESTRUCTOR  TESTING ************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
+    vmtobject.constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, 
+       RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_inherited(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_virtual(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_virtual(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_overriden(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_overriden(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
+    vmtobject.constructor_params_mixed_call_normal(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_normal(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
+    vmtobject.constructor_params_mixed_call_static(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_static(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    {************************* METHOD TESTING **************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call...');
+    vmtobject.method_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
+    vmtobject.method_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { ********************************************************************
+      This calls methods which in turn call other methods, or a constructor 
+      or a destructor.
+      *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
+    vmtobject.method_normal_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
+    vmtobject.method_normal_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static method call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
+    vmtobject.method_normal_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
+    vmtobject.method_normal_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+ { ********************************************************************
+      This calls virtual methods which in turn call other methods, 
+      or a constructor  or a destructor.
+   *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
+    vmtobject.method_virtual_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
+    vmtobject.method_virtual_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static virtual call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
+    vmtobject.method_virtual_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
+    vmtobject.method_virtual_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+
+  end;
+  
+
+begin
+  WriteLN('*********************** NO VMT OBJECT TESTS ********************');
+  testnovmtobject;   
+  WriteLN('************************ VMT OBJECT FAIL  **********************');
+  testfailedobject;
+  WriteLN('************************* VMT OBJECT TESTS *********************');
+  testvmtobject;
+  testheritedvmtobject;
+end.
+
+{
+  $Log$
+  Revision 1.1  2002-05-05 13:58:50  carl
+  + finished procedural variable testsuit
+  + finished method testsuit
+
+}

+ 2129 - 0
tests/test/cg/tcalobj8.pp

@@ -0,0 +1,2129 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{  Copyright (c) 2002 Carl Eric Codere                           }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondtypeconv()                               }
+{                 secondtryexcept()                              }
+{****************************************************************}
+{ DEFINES:                                                       }
+{            FPC     = Target is FreePascal compiler             }
+{****************************************************************}
+{ REMARKS: This tests secondcalln(), genentrycode() and          }
+{ genexitcode() for standard object with the saveregisters       }
+{ calling convention.                                            }
+{                                                                }
+{****************************************************************}
+program tcalobj8;
+{$STATIC ON}
+{$R+}
+
+ const
+ { should be defined depending on CPU target }
+ {$ifdef cpu68k}
+   BIG_INDEX = 8000;
+   SMALL_INDEX  = 13;
+ {$endif}
+ {$ifdef cpu86}
+   BIG_INDEX = 33000;
+   SMALL_INDEX = 13;     { value should not be aligned! }
+ {$endif}
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = 2*RESULT_U8BIT;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = $500F0000;
+   RESULT_S32REAL = 1777.12;
+   RESULT_S64REAL = 3444.24;
+   RESULT_BOOL8BIT = 1;
+   RESULT_BOOL16BIT = 1;
+   RESULT_BOOL32BIT = 1;
+   RESULT_PCHAR = 'Hello world';
+   RESULT_BIGSTRING = 'Hello world';
+   RESULT_SMALLSTRING = 'H';
+   RESULT_CHAR = 'I';
+   RESULT_BOOLEAN = TRUE;
+   
+ type
+   
+   tprocedure = procedure;
+   
+   tsmallrecord = packed record
+     b: byte;
+     w: word;
+   end;
+   
+   tlargerecord = packed record
+     b: array[1..BIG_INDEX] of byte;
+   end;
+   
+   tsmallarray = packed array[1..SMALL_INDEX] of byte;
+   
+   tsmallsetenum = 
+   (A_A,A_B,A_C,A_D);
+   
+   tsmallset = set of tsmallsetenum;
+   tlargeset = set of char;
+   
+   tsmallstring = string[2];
+
+
+ var
+  global_u8bit : byte;
+  global_u16bit : word;
+  global_s32bit : longint;
+  global_s32real : single;
+  global_s64real : double;
+  global_ptr : pchar;
+  global_proc : tprocedure;
+  global_bigstring : shortstring;
+  global_boolean : boolean;
+  global_char : char;
+  global_s64bit : int64;
+  value_s64bit : int64;
+  value_ansistring : ansistring;
+  value_u8bit : byte;
+  value_u16bit : word;
+  value_s32bit : longint;
+  value_s32real : single;
+  value_s64real  : double;
+  value_proc : tprocedure;
+  value_ptr : pchar;
+  value_smallrec : tsmallrecord;
+  value_largerec : tlargerecord;
+  value_smallset : tsmallset;
+  value_smallstring : tsmallstring;
+  value_bigstring   : shortstring;
+  value_largeset : tlargeset;
+  value_smallarray : tsmallarray;
+  value_boolean : boolean;
+  value_char : char;
+  
+     procedure fail;
+     begin
+       WriteLn('Failure.');
+       halt(1);
+     end;
+     
+     
+     procedure clear_globals;
+      begin
+       global_u8bit := 0;
+       global_u16bit := 0;
+       global_s32bit := 0;
+       global_s32real := 0.0;
+       global_s64real := 0.0;
+       global_ptr := nil;
+       global_proc := nil;
+       global_bigstring := '';
+       global_boolean := false;
+       global_char := #0;
+       global_s64bit := 0;
+      end;
+      
+      
+     procedure clear_values;
+      begin
+       value_u8bit := 0;
+       value_u16bit := 0;
+       value_s32bit := 0;
+       value_s32real := 0.0;
+       value_s64real  := 0.0;
+       value_proc := nil;
+       value_ptr := nil;
+       fillchar(value_smallrec, sizeof(value_smallrec), #0);
+       fillchar(value_largerec, sizeof(value_largerec), #0);
+       value_smallset := [];
+       value_smallstring := '';
+       value_bigstring   := '';
+       value_largeset := [];
+       fillchar(value_smallarray, sizeof(value_smallarray), #0);
+       value_boolean := false;
+       value_char:=#0;
+       value_ansistring := '';
+       value_s64bit := 0;
+      end;
+      
+      
+      function getu8: byte;
+       begin
+         getu8 := RESULT_U8BIT;
+       end;
+
+
+type
+
+ { object without vmt }
+ pnovmtobject = ^tnovmtobject;
+ tnovmtobject = object
+ public
+   object_bigstring : shortstring;
+   object_u16bit : word;
+   { no parameter testing }
+   procedure method_public_none;saveregisters;
+   procedure method_public_static_none; static;saveregisters;
+   procedure method_call_private_none;saveregisters;
+   procedure method_call_private_static_none; static;saveregisters;
+   { simple value parameter testing }
+   procedure method_public_u8(x : byte);saveregisters;
+   procedure method_public_static_u8(x: byte); static;saveregisters;
+   procedure method_call_private_u8(x: byte);saveregisters;
+   procedure method_call_private_static_u8(x: byte); static;saveregisters;
+   function  func_array_mixed_nested(b: byte): tsmallarray;saveregisters;
+ private
+   procedure method_private_none;saveregisters;
+   procedure method_private_static_none; static;saveregisters;
+   function func_getu16bit : word;saveregisters;
+   { simple value parameter testing }
+   procedure method_private_u8(x: byte);saveregisters;
+   procedure method_private_static_u8(x: byte); static;saveregisters;
+ end;
+ 
+ 
+ { object with vmt }
+ pvmtobject = ^tvmtobject;
+ tvmtobject = object
+ public
+   object_u8bit : byte;
+   object_u16bit : word;
+   object_bigstring : shortstring;
+   object_s32bit : longint;
+   object_s64bit : int64;
+   constructor constructor_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   constructor constructor_init;saveregisters;
+   destructor destructor_params_done;saveregisters;
+   procedure method_normal_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   procedure method_virtual_params_mixed(u8 :byte; u16: word;
+      bigstring: shortstring; s32: longint; s64: int64);virtual;saveregisters;
+   procedure method_virtual_overriden_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);virtual;saveregisters;
+   procedure method_static_params_mixed(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);static;saveregisters;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+      
+   { virtual methods which call other methods }
+   procedure method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;saveregisters;
+   procedure method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;saveregisters;
+   procedure method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;saveregisters;
+   procedure method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;saveregisters;
+   procedure method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;saveregisters;
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;saveregisters;
+      
+ end;
+ 
+ pheritedvmtobject = ^theritedvmtobject;
+ theritedvmtobject = object(tvmtobject)
+   constructor constructor_params_mixed_call_virtual(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   constructor constructor_params_mixed_call_overriden(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   constructor constructor_params_mixed_call_static(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   constructor constructor_params_mixed_call_normal(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   constructor constructor_params_mixed_call_inherited(u8 :byte; u16: word; 
+      bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   procedure method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;saveregisters;
+    
+   { normal methods which call other methods }
+   procedure method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   procedure method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   procedure method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   procedure method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   procedure method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   procedure method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+
+   { virtual methods which call other methods }
+   procedure method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);virtual;saveregisters;
+   
+ end;
+ 
+ pfailvmtobject = ^tfailvmtobject;
+ tfailvmtobject = object(tvmtobject)
+ public
+    constructor constructor_public_none;saveregisters;
+ end;
+ 
+ 
+ 
+{**************************************************************************}
+{                             NO VMT OBJECT                                }
+{**************************************************************************}
+ 
+  {****************** NO PARAMETERS ******************}
+ procedure tnovmtobject.method_public_none;saveregisters;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+  
+  
+ procedure tnovmtobject.method_public_static_none;saveregisters;
+  begin
+    global_u8bit := RESULT_U8BIT;
+  end;
+
+
+ procedure tnovmtobject.method_call_private_none;saveregisters;
+   begin
+       method_private_none;
+       method_private_static_none;
+   end;
+   
+ procedure tnovmtobject.method_call_private_static_none;saveregisters;
+   begin
+     method_private_static_none;
+   end;
+   
+   
+ procedure tnovmtobject.method_private_none;saveregisters;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+  
+  
+ procedure tnovmtobject.method_private_static_none;saveregisters;
+  begin
+    Inc(global_u16bit, RESULT_U8BIT);
+  end;
+
+  {******************** PARAMETERS ******************}
+  
+  procedure tnovmtobject.method_public_u8(x : byte);saveregisters;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_public_static_u8(x: byte);saveregisters;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tnovmtobject.method_call_private_u8(x: byte);saveregisters;
+   begin
+     method_private_static_u8(x);
+     method_private_u8(x);
+   end;
+   
+  procedure tnovmtobject. method_call_private_static_u8(x: byte);saveregisters;
+   begin
+     method_private_static_u8(x);
+   end;
+
+   procedure tnovmtobject.method_private_u8(x: byte);saveregisters;
+    begin
+      Inc(global_u16bit,x);
+    end;
+    
+   procedure tnovmtobject.method_private_static_u8(x: byte);saveregisters;
+    begin
+      Inc(global_u16bit,x);
+    end;
+
+
+  function tnovmtobject.func_getu16bit : word;saveregisters;
+   begin
+     func_getu16bit := object_u16bit;
+   end;
+
+  { 
+    complex testing, nested field access, with parameters and 
+    comple return value.
+    
+    On exit : global_u8bit := x;
+              global_u16bit := object_u16bit (from func_getu16bit);
+              global_s32bit :=  RESULT_S32BIT
+              global_bigstring := object_bigstring
+              global_s64bit := x;
+  }
+  function tnovmtobject.func_array_mixed_nested(b: byte): tsmallarray;saveregisters;
+
+    procedure nested_one_proc(l: longint);
+     begin
+       global_u16bit := func_getu16bit;
+       global_s32bit := l;
+     end;
+     
+    procedure nested_two_proc(l : longint);
+     begin
+       global_s64bit := l;  
+     end;
+
+     
+
+   function nested_one_func(level1_b : byte; s: shortstring): byte;
+     var
+      s1 : shortstring;
+   
+      function nested_two_func(level2_b : byte; s :shortstring): byte;
+        begin
+          nested_two_func:=level2_b;
+          global_bigstring := s;
+          nested_one_proc(RESULT_S32BIT);
+        end;
+       
+    begin
+      s1:=s;
+      nested_one_func := nested_two_func(level1_b,s1);
+      nested_two_proc(level1_b);
+    end;
+    
+    
+ var
+  local_b: byte;
+  smallarray: tsmallarray;
+ begin
+  fillchar(smallarray, sizeof(smallarray), #0);
+  smallarray[1] := RESULT_U8BIT; 
+  smallarray[SMALL_INDEX] := RESULT_U8BIT;
+  func_array_mixed_nested := smallarray;
+  local_b:=b;
+  global_u8bit := nested_one_func(local_b, object_bigstring);
+ end;
+ 
+{**************************************************************************}
+{                             FAILED OBJECT                                }
+{**************************************************************************}
+constructor tfailvmtobject.constructor_public_none;saveregisters;
+ begin
+    { this calls the constructor fail special keyword }
+    fail;
+ end;
+ 
+{**************************************************************************}
+{                               VMT  OBJECT                                }
+{**************************************************************************}
+constructor tvmtobject.constructor_params_mixed(u8 :byte; u16: word; 
+   bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+ 
+constructor tvmtobject.constructor_init;saveregisters;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+destructor tvmtobject.destructor_params_done;saveregisters;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+ end;
+ 
+ 
+procedure tvmtobject.method_normal_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+procedure tvmtobject.method_virtual_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+ 
+{ this one should be overriden } 
+procedure tvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+ begin
+    RunError(211);
+ end;
+ 
+{ can't access field of instances in static methods } 
+procedure tvmtobject.method_static_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+ begin
+   global_u8bit := u8;
+   global_u16bit := u16;
+   global_bigstring := bigstring;
+   global_s32bit := s32;
+   global_s64bit := s64;
+ end;
+
+procedure tvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+procedure tvmtobject.method_virtual_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure tvmtobject.method_virtual_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure tvmtobject.method_virtual_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure tvmtobject.method_virtual_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure tvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+  begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+  end;
+ 
+
+{**************************************************************************}
+{                          INHERITED VMT OBJECT                            }
+{**************************************************************************}
+constructor theritedvmtobject.constructor_params_mixed_call_virtual(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+
+constructor theritedvmtobject.constructor_params_mixed_call_overriden(
+   u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+     
+constructor theritedvmtobject.constructor_params_mixed_call_static(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_static_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_normal(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+ 
+constructor theritedvmtobject.constructor_params_mixed_call_inherited
+   (u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+ begin
+   object_u8bit := 0;
+   object_u16bit := 0;
+   object_bigstring := '';
+   object_s32bit := 0;
+   object_s64bit := 0;
+   inherited constructor_params_mixed(u8, u16, bigstring, s32, s64);
+ end;
+    
+{ this one should be overriden } 
+procedure theritedvmtobject.method_virtual_overriden_params_mixed(
+    u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+ begin
+   object_u8bit := u8;
+   object_u16bit := u16;
+   object_bigstring := bigstring;
+   object_s32bit := s32;
+   object_s64bit := s64;
+ end;
+
+procedure theritedvmtobject.method_normal_call_static_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+  begin
+    method_static_params_mixed(u8, u16, bigstring, s32, s64);
+  end;
+  
+procedure theritedvmtobject.method_normal_call_virtual_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   begin
+    method_virtual_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_overriden_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   begin
+    method_virtual_overriden_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+   
+procedure theritedvmtobject.method_normal_call_normal_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   begin
+    method_normal_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+   
+procedure theritedvmtobject.method_normal_call_constructor_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+   begin
+     constructor_params_mixed(u8, u16, bigstring, s32, s64);
+   end;
+
+procedure theritedvmtobject.method_normal_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+  begin
+   Inherited method_normal_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+procedure theritedvmtobject.method_virtual_call_inherited_params_mixed(
+      u8 :byte; u16: word; bigstring: shortstring; s32: longint; s64: int64);saveregisters;
+  begin
+   Inherited method_virtual_call_inherited_params_mixed(u8, u16, bigstring,
+     s32, s64);
+  end;
+
+
+procedure testnovmtobject;
+var
+  novmtobject : tnovmtobject;
+  failed : boolean;
+begin
+  {******************** STATIC / METHOD SIMPLE CALL **********************}
+  Write('No parameter / method call testing...');
+  failed := false;
+ 
+  clear_globals;
+  clear_values;
+ 
+  tnovmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  novmtobject.method_public_static_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  tnovmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+ 
+  novmtobject.method_call_private_static_none;
+  if global_u16bit <> RESULT_U8BIT then
+    failed := true;
+   
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_none;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_call_private_none;
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+  
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+  Write('Simple parameter (LOC_CONSTANT) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  { parameter is LOC_CONSTANT }
+  novmtobject.method_public_u8(RESULT_U8BIT);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(RESULT_U8BIT); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(RESULT_U8BIT);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+    
+ 
+  Write('Simple parameter (LOC_REFERENCE) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_u8(value_u8bit);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  value_u8bit := RESULT_U8BIT;
+  tnovmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_public_static_u8(value_u8bit); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+   
+  value_u8bit := RESULT_U8BIT;
+  novmtobject.method_call_private_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+ 
+  value_u8bit := RESULT_U8BIT;   
+  novmtobject.method_call_private_static_u8(value_u8bit);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+ 
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+ 
+  Write('Simple parameter (LOC_REGISTER) / method call testing...');
+  failed := false;
+  
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_u8(getu8);
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  tnovmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+  
+  novmtobject.method_public_static_u8(getu8); 
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+ 
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_u8(getu8);
+  if global_u16bit <> (RESULT_U16BIT) then
+    failed := true;
+    
+  clear_globals;
+  clear_values;
+    
+  novmtobject.method_call_private_static_u8(getu8);
+  if global_u16bit <> (RESULT_U8BIT) then
+    failed := true;
+    
+ if failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+  Write('Simple parameter / complex return / nested method access testing...');
+  
+  clear_globals; 
+  clear_values;
+  failed := false;
+  novmtobject.object_bigstring := RESULT_BIGSTRING;
+  novmtobject.object_u16bit := RESULT_U16BIT;
+    
+  value_smallarray := novmtobject.func_array_mixed_nested(RESULT_U8BIT);
+  if (value_smallarray[1] <> RESULT_U8BIT) or (value_smallarray[SMALL_INDEX] <> RESULT_U8BIT) then
+    failed := true;
+  if global_u8bit <> RESULT_U8BIT then
+    failed := true;
+  if global_bigstring <> RESULT_BIGSTRING then
+    failed := true;
+  if global_u16bit <> RESULT_U16BIT then
+    failed := true;
+  if global_s32bit <> RESULT_S32BIT then
+    failed := true;
+  if global_s64bit <> RESULT_U8BIT then
+    failed := true;
+    
+  if failed then
+    fail
+  else
+    WriteLn('Passed!');
+end;
+
+
+procedure testfailedobject;
+var
+  failedobject : tfailvmtobject;
+ begin
+  Write('Testing constructor return value...'); 
+  if failedobject.constructor_public_none then
+    fail
+  else
+    Writeln('Passed!');
+ end;
+ 
+ 
+ procedure testvmtobject;
+  var
+   vmtobject : tvmtobject;
+   failed : boolean;
+  begin
+  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call...');
+    vmtobject.constructor_params_mixed(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed(value_u8bit, value_u16bit, value_bigstring, 
+       value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+  end;
+  
+  
+ procedure testheritedvmtobject;
+  var
+   vmtobject : theritedvmtobject;
+   failed : boolean;
+  begin
+    {********************** CONSTRUCTOR TESTING ************************}  
+    {********************** DESTRUCTOR  TESTING ************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) inherited constructor call...');
+    vmtobject.constructor_params_mixed_call_inherited(RESULT_U8BIT, RESULT_U16BIT, RESULT_BIGSTRING, 
+       RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) inherited constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_inherited(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_virtual(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_virtual(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/virtual call...');
+    vmtobject.constructor_params_mixed_call_overriden(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_overriden(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/method call...');
+    vmtobject.constructor_params_mixed_call_normal(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_normal(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    Write('Testing mixed parameter (LOC_CONSTANT) constructor call w/static call...');
+    vmtobject.constructor_params_mixed_call_static(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    Write('Testing mixed parameter (LOC_REFERENCE) constructor call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.constructor_params_mixed_call_static(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    {************************* METHOD TESTING **************************}  
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual method call...');
+    vmtobject.method_virtual_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call...');
+    vmtobject.method_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) static method call...');
+    vmtobject.method_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) static method call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { ********************************************************************
+      This calls methods which in turn call other methods, or a constructor 
+      or a destructor.
+      *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/virtual call...');
+    vmtobject.method_normal_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/normal call...');
+    vmtobject.method_normal_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/constructor call...');
+    vmtobject.method_normal_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static method call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/static call...');
+    vmtobject.method_normal_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) method call w/inherited call...');
+    vmtobject.method_normal_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) method call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_normal_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+ { ********************************************************************
+      This calls virtual methods which in turn call other methods, 
+      or a constructor  or a destructor.
+   *********************************************************************
+    }
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_virtual_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_virtual_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    { The virtual method has been overriden by the object in this case }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/virtual call...');
+    vmtobject.method_virtual_call_overriden_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/virtual call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_overriden_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/normal call...');
+    vmtobject.method_virtual_call_normal_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/normal call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_normal_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* constructor call inside a normal method *)
+
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/constructor call...');
+    vmtobject.method_virtual_call_constructor_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/constructor call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_constructor_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    { static virtual call }
+    clear_globals;
+    clear_values;
+    failed := false;
+
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/static call...');
+    vmtobject.method_virtual_call_static_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+    
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/static call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_static_params_mixed(value_u8bit, 
+      value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if global_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if global_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if global_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if global_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if global_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+      
+    (* calls the inherited method *)
+    clear_globals;
+    clear_values;
+    failed := false;
+    { Calls the ancestor virtual method }
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_CONSTANT) virtual call w/inherited call...');
+    vmtobject.method_virtual_call_inherited_params_mixed(RESULT_U8BIT, 
+       RESULT_U16BIT, RESULT_BIGSTRING, RESULT_S32BIT, RESULT_S64BIT);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+    clear_globals;
+    clear_values;
+    failed := false;
+    
+    vmtobject.constructor_init;
+    Write('Testing mixed parameter (LOC_REFERENCE) virtual call w/inherited call...');
+    value_u8bit := RESULT_U8BIT;
+    value_u16bit := RESULT_U16BIT;
+    value_bigstring := RESULT_BIGSTRING;
+    value_s32bit := RESULT_S32BIT;
+    value_s64bit := RESULT_S64BIT;
+    vmtobject.method_virtual_call_inherited_params_mixed(value_u8bit, 
+       value_u16bit, value_bigstring, value_s32bit, value_s64bit);
+    if vmtobject.object_u8bit <> RESULT_U8BIT then
+      failed := true;
+    if vmtobject.object_u16bit <> RESULT_U16BIT then
+      failed := true;
+    if vmtobject.object_s32bit <> RESULT_S32BIT then
+      failed := true;
+    if vmtobject.object_s64bit <> RESULT_S64BIT then
+      failed := true;
+    if vmtobject.object_bigstring <> RESULT_BIGSTRING then
+      failed := true;
+    vmtobject.destructor_params_done;
+    
+    if failed then
+      fail
+    else
+      Writeln('Passed!');
+
+
+  end;
+  
+
+begin
+  WriteLN('*********************** NO VMT OBJECT TESTS ********************');
+  testnovmtobject;   
+  WriteLN('************************ VMT OBJECT FAIL  **********************');
+  testfailedobject;
+  WriteLN('************************* VMT OBJECT TESTS *********************');
+  testvmtobject;
+  testheritedvmtobject;
+end.
+
+{
+  $Log$
+  Revision 1.1  2002-05-05 13:58:50  carl
+  + finished procedural variable testsuit
+  + finished method testsuit
+
+}

+ 608 - 0
tests/test/cg/tcalpvr2.pp

@@ -0,0 +1,608 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondcalln()                                  }
+{                 secondadd()                                    }
+{                 secondtypeconv()                               }
+{****************************************************************}
+{ DEFINES:                                                       }
+{****************************************************************}
+{ REMARKS: This tests a subset of the secondcalln() , it         }
+{          verifies procedural variables for pascal              }
+{          calling conventions.                                  }
+{****************************************************************}
+program tcalpvr2;
+{$MODE OBJFPC}
+{$STATIC ON}
+{$R+}
+
+const
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = $500F;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = -12000;
+
+type
+
+  troutine = procedure (x: longint;  y: byte);pascal;
+  troutineresult = function (x: longint; y: byte): int64;pascal;
+
+  tsimpleobject = object
+    constructor init;pascal;
+    procedure test_normal(x: byte);pascal;
+    procedure test_static(x: byte);static;pascal;
+    procedure test_virtual(x: byte);virtual;pascal;
+  end;  
+  
+  tsimpleclass = class
+    constructor create;pascal;
+    procedure test_normal(x: byte);pascal;
+    class procedure test_static(x: byte);pascal;
+    procedure test_virtual(x: byte);virtual;pascal;
+    procedure test_normal_self(self : tsimpleclass; x: byte); message 0;pascal;
+    class procedure test_static_self(self : tsimpleclass; x: byte); message 1;pascal;
+    procedure test_virtual_self(self : tsimpleclass; x: byte);virtual;message 2;pascal;
+  end;    
+
+  tobjectmethod = procedure (x: byte) of object ;pascal;
+  tclassmethod = procedure (x: byte) of object;pascal;
+  { used for testing pocontainsself explicit parameter }
+  tclassmethodself = procedure (self : tsimpleclass; x: byte) of object;pascal;
+  
+var
+  proc : troutine;
+  func : troutineresult;
+  obj_method : tobjectmethod;
+  cla_method : tclassmethod;
+  cla_method_self : tclassmethodself;
+  global_s32bit : longint;
+  global_s64bit : int64;
+  global_u8bit : byte;
+  value_s32bit : longint;
+  value_u8bit : byte;
+  obj : tsimpleobject;
+  cla : tsimpleclass;
+  
+    
+  
+
+  procedure fail;
+   begin
+     WriteLn('Failed!');
+     halt(1);
+   end;
+  
+  procedure clear_globals;
+   begin
+     global_s32bit := 0;
+     global_u8bit := 0;
+     global_s64bit := 0;
+   end;
+   
+  procedure clear_values;
+    begin
+      value_s32bit := 0;
+      value_u8bit := 0;
+    end;
+
+
+  procedure testroutine(x: longint; y: byte);pascal;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+   end;
+   
+  function testroutineresult(x: longint; y: byte): int64;pascal;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+     testroutineresult := RESULT_S64BIT;
+   end;
+
+
+  function getroutine: troutine;
+    begin
+      getroutine:=proc;
+    end;
+    
+  function getroutineresult : troutineresult;
+   begin
+     getroutineresult := func;
+   end;
+   
+{ IMPOSSIBLE TO DO CURRENTLY !    
+  function get_object_method_static : tnormalmethod;
+   begin
+     get_object_method_static := @obj.test_static;
+   end;
+}   
+
+  { objects access }
+  function get_object_method_normal : tobjectmethod;
+   begin
+     get_object_method_normal := @obj.test_normal;
+   end;
+
+  function get_object_type_method_virtual : tobjectmethod;
+   begin
+     get_object_type_method_virtual := @tsimpleobject.test_virtual;
+   end;
+
+  function get_object_method_virtual : tobjectmethod;
+   begin
+     get_object_method_virtual := @obj.test_virtual;
+   end;
+
+  { class access }
+  function get_class_method_normal_self : tclassmethodself;
+   begin
+     get_class_method_normal_self := @tsimpleclass.test_normal_self;
+   end;
+
+{
+  HOW CAN WE GET THIS ADDRESS??? 
+  function get_class_method_static_self : tclassmethodself;
+   begin
+     get_class_method_static_self := @cla.test_static_self;
+   end;
+}   
+
+  function get_class_method_virtual_self : tclassmethodself;
+   begin
+     get_class_method_virtual_self := @tsimpleclass.test_virtual_self;
+   end;
+   
+
+  function get_class_method_normal : tclassmethod;
+   begin
+     get_class_method_normal := @tsimpleclass.test_normal;
+   end;
+{
+  function get_class_method_static : tclassmethod;
+   begin
+     get_class_method_static := @tsimpleclass.test_static;
+   end;}
+
+  function get_class_method_virtual : tclassmethod;
+   begin
+     get_class_method_virtual := @tsimpleclass.test_virtual;
+   end;
+   
+ {****************************************************************************************************}  
+
+  constructor tsimpleobject.init;pascal;
+   begin
+   end;
+   
+  procedure tsimpleobject.test_normal(x: byte);pascal;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_static(x: byte);pascal;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_virtual(x: byte);pascal;
+   begin
+     global_u8bit := x;
+   end;
+
+ {****************************************************************************************************}  
+  constructor tsimpleclass.create;pascal;
+   begin
+    inherited create;
+   end;
+   
+  procedure tsimpleclass. test_normal(x: byte);pascal;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static(x: byte);pascal;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleclass.test_virtual(x: byte);pascal;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_normal_self(self : tsimpleclass; x: byte);pascal;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static_self(self : tsimpleclass; x: byte);pascal;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_virtual_self(self : tsimpleclass; x: byte);pascal;
+   begin
+     global_u8bit := x;
+   end;
+
+
+var
+ failed : boolean;
+Begin
+ { setup variables }
+ proc := @testroutine;
+ func := @testroutineresult;
+ obj.init;
+ cla:=tsimpleclass.create;
+ 
+ {****************************************************************************************************}  
+
+ Write('Testing procedure variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ troutine(getroutine)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ troutine(getroutine)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing procedure variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ proc(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ proc(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing function variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := troutineresult(getroutineresult)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := troutineresult(getroutineresult)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing function variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := func(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := func(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing object method variable call (LOC_REGISTER) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tobjectmethod(get_object_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_type_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_normal)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_type_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing object method variable call (LOC_REFERENCE) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+
+ obj_method:[email protected]_normal;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_virtual;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ {****************************************************************************************************}  
+ Write('Testing class method variable call (LOC_REGISTER) ..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tclassmethod(get_class_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethod(get_class_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tclassmethodself(get_class_method_normal_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethodself(get_class_method_virtual_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing class method variable call (LOC_REFERENCE)...');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ 
+ cla_method := @tsimpleclass.test_normal;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+
+ clear_globals;
+ clear_values;
+ 
+ 
+ cla_method_self := @tsimpleclass.test_normal_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+end.
+
+{
+   $Log$
+   Revision 1.1  2002-05-05 13:58:50  carl
+   + finished procedural variable testsuit
+   + finished method testsuit
+
+}

+ 608 - 0
tests/test/cg/tcalpvr3.pp

@@ -0,0 +1,608 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondcalln()                                  }
+{                 secondadd()                                    }
+{                 secondtypeconv()                               }
+{****************************************************************}
+{ DEFINES:                                                       }
+{****************************************************************}
+{ REMARKS: This tests a subset of the secondcalln() , it         }
+{          verifies procedural variables for cdecl               }
+{          calling conventions.                                  }
+{****************************************************************}
+program tcalpvr3;
+{$MODE OBJFPC}
+{$STATIC ON}
+{$R+}
+
+const
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = $500F;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = -12000;
+
+type
+
+  troutine = procedure (x: longint;  y: byte);cdecl;
+  troutineresult = function (x: longint; y: byte): int64;cdecl;
+
+  tsimpleobject = object
+    constructor init;cdecl;
+    procedure test_normal(x: byte);cdecl;
+    procedure test_static(x: byte);static;cdecl;
+    procedure test_virtual(x: byte);virtual;cdecl;
+  end;  
+  
+  tsimpleclass = class
+    constructor create;cdecl;
+    procedure test_normal(x: byte);cdecl;
+    class procedure test_static(x: byte);cdecl;
+    procedure test_virtual(x: byte);virtual;cdecl;
+    procedure test_normal_self(self : tsimpleclass; x: byte); message 0;cdecl;
+    class procedure test_static_self(self : tsimpleclass; x: byte); message 1;cdecl;
+    procedure test_virtual_self(self : tsimpleclass; x: byte);virtual;message 2;cdecl;
+  end;    
+
+  tobjectmethod = procedure (x: byte) of object ;cdecl;
+  tclassmethod = procedure (x: byte) of object;cdecl;
+  { used for testing pocontainsself explicit parameter }
+  tclassmethodself = procedure (self : tsimpleclass; x: byte) of object;cdecl;
+  
+var
+  proc : troutine;
+  func : troutineresult;
+  obj_method : tobjectmethod;
+  cla_method : tclassmethod;
+  cla_method_self : tclassmethodself;
+  global_s32bit : longint;
+  global_s64bit : int64;
+  global_u8bit : byte;
+  value_s32bit : longint;
+  value_u8bit : byte;
+  obj : tsimpleobject;
+  cla : tsimpleclass;
+  
+    
+  
+
+  procedure fail;
+   begin
+     WriteLn('Failed!');
+     halt(1);
+   end;
+  
+  procedure clear_globals;
+   begin
+     global_s32bit := 0;
+     global_u8bit := 0;
+     global_s64bit := 0;
+   end;
+   
+  procedure clear_values;
+    begin
+      value_s32bit := 0;
+      value_u8bit := 0;
+    end;
+
+
+  procedure testroutine(x: longint; y: byte);cdecl;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+   end;
+   
+  function testroutineresult(x: longint; y: byte): int64;cdecl;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+     testroutineresult := RESULT_S64BIT;
+   end;
+
+
+  function getroutine: troutine;
+    begin
+      getroutine:=proc;
+    end;
+    
+  function getroutineresult : troutineresult;
+   begin
+     getroutineresult := func;
+   end;
+   
+{ IMPOSSIBLE TO DO CURRENTLY !    
+  function get_object_method_static : tnormalmethod;
+   begin
+     get_object_method_static := @obj.test_static;
+   end;
+}   
+
+  { objects access }
+  function get_object_method_normal : tobjectmethod;
+   begin
+     get_object_method_normal := @obj.test_normal;
+   end;
+
+  function get_object_type_method_virtual : tobjectmethod;
+   begin
+     get_object_type_method_virtual := @tsimpleobject.test_virtual;
+   end;
+
+  function get_object_method_virtual : tobjectmethod;
+   begin
+     get_object_method_virtual := @obj.test_virtual;
+   end;
+
+  { class access }
+  function get_class_method_normal_self : tclassmethodself;
+   begin
+     get_class_method_normal_self := @tsimpleclass.test_normal_self;
+   end;
+
+{
+  HOW CAN WE GET THIS ADDRESS??? 
+  function get_class_method_static_self : tclassmethodself;
+   begin
+     get_class_method_static_self := @cla.test_static_self;
+   end;
+}   
+
+  function get_class_method_virtual_self : tclassmethodself;
+   begin
+     get_class_method_virtual_self := @tsimpleclass.test_virtual_self;
+   end;
+   
+
+  function get_class_method_normal : tclassmethod;
+   begin
+     get_class_method_normal := @tsimpleclass.test_normal;
+   end;
+{
+  function get_class_method_static : tclassmethod;
+   begin
+     get_class_method_static := @tsimpleclass.test_static;
+   end;}
+
+  function get_class_method_virtual : tclassmethod;
+   begin
+     get_class_method_virtual := @tsimpleclass.test_virtual;
+   end;
+   
+ {****************************************************************************************************}  
+
+  constructor tsimpleobject.init;cdecl;
+   begin
+   end;
+   
+  procedure tsimpleobject.test_normal(x: byte);cdecl;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_static(x: byte);cdecl;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_virtual(x: byte);cdecl;
+   begin
+     global_u8bit := x;
+   end;
+
+ {****************************************************************************************************}  
+  constructor tsimpleclass.create;cdecl;
+   begin
+    inherited create;
+   end;
+   
+  procedure tsimpleclass. test_normal(x: byte);cdecl;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static(x: byte);cdecl;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleclass.test_virtual(x: byte);cdecl;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_normal_self(self : tsimpleclass; x: byte);cdecl;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static_self(self : tsimpleclass; x: byte);cdecl;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_virtual_self(self : tsimpleclass; x: byte);cdecl;
+   begin
+     global_u8bit := x;
+   end;
+
+
+var
+ failed : boolean;
+Begin
+ { setup variables }
+ proc := @testroutine;
+ func := @testroutineresult;
+ obj.init;
+ cla:=tsimpleclass.create;
+ 
+ {****************************************************************************************************}  
+
+ Write('Testing procedure variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ troutine(getroutine)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ troutine(getroutine)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing procedure variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ proc(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ proc(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing function variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := troutineresult(getroutineresult)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := troutineresult(getroutineresult)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing function variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := func(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := func(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing object method variable call (LOC_REGISTER) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tobjectmethod(get_object_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_type_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_normal)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_type_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing object method variable call (LOC_REFERENCE) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+
+ obj_method:[email protected]_normal;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_virtual;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ {****************************************************************************************************}  
+ Write('Testing class method variable call (LOC_REGISTER) ..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tclassmethod(get_class_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethod(get_class_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tclassmethodself(get_class_method_normal_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethodself(get_class_method_virtual_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing class method variable call (LOC_REFERENCE)...');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ 
+ cla_method := @tsimpleclass.test_normal;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+
+ clear_globals;
+ clear_values;
+ 
+ 
+ cla_method_self := @tsimpleclass.test_normal_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+end.
+
+{
+   $Log$
+   Revision 1.1  2002-05-05 13:58:50  carl
+   + finished procedural variable testsuit
+   + finished method testsuit
+
+}

+ 608 - 0
tests/test/cg/tcalpvr4.pp

@@ -0,0 +1,608 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondcalln()                                  }
+{                 secondadd()                                    }
+{                 secondtypeconv()                               }
+{****************************************************************}
+{ DEFINES:                                                       }
+{****************************************************************}
+{ REMARKS: This tests a subset of the secondcalln() , it         }
+{          verifies procedural variables for popstack            }
+{          calling conventions.                                  }
+{****************************************************************}
+program tcalpvr4;
+{$MODE OBJFPC}
+{$STATIC ON}
+{$R+}
+
+const
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = $500F;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = -12000;
+
+type
+
+  troutine = procedure (x: longint;  y: byte);popstack;
+  troutineresult = function (x: longint; y: byte): int64;popstack;
+
+  tsimpleobject = object
+    constructor init;popstack;
+    procedure test_normal(x: byte);popstack;
+    procedure test_static(x: byte);static;popstack;
+    procedure test_virtual(x: byte);virtual;popstack;
+  end;  
+  
+  tsimpleclass = class
+    constructor create;popstack;
+    procedure test_normal(x: byte);popstack;
+    class procedure test_static(x: byte);popstack;
+    procedure test_virtual(x: byte);virtual;popstack;
+    procedure test_normal_self(self : tsimpleclass; x: byte); message 0;popstack;
+    class procedure test_static_self(self : tsimpleclass; x: byte); message 1;popstack;
+    procedure test_virtual_self(self : tsimpleclass; x: byte);virtual;message 2;popstack;
+  end;    
+
+  tobjectmethod = procedure (x: byte) of object ;popstack;
+  tclassmethod = procedure (x: byte) of object;popstack;
+  { used for testing pocontainsself explicit parameter }
+  tclassmethodself = procedure (self : tsimpleclass; x: byte) of object;popstack;
+  
+var
+  proc : troutine;
+  func : troutineresult;
+  obj_method : tobjectmethod;
+  cla_method : tclassmethod;
+  cla_method_self : tclassmethodself;
+  global_s32bit : longint;
+  global_s64bit : int64;
+  global_u8bit : byte;
+  value_s32bit : longint;
+  value_u8bit : byte;
+  obj : tsimpleobject;
+  cla : tsimpleclass;
+  
+    
+  
+
+  procedure fail;
+   begin
+     WriteLn('Failed!');
+     halt(1);
+   end;
+  
+  procedure clear_globals;
+   begin
+     global_s32bit := 0;
+     global_u8bit := 0;
+     global_s64bit := 0;
+   end;
+   
+  procedure clear_values;
+    begin
+      value_s32bit := 0;
+      value_u8bit := 0;
+    end;
+
+
+  procedure testroutine(x: longint; y: byte);popstack;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+   end;
+   
+  function testroutineresult(x: longint; y: byte): int64;popstack;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+     testroutineresult := RESULT_S64BIT;
+   end;
+
+
+  function getroutine: troutine;
+    begin
+      getroutine:=proc;
+    end;
+    
+  function getroutineresult : troutineresult;
+   begin
+     getroutineresult := func;
+   end;
+   
+{ IMPOSSIBLE TO DO CURRENTLY !    
+  function get_object_method_static : tnormalmethod;
+   begin
+     get_object_method_static := @obj.test_static;
+   end;
+}   
+
+  { objects access }
+  function get_object_method_normal : tobjectmethod;
+   begin
+     get_object_method_normal := @obj.test_normal;
+   end;
+
+  function get_object_type_method_virtual : tobjectmethod;
+   begin
+     get_object_type_method_virtual := @tsimpleobject.test_virtual;
+   end;
+
+  function get_object_method_virtual : tobjectmethod;
+   begin
+     get_object_method_virtual := @obj.test_virtual;
+   end;
+
+  { class access }
+  function get_class_method_normal_self : tclassmethodself;
+   begin
+     get_class_method_normal_self := @tsimpleclass.test_normal_self;
+   end;
+
+{
+  HOW CAN WE GET THIS ADDRESS??? 
+  function get_class_method_static_self : tclassmethodself;
+   begin
+     get_class_method_static_self := @cla.test_static_self;
+   end;
+}   
+
+  function get_class_method_virtual_self : tclassmethodself;
+   begin
+     get_class_method_virtual_self := @tsimpleclass.test_virtual_self;
+   end;
+   
+
+  function get_class_method_normal : tclassmethod;
+   begin
+     get_class_method_normal := @tsimpleclass.test_normal;
+   end;
+{
+  function get_class_method_static : tclassmethod;
+   begin
+     get_class_method_static := @tsimpleclass.test_static;
+   end;}
+
+  function get_class_method_virtual : tclassmethod;
+   begin
+     get_class_method_virtual := @tsimpleclass.test_virtual;
+   end;
+   
+ {****************************************************************************************************}  
+
+  constructor tsimpleobject.init;popstack;
+   begin
+   end;
+   
+  procedure tsimpleobject.test_normal(x: byte);popstack;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_static(x: byte);popstack;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_virtual(x: byte);popstack;
+   begin
+     global_u8bit := x;
+   end;
+
+ {****************************************************************************************************}  
+  constructor tsimpleclass.create;popstack;
+   begin
+    inherited create;
+   end;
+   
+  procedure tsimpleclass. test_normal(x: byte);popstack;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static(x: byte);popstack;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleclass.test_virtual(x: byte);popstack;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_normal_self(self : tsimpleclass; x: byte);popstack;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static_self(self : tsimpleclass; x: byte);popstack;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_virtual_self(self : tsimpleclass; x: byte);popstack;
+   begin
+     global_u8bit := x;
+   end;
+
+
+var
+ failed : boolean;
+Begin
+ { setup variables }
+ proc := @testroutine;
+ func := @testroutineresult;
+ obj.init;
+ cla:=tsimpleclass.create;
+ 
+ {****************************************************************************************************}  
+
+ Write('Testing procedure variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ troutine(getroutine)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ troutine(getroutine)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing procedure variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ proc(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ proc(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing function variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := troutineresult(getroutineresult)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := troutineresult(getroutineresult)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing function variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := func(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := func(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing object method variable call (LOC_REGISTER) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tobjectmethod(get_object_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_type_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_normal)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_type_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing object method variable call (LOC_REFERENCE) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+
+ obj_method:[email protected]_normal;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_virtual;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ {****************************************************************************************************}  
+ Write('Testing class method variable call (LOC_REGISTER) ..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tclassmethod(get_class_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethod(get_class_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tclassmethodself(get_class_method_normal_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethodself(get_class_method_virtual_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing class method variable call (LOC_REFERENCE)...');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ 
+ cla_method := @tsimpleclass.test_normal;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+
+ clear_globals;
+ clear_values;
+ 
+ 
+ cla_method_self := @tsimpleclass.test_normal_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+end.
+
+{
+   $Log$
+   Revision 1.1  2002-05-05 13:58:50  carl
+   + finished procedural variable testsuit
+   + finished method testsuit
+
+}

+ 608 - 0
tests/test/cg/tcalpvr5.pp

@@ -0,0 +1,608 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondcalln()                                  }
+{                 secondadd()                                    }
+{                 secondtypeconv()                               }
+{****************************************************************}
+{ DEFINES:                                                       }
+{****************************************************************}
+{ REMARKS: This tests a subset of the secondcalln() , it         }
+{          verifies procedural variables for safecall            }
+{          calling conventions.                                  }
+{****************************************************************}
+program tcalpvr5;
+{$MODE OBJFPC}
+{$STATIC ON}
+{$R+}
+
+const
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = $500F;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = -12000;
+
+type
+
+  troutine = procedure (x: longint;  y: byte);safecall;
+  troutineresult = function (x: longint; y: byte): int64;safecall;
+
+  tsimpleobject = object
+    constructor init;safecall;
+    procedure test_normal(x: byte);safecall;
+    procedure test_static(x: byte);static;safecall;
+    procedure test_virtual(x: byte);virtual;safecall;
+  end;  
+  
+  tsimpleclass = class
+    constructor create;safecall;
+    procedure test_normal(x: byte);safecall;
+    class procedure test_static(x: byte);safecall;
+    procedure test_virtual(x: byte);virtual;safecall;
+    procedure test_normal_self(self : tsimpleclass; x: byte); message 0;safecall;
+    class procedure test_static_self(self : tsimpleclass; x: byte); message 1;safecall;
+    procedure test_virtual_self(self : tsimpleclass; x: byte);virtual;message 2;safecall;
+  end;    
+
+  tobjectmethod = procedure (x: byte) of object ;safecall;
+  tclassmethod = procedure (x: byte) of object;safecall;
+  { used for testing pocontainsself explicit parameter }
+  tclassmethodself = procedure (self : tsimpleclass; x: byte) of object;safecall;
+  
+var
+  proc : troutine;
+  func : troutineresult;
+  obj_method : tobjectmethod;
+  cla_method : tclassmethod;
+  cla_method_self : tclassmethodself;
+  global_s32bit : longint;
+  global_s64bit : int64;
+  global_u8bit : byte;
+  value_s32bit : longint;
+  value_u8bit : byte;
+  obj : tsimpleobject;
+  cla : tsimpleclass;
+  
+    
+  
+
+  procedure fail;
+   begin
+     WriteLn('Failed!');
+     halt(1);
+   end;
+  
+  procedure clear_globals;
+   begin
+     global_s32bit := 0;
+     global_u8bit := 0;
+     global_s64bit := 0;
+   end;
+   
+  procedure clear_values;
+    begin
+      value_s32bit := 0;
+      value_u8bit := 0;
+    end;
+
+
+  procedure testroutine(x: longint; y: byte);safecall;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+   end;
+   
+  function testroutineresult(x: longint; y: byte): int64;safecall;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+     testroutineresult := RESULT_S64BIT;
+   end;
+
+
+  function getroutine: troutine;
+    begin
+      getroutine:=proc;
+    end;
+    
+  function getroutineresult : troutineresult;
+   begin
+     getroutineresult := func;
+   end;
+   
+{ IMPOSSIBLE TO DO CURRENTLY !    
+  function get_object_method_static : tnormalmethod;
+   begin
+     get_object_method_static := @obj.test_static;
+   end;
+}   
+
+  { objects access }
+  function get_object_method_normal : tobjectmethod;
+   begin
+     get_object_method_normal := @obj.test_normal;
+   end;
+
+  function get_object_type_method_virtual : tobjectmethod;
+   begin
+     get_object_type_method_virtual := @tsimpleobject.test_virtual;
+   end;
+
+  function get_object_method_virtual : tobjectmethod;
+   begin
+     get_object_method_virtual := @obj.test_virtual;
+   end;
+
+  { class access }
+  function get_class_method_normal_self : tclassmethodself;
+   begin
+     get_class_method_normal_self := @tsimpleclass.test_normal_self;
+   end;
+
+{
+  HOW CAN WE GET THIS ADDRESS??? 
+  function get_class_method_static_self : tclassmethodself;
+   begin
+     get_class_method_static_self := @cla.test_static_self;
+   end;
+}   
+
+  function get_class_method_virtual_self : tclassmethodself;
+   begin
+     get_class_method_virtual_self := @tsimpleclass.test_virtual_self;
+   end;
+   
+
+  function get_class_method_normal : tclassmethod;
+   begin
+     get_class_method_normal := @tsimpleclass.test_normal;
+   end;
+{
+  function get_class_method_static : tclassmethod;
+   begin
+     get_class_method_static := @tsimpleclass.test_static;
+   end;}
+
+  function get_class_method_virtual : tclassmethod;
+   begin
+     get_class_method_virtual := @tsimpleclass.test_virtual;
+   end;
+   
+ {****************************************************************************************************}  
+
+  constructor tsimpleobject.init;safecall;
+   begin
+   end;
+   
+  procedure tsimpleobject.test_normal(x: byte);safecall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_static(x: byte);safecall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_virtual(x: byte);safecall;
+   begin
+     global_u8bit := x;
+   end;
+
+ {****************************************************************************************************}  
+  constructor tsimpleclass.create;safecall;
+   begin
+    inherited create;
+   end;
+   
+  procedure tsimpleclass. test_normal(x: byte);safecall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static(x: byte);safecall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleclass.test_virtual(x: byte);safecall;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_normal_self(self : tsimpleclass; x: byte);safecall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static_self(self : tsimpleclass; x: byte);safecall;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_virtual_self(self : tsimpleclass; x: byte);safecall;
+   begin
+     global_u8bit := x;
+   end;
+
+
+var
+ failed : boolean;
+Begin
+ { setup variables }
+ proc := @testroutine;
+ func := @testroutineresult;
+ obj.init;
+ cla:=tsimpleclass.create;
+ 
+ {****************************************************************************************************}  
+
+ Write('Testing procedure variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ troutine(getroutine)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ troutine(getroutine)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing procedure variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ proc(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ proc(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing function variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := troutineresult(getroutineresult)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := troutineresult(getroutineresult)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing function variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := func(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := func(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing object method variable call (LOC_REGISTER) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tobjectmethod(get_object_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_type_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_normal)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_type_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing object method variable call (LOC_REFERENCE) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+
+ obj_method:[email protected]_normal;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_virtual;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ {****************************************************************************************************}  
+ Write('Testing class method variable call (LOC_REGISTER) ..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tclassmethod(get_class_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethod(get_class_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tclassmethodself(get_class_method_normal_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethodself(get_class_method_virtual_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing class method variable call (LOC_REFERENCE)...');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ 
+ cla_method := @tsimpleclass.test_normal;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+
+ clear_globals;
+ clear_values;
+ 
+ 
+ cla_method_self := @tsimpleclass.test_normal_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+end.
+
+{
+   $Log$
+   Revision 1.1  2002-05-05 13:58:50  carl
+   + finished procedural variable testsuit
+   + finished method testsuit
+
+}

+ 608 - 0
tests/test/cg/tcalpvr6.pp

@@ -0,0 +1,608 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondcalln()                                  }
+{                 secondadd()                                    }
+{                 secondtypeconv()                               }
+{****************************************************************}
+{ DEFINES:                                                       }
+{****************************************************************}
+{ REMARKS: This tests a subset of the secondcalln() , it         }
+{          verifies procedural variables for register            }
+{          calling conventions.                                  }
+{****************************************************************}
+program tcalpvr6;
+{$MODE OBJFPC}
+{$STATIC ON}
+{$R+}
+
+const
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = $500F;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = -12000;
+
+type
+
+  troutine = procedure (x: longint;  y: byte);register;
+  troutineresult = function (x: longint; y: byte): int64;register;
+
+  tsimpleobject = object
+    constructor init;register;
+    procedure test_normal(x: byte);register;
+    procedure test_static(x: byte);static;register;
+    procedure test_virtual(x: byte);virtual;register;
+  end;  
+  
+  tsimpleclass = class
+    constructor create;register;
+    procedure test_normal(x: byte);register;
+    class procedure test_static(x: byte);register;
+    procedure test_virtual(x: byte);virtual;register;
+    procedure test_normal_self(self : tsimpleclass; x: byte); message 0;register;
+    class procedure test_static_self(self : tsimpleclass; x: byte); message 1;register;
+    procedure test_virtual_self(self : tsimpleclass; x: byte);virtual;message 2;register;
+  end;    
+
+  tobjectmethod = procedure (x: byte) of object ;register;
+  tclassmethod = procedure (x: byte) of object;register;
+  { used for testing pocontainsself explicit parameter }
+  tclassmethodself = procedure (self : tsimpleclass; x: byte) of object;register;
+  
+var
+  proc : troutine;
+  func : troutineresult;
+  obj_method : tobjectmethod;
+  cla_method : tclassmethod;
+  cla_method_self : tclassmethodself;
+  global_s32bit : longint;
+  global_s64bit : int64;
+  global_u8bit : byte;
+  value_s32bit : longint;
+  value_u8bit : byte;
+  obj : tsimpleobject;
+  cla : tsimpleclass;
+  
+    
+  
+
+  procedure fail;
+   begin
+     WriteLn('Failed!');
+     halt(1);
+   end;
+  
+  procedure clear_globals;
+   begin
+     global_s32bit := 0;
+     global_u8bit := 0;
+     global_s64bit := 0;
+   end;
+   
+  procedure clear_values;
+    begin
+      value_s32bit := 0;
+      value_u8bit := 0;
+    end;
+
+
+  procedure testroutine(x: longint; y: byte);register;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+   end;
+   
+  function testroutineresult(x: longint; y: byte): int64;register;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+     testroutineresult := RESULT_S64BIT;
+   end;
+
+
+  function getroutine: troutine;
+    begin
+      getroutine:=proc;
+    end;
+    
+  function getroutineresult : troutineresult;
+   begin
+     getroutineresult := func;
+   end;
+   
+{ IMPOSSIBLE TO DO CURRENTLY !    
+  function get_object_method_static : tnormalmethod;
+   begin
+     get_object_method_static := @obj.test_static;
+   end;
+}   
+
+  { objects access }
+  function get_object_method_normal : tobjectmethod;
+   begin
+     get_object_method_normal := @obj.test_normal;
+   end;
+
+  function get_object_type_method_virtual : tobjectmethod;
+   begin
+     get_object_type_method_virtual := @tsimpleobject.test_virtual;
+   end;
+
+  function get_object_method_virtual : tobjectmethod;
+   begin
+     get_object_method_virtual := @obj.test_virtual;
+   end;
+
+  { class access }
+  function get_class_method_normal_self : tclassmethodself;
+   begin
+     get_class_method_normal_self := @tsimpleclass.test_normal_self;
+   end;
+
+{
+  HOW CAN WE GET THIS ADDRESS??? 
+  function get_class_method_static_self : tclassmethodself;
+   begin
+     get_class_method_static_self := @cla.test_static_self;
+   end;
+}   
+
+  function get_class_method_virtual_self : tclassmethodself;
+   begin
+     get_class_method_virtual_self := @tsimpleclass.test_virtual_self;
+   end;
+   
+
+  function get_class_method_normal : tclassmethod;
+   begin
+     get_class_method_normal := @tsimpleclass.test_normal;
+   end;
+{
+  function get_class_method_static : tclassmethod;
+   begin
+     get_class_method_static := @tsimpleclass.test_static;
+   end;}
+
+  function get_class_method_virtual : tclassmethod;
+   begin
+     get_class_method_virtual := @tsimpleclass.test_virtual;
+   end;
+   
+ {****************************************************************************************************}  
+
+  constructor tsimpleobject.init;register;
+   begin
+   end;
+   
+  procedure tsimpleobject.test_normal(x: byte);register;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_static(x: byte);register;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_virtual(x: byte);register;
+   begin
+     global_u8bit := x;
+   end;
+
+ {****************************************************************************************************}  
+  constructor tsimpleclass.create;register;
+   begin
+    inherited create;
+   end;
+   
+  procedure tsimpleclass. test_normal(x: byte);register;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static(x: byte);register;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleclass.test_virtual(x: byte);register;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_normal_self(self : tsimpleclass; x: byte);register;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static_self(self : tsimpleclass; x: byte);register;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_virtual_self(self : tsimpleclass; x: byte);register;
+   begin
+     global_u8bit := x;
+   end;
+
+
+var
+ failed : boolean;
+Begin
+ { setup variables }
+ proc := @testroutine;
+ func := @testroutineresult;
+ obj.init;
+ cla:=tsimpleclass.create;
+ 
+ {****************************************************************************************************}  
+
+ Write('Testing procedure variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ troutine(getroutine)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ troutine(getroutine)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing procedure variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ proc(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ proc(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing function variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := troutineresult(getroutineresult)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := troutineresult(getroutineresult)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing function variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := func(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := func(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing object method variable call (LOC_REGISTER) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tobjectmethod(get_object_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_type_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_normal)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_type_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing object method variable call (LOC_REFERENCE) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+
+ obj_method:[email protected]_normal;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_virtual;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ {****************************************************************************************************}  
+ Write('Testing class method variable call (LOC_REGISTER) ..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tclassmethod(get_class_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethod(get_class_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tclassmethodself(get_class_method_normal_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethodself(get_class_method_virtual_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing class method variable call (LOC_REFERENCE)...');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ 
+ cla_method := @tsimpleclass.test_normal;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+
+ clear_globals;
+ clear_values;
+ 
+ 
+ cla_method_self := @tsimpleclass.test_normal_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+end.
+
+{
+   $Log$
+   Revision 1.1  2002-05-05 13:58:50  carl
+   + finished procedural variable testsuit
+   + finished method testsuit
+
+}

+ 608 - 0
tests/test/cg/tcalpvr7.pp

@@ -0,0 +1,608 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondcalln()                                  }
+{                 secondadd()                                    }
+{                 secondtypeconv()                               }
+{****************************************************************}
+{ DEFINES:                                                       }
+{****************************************************************}
+{ REMARKS: This tests a subset of the secondcalln() , it         }
+{          verifies procedural variables for stdcall             }
+{          calling conventions.                                  }
+{****************************************************************}
+program tcalpvr7;
+{$MODE OBJFPC}
+{$STATIC ON}
+{$R+}
+
+const
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = $500F;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = -12000;
+
+type
+
+  troutine = procedure (x: longint;  y: byte);stdcall;
+  troutineresult = function (x: longint; y: byte): int64;stdcall;
+
+  tsimpleobject = object
+    constructor init;stdcall;
+    procedure test_normal(x: byte);stdcall;
+    procedure test_static(x: byte);static;stdcall;
+    procedure test_virtual(x: byte);virtual;stdcall;
+  end;  
+  
+  tsimpleclass = class
+    constructor create;stdcall;
+    procedure test_normal(x: byte);stdcall;
+    class procedure test_static(x: byte);stdcall;
+    procedure test_virtual(x: byte);virtual;stdcall;
+    procedure test_normal_self(self : tsimpleclass; x: byte); message 0;stdcall;
+    class procedure test_static_self(self : tsimpleclass; x: byte); message 1;stdcall;
+    procedure test_virtual_self(self : tsimpleclass; x: byte);virtual;message 2;stdcall;
+  end;    
+
+  tobjectmethod = procedure (x: byte) of object ;stdcall;
+  tclassmethod = procedure (x: byte) of object;stdcall;
+  { used for testing pocontainsself explicit parameter }
+  tclassmethodself = procedure (self : tsimpleclass; x: byte) of object;stdcall;
+  
+var
+  proc : troutine;
+  func : troutineresult;
+  obj_method : tobjectmethod;
+  cla_method : tclassmethod;
+  cla_method_self : tclassmethodself;
+  global_s32bit : longint;
+  global_s64bit : int64;
+  global_u8bit : byte;
+  value_s32bit : longint;
+  value_u8bit : byte;
+  obj : tsimpleobject;
+  cla : tsimpleclass;
+  
+    
+  
+
+  procedure fail;
+   begin
+     WriteLn('Failed!');
+     halt(1);
+   end;
+  
+  procedure clear_globals;
+   begin
+     global_s32bit := 0;
+     global_u8bit := 0;
+     global_s64bit := 0;
+   end;
+   
+  procedure clear_values;
+    begin
+      value_s32bit := 0;
+      value_u8bit := 0;
+    end;
+
+
+  procedure testroutine(x: longint; y: byte);stdcall;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+   end;
+   
+  function testroutineresult(x: longint; y: byte): int64;stdcall;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+     testroutineresult := RESULT_S64BIT;
+   end;
+
+
+  function getroutine: troutine;
+    begin
+      getroutine:=proc;
+    end;
+    
+  function getroutineresult : troutineresult;
+   begin
+     getroutineresult := func;
+   end;
+   
+{ IMPOSSIBLE TO DO CURRENTLY !    
+  function get_object_method_static : tnormalmethod;
+   begin
+     get_object_method_static := @obj.test_static;
+   end;
+}   
+
+  { objects access }
+  function get_object_method_normal : tobjectmethod;
+   begin
+     get_object_method_normal := @obj.test_normal;
+   end;
+
+  function get_object_type_method_virtual : tobjectmethod;
+   begin
+     get_object_type_method_virtual := @tsimpleobject.test_virtual;
+   end;
+
+  function get_object_method_virtual : tobjectmethod;
+   begin
+     get_object_method_virtual := @obj.test_virtual;
+   end;
+
+  { class access }
+  function get_class_method_normal_self : tclassmethodself;
+   begin
+     get_class_method_normal_self := @tsimpleclass.test_normal_self;
+   end;
+
+{
+  HOW CAN WE GET THIS ADDRESS??? 
+  function get_class_method_static_self : tclassmethodself;
+   begin
+     get_class_method_static_self := @cla.test_static_self;
+   end;
+}   
+
+  function get_class_method_virtual_self : tclassmethodself;
+   begin
+     get_class_method_virtual_self := @tsimpleclass.test_virtual_self;
+   end;
+   
+
+  function get_class_method_normal : tclassmethod;
+   begin
+     get_class_method_normal := @tsimpleclass.test_normal;
+   end;
+{
+  function get_class_method_static : tclassmethod;
+   begin
+     get_class_method_static := @tsimpleclass.test_static;
+   end;}
+
+  function get_class_method_virtual : tclassmethod;
+   begin
+     get_class_method_virtual := @tsimpleclass.test_virtual;
+   end;
+   
+ {****************************************************************************************************}  
+
+  constructor tsimpleobject.init;stdcall;
+   begin
+   end;
+   
+  procedure tsimpleobject.test_normal(x: byte);stdcall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_static(x: byte);stdcall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_virtual(x: byte);stdcall;
+   begin
+     global_u8bit := x;
+   end;
+
+ {****************************************************************************************************}  
+  constructor tsimpleclass.create;stdcall;
+   begin
+    inherited create;
+   end;
+   
+  procedure tsimpleclass. test_normal(x: byte);stdcall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static(x: byte);stdcall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleclass.test_virtual(x: byte);stdcall;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_normal_self(self : tsimpleclass; x: byte);stdcall;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static_self(self : tsimpleclass; x: byte);stdcall;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_virtual_self(self : tsimpleclass; x: byte);stdcall;
+   begin
+     global_u8bit := x;
+   end;
+
+
+var
+ failed : boolean;
+Begin
+ { setup variables }
+ proc := @testroutine;
+ func := @testroutineresult;
+ obj.init;
+ cla:=tsimpleclass.create;
+ 
+ {****************************************************************************************************}  
+
+ Write('Testing procedure variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ troutine(getroutine)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ troutine(getroutine)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing procedure variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ proc(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ proc(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing function variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := troutineresult(getroutineresult)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := troutineresult(getroutineresult)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing function variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := func(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := func(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing object method variable call (LOC_REGISTER) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tobjectmethod(get_object_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_type_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_normal)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_type_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing object method variable call (LOC_REFERENCE) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+
+ obj_method:[email protected]_normal;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_virtual;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ {****************************************************************************************************}  
+ Write('Testing class method variable call (LOC_REGISTER) ..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tclassmethod(get_class_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethod(get_class_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tclassmethodself(get_class_method_normal_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethodself(get_class_method_virtual_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing class method variable call (LOC_REFERENCE)...');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ 
+ cla_method := @tsimpleclass.test_normal;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+
+ clear_globals;
+ clear_values;
+ 
+ 
+ cla_method_self := @tsimpleclass.test_normal_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+end.
+
+{
+   $Log$
+   Revision 1.1  2002-05-05 13:58:50  carl
+   + finished procedural variable testsuit
+   + finished method testsuit
+
+}

+ 608 - 0
tests/test/cg/tcalpvr8.pp

@@ -0,0 +1,608 @@
+{****************************************************************}
+{  CODE GENERATOR TEST PROGRAM                                   }
+{****************************************************************}
+{ NODE TESTED : secondcalln()                                    }
+{****************************************************************}
+{ PRE-REQUISITES: secondload()                                   }
+{                 secondassign()                                 }
+{                 secondcalln()                                  }
+{                 secondadd()                                    }
+{                 secondtypeconv()                               }
+{****************************************************************}
+{ DEFINES:                                                       }
+{****************************************************************}
+{ REMARKS: This tests a subset of the secondcalln() , it         }
+{          verifies procedural variables for saveregisters       }
+{          calling conventions.                                  }
+{****************************************************************}
+program tcalpvr8;
+{$MODE OBJFPC}
+{$STATIC ON}
+{$R+}
+
+const
+   RESULT_U8BIT = $55;
+   RESULT_U16BIT = $500F;
+   RESULT_S32BIT = $500F0000;
+   RESULT_S64BIT = -12000;
+
+type
+
+  troutine = procedure (x: longint;  y: byte);saveregisters;
+  troutineresult = function (x: longint; y: byte): int64;saveregisters;
+
+  tsimpleobject = object
+    constructor init;saveregisters;
+    procedure test_normal(x: byte);saveregisters;
+    procedure test_static(x: byte);static;saveregisters;
+    procedure test_virtual(x: byte);virtual;saveregisters;
+  end;  
+  
+  tsimpleclass = class
+    constructor create;saveregisters;
+    procedure test_normal(x: byte);saveregisters;
+    class procedure test_static(x: byte);saveregisters;
+    procedure test_virtual(x: byte);virtual;saveregisters;
+    procedure test_normal_self(self : tsimpleclass; x: byte); message 0;saveregisters;
+    class procedure test_static_self(self : tsimpleclass; x: byte); message 1;saveregisters;
+    procedure test_virtual_self(self : tsimpleclass; x: byte);virtual;message 2;saveregisters;
+  end;    
+
+  tobjectmethod = procedure (x: byte) of object ;saveregisters;
+  tclassmethod = procedure (x: byte) of object;saveregisters;
+  { used for testing pocontainsself explicit parameter }
+  tclassmethodself = procedure (self : tsimpleclass; x: byte) of object;saveregisters;
+  
+var
+  proc : troutine;
+  func : troutineresult;
+  obj_method : tobjectmethod;
+  cla_method : tclassmethod;
+  cla_method_self : tclassmethodself;
+  global_s32bit : longint;
+  global_s64bit : int64;
+  global_u8bit : byte;
+  value_s32bit : longint;
+  value_u8bit : byte;
+  obj : tsimpleobject;
+  cla : tsimpleclass;
+  
+    
+  
+
+  procedure fail;
+   begin
+     WriteLn('Failed!');
+     halt(1);
+   end;
+  
+  procedure clear_globals;
+   begin
+     global_s32bit := 0;
+     global_u8bit := 0;
+     global_s64bit := 0;
+   end;
+   
+  procedure clear_values;
+    begin
+      value_s32bit := 0;
+      value_u8bit := 0;
+    end;
+
+
+  procedure testroutine(x: longint; y: byte);saveregisters;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+   end;
+   
+  function testroutineresult(x: longint; y: byte): int64;saveregisters;
+   begin
+     global_s32bit := x;
+     global_u8bit := y;
+     testroutineresult := RESULT_S64BIT;
+   end;
+
+
+  function getroutine: troutine;
+    begin
+      getroutine:=proc;
+    end;
+    
+  function getroutineresult : troutineresult;
+   begin
+     getroutineresult := func;
+   end;
+   
+{ IMPOSSIBLE TO DO CURRENTLY !    
+  function get_object_method_static : tnormalmethod;
+   begin
+     get_object_method_static := @obj.test_static;
+   end;
+}   
+
+  { objects access }
+  function get_object_method_normal : tobjectmethod;
+   begin
+     get_object_method_normal := @obj.test_normal;
+   end;
+
+  function get_object_type_method_virtual : tobjectmethod;
+   begin
+     get_object_type_method_virtual := @tsimpleobject.test_virtual;
+   end;
+
+  function get_object_method_virtual : tobjectmethod;
+   begin
+     get_object_method_virtual := @obj.test_virtual;
+   end;
+
+  { class access }
+  function get_class_method_normal_self : tclassmethodself;
+   begin
+     get_class_method_normal_self := @tsimpleclass.test_normal_self;
+   end;
+
+{
+  HOW CAN WE GET THIS ADDRESS??? 
+  function get_class_method_static_self : tclassmethodself;
+   begin
+     get_class_method_static_self := @cla.test_static_self;
+   end;
+}   
+
+  function get_class_method_virtual_self : tclassmethodself;
+   begin
+     get_class_method_virtual_self := @tsimpleclass.test_virtual_self;
+   end;
+   
+
+  function get_class_method_normal : tclassmethod;
+   begin
+     get_class_method_normal := @tsimpleclass.test_normal;
+   end;
+{
+  function get_class_method_static : tclassmethod;
+   begin
+     get_class_method_static := @tsimpleclass.test_static;
+   end;}
+
+  function get_class_method_virtual : tclassmethod;
+   begin
+     get_class_method_virtual := @tsimpleclass.test_virtual;
+   end;
+   
+ {****************************************************************************************************}  
+
+  constructor tsimpleobject.init;saveregisters;
+   begin
+   end;
+   
+  procedure tsimpleobject.test_normal(x: byte);saveregisters;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_static(x: byte);saveregisters;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleobject.test_virtual(x: byte);saveregisters;
+   begin
+     global_u8bit := x;
+   end;
+
+ {****************************************************************************************************}  
+  constructor tsimpleclass.create;saveregisters;
+   begin
+    inherited create;
+   end;
+   
+  procedure tsimpleclass. test_normal(x: byte);saveregisters;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static(x: byte);saveregisters;
+   begin
+     global_u8bit := x;
+   end;
+   
+  procedure tsimpleclass.test_virtual(x: byte);saveregisters;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_normal_self(self : tsimpleclass; x: byte);saveregisters;
+   begin
+     global_u8bit := x;
+   end;
+   
+  class procedure tsimpleclass.test_static_self(self : tsimpleclass; x: byte);saveregisters;
+   begin
+     global_u8bit := x;
+   end;
+  
+  procedure tsimpleclass.test_virtual_self(self : tsimpleclass; x: byte);saveregisters;
+   begin
+     global_u8bit := x;
+   end;
+
+
+var
+ failed : boolean;
+Begin
+ { setup variables }
+ proc := @testroutine;
+ func := @testroutineresult;
+ obj.init;
+ cla:=tsimpleclass.create;
+ 
+ {****************************************************************************************************}  
+
+ Write('Testing procedure variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ troutine(getroutine)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ troutine(getroutine)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing procedure variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ proc(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ proc(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing function variable call (LOC_REGISTER)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := troutineresult(getroutineresult)(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := troutineresult(getroutineresult)(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+   
+   
+ Write('Testing function variable call (LOC_REFERENCE)..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ { parameters in LOC_CONSTANT, routine address in LOC_REGISTER }
+ global_s64bit := func(RESULT_S32BIT,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ { parameters in LOC_REFERENCE,routine address in LOC_REGISTER }
+ value_s32bit := RESULT_S32BIT;
+ value_u8bit := RESULT_U8BIT;
+ global_s64bit := func(value_s32bit , value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ if global_s32bit <> RESULT_S32BIT then
+   failed := true;
+ if global_s64bit <> RESULT_S64BIT then
+   failed := true;
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+ {****************************************************************************************************}  
+ Write('Testing object method variable call (LOC_REGISTER) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tobjectmethod(get_object_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_type_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tobjectmethod(get_object_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_normal)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_type_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ tobjectmethod(get_object_method_virtual)(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing object method variable call (LOC_REFERENCE) ..');
+
+ clear_globals;
+ clear_values;
+ failed := false;
+
+ obj_method:[email protected]_normal;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ obj_method:[email protected]_virtual;
+ obj_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+ 
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_virtual;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ value_u8bit := RESULT_U8BIT;   
+ obj_method:[email protected]_normal;
+ obj_method(value_u8bit);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+   
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ {****************************************************************************************************}  
+ Write('Testing class method variable call (LOC_REGISTER) ..');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ tclassmethod(get_class_method_normal)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethod(get_class_method_virtual)(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+   
+ clear_globals;
+ clear_values;
+
+ tclassmethodself(get_class_method_normal_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ tclassmethodself(get_class_method_virtual_self)(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+ Write('Testing class method variable call (LOC_REFERENCE)...');
+ 
+ clear_globals;
+ clear_values;
+ failed := false;
+ 
+ 
+ cla_method := @tsimpleclass.test_normal;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method := @tsimpleclass.test_virtual;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+
+ clear_globals;
+ clear_values;
+ 
+ 
+ cla_method_self := @tsimpleclass.test_normal_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla,RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+
+ clear_globals;
+ clear_values;
+
+ cla_method_self := @tsimpleclass.test_virtual_self;
+ cla_method_self(cla, RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;
+ 
+ clear_globals;
+ clear_values;
+
+{ cla_method := @tsimpleclass.test_static;
+ cla_method(RESULT_U8BIT);
+ if global_u8bit <> RESULT_U8BIT then
+   failed := true;}
+ 
+ If failed then
+   fail
+ else
+   WriteLn('Passed!');
+
+end.
+
+{
+   $Log$
+   Revision 1.1  2002-05-05 13:58:50  carl
+   + finished procedural variable testsuit
+   + finished method testsuit
+
+}