Browse Source

* the safecall -> cdecl mapping is also activated for x86_64
(tf_safecall_clearstack is set for it) -> also use pocalls_cdecl for it
and adjust the safecall tests not to try parameter scenarios that are
unsupported for cdecl

git-svn-id: trunk@21948 -

Jonas Maebe 13 years ago
parent
commit
bdc62289b4
3 changed files with 6 additions and 6 deletions
  1. 2 2
      compiler/x86_64/cpupara.pas
  2. 2 2
      tests/test/cg/tcalcst6.pp
  3. 2 2
      tests/test/cg/tcalvar6.pp

+ 2 - 2
compiler/x86_64/cpupara.pas

@@ -671,7 +671,7 @@ unit cpupara;
                 reference for non-cdecl/cppdecl, and make sure that the tmethod
                 reference for non-cdecl/cppdecl, and make sure that the tmethod
                 record (size=16) is passed the same way as a complex procvar }
                 record (size=16) is passed the same way as a complex procvar }
               else if ((varspez=vs_const) and
               else if ((varspez=vs_const) and
-                       not(calloption in [pocall_cdecl,pocall_cppdecl])) or
+                       not(calloption in cdecl_pocalls)) or
                       (def.size=16) then
                       (def.size=16) then
                 begin
                 begin
                   numclasses:=classify_argument(def,vs_value,def.size,classes,0);
                   numclasses:=classify_argument(def,vs_value,def.size,classes,0);
@@ -685,7 +685,7 @@ unit cpupara;
             begin
             begin
               { cdecl array of const need to be ignored and therefor be puhsed
               { cdecl array of const need to be ignored and therefor be puhsed
                 as value parameter with length 0 }
                 as value parameter with length 0 }
-              if ((calloption in [pocall_cdecl,pocall_cppdecl]) and
+              if ((calloption in cdecl_pocalls) and
                   is_array_of_const(def)) or
                   is_array_of_const(def)) or
                  is_dynamic_array(def) then
                  is_dynamic_array(def) then
                 result:=false
                 result:=false

+ 2 - 2
tests/test/cg/tcalcst6.pp

@@ -28,9 +28,9 @@ program tcalcst6;
   {$define tp}
   {$define tp}
 {$endif}
 {$endif}
 
 
-{ On linux/i386 safecall is the same as cdecl, so it does not       }
+{ On linux/i386 and linux/x86-64safecall is the same as cdecl, so it does not       }
 { support all parameter types.                                      }
 { support all parameter types.                                      }
-{$if (defined(linux) and defined(cpui386))}
+{$if (defined(linux) and (defined(cpui386) or defined(cpux86_64)))}
   {$define safecall_is_cdecl}
   {$define safecall_is_cdecl}
 {$endif}
 {$endif}
 
 

+ 2 - 2
tests/test/cg/tcalvar6.pp

@@ -30,9 +30,9 @@ program tcalvar6;
   {$define tp}
   {$define tp}
 {$endif}
 {$endif}
 
 
-{ On linux/i386 safecall is the same as cdecl, so it does not       }
+{ On linux/i386 and linux/x86-64 afecall is the same as cdecl, so it does not       }
 { support all parameter types.                                      }
 { support all parameter types.                                      }
-{$if (defined(linux) and defined(cpui386))}
+{$if (defined(linux) and (defined(cpui386) or defined(cpux86_64)))}
   {$define safecall_is_cdecl}
   {$define safecall_is_cdecl}
 {$endif}
 {$endif}