|
@@ -1,3 +1,5 @@
|
|
|
|
+{ %version=1.1 }
|
|
|
|
+
|
|
{****************************************************************}
|
|
{****************************************************************}
|
|
{ CODE GENERATOR TEST PROGRAM }
|
|
{ CODE GENERATOR TEST PROGRAM }
|
|
{ By Carl Eric Codere }
|
|
{ By Carl Eric Codere }
|
|
@@ -15,7 +17,7 @@
|
|
{ FPC = Target is FreePascal compiler }
|
|
{ FPC = Target is FreePascal compiler }
|
|
{****************************************************************}
|
|
{****************************************************************}
|
|
{ REMARKS: This tests a subset of the secondcalln() node }
|
|
{ REMARKS: This tests a subset of the secondcalln() node }
|
|
- { (function return values with popstack calling cnvs) }
|
|
|
|
|
|
+ { (function return values with oldfpcall calling cnvs) }
|
|
{ (also tests nested routines up to 2 level deep) }
|
|
{ (also tests nested routines up to 2 level deep) }
|
|
{****************************************************************}
|
|
{****************************************************************}
|
|
program tcalfun4;
|
|
program tcalfun4;
|
|
@@ -189,7 +191,7 @@
|
|
{********************************* FUNCTION RESULTS *************************}
|
|
{********************************* FUNCTION RESULTS *************************}
|
|
|
|
|
|
{ LOC_MEM return values }
|
|
{ LOC_MEM return values }
|
|
-function func_array: tsmallarray;popstack;
|
|
|
|
|
|
+function func_array: tsmallarray;oldfpcall;
|
|
var
|
|
var
|
|
smallarray: tsmallarray;
|
|
smallarray: tsmallarray;
|
|
begin
|
|
begin
|
|
@@ -199,7 +201,7 @@ function func_array: tsmallarray;popstack;
|
|
func_array := smallarray;
|
|
func_array := smallarray;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_largerecord: tlargerecord;popstack;
|
|
|
|
|
|
+function func_largerecord: tlargerecord;oldfpcall;
|
|
var
|
|
var
|
|
largerecord : tlargerecord;
|
|
largerecord : tlargerecord;
|
|
begin
|
|
begin
|
|
@@ -209,12 +211,12 @@ function func_largerecord: tlargerecord;popstack;
|
|
func_largerecord := largerecord;
|
|
func_largerecord := largerecord;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_shortstring: shortstring;popstack;
|
|
|
|
|
|
+function func_shortstring: shortstring;oldfpcall;
|
|
begin
|
|
begin
|
|
func_shortstring := RESULT_BIGSTRING;
|
|
func_shortstring := RESULT_BIGSTRING;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_largeset : tlargeset;popstack;
|
|
|
|
|
|
+function func_largeset : tlargeset;oldfpcall;
|
|
var
|
|
var
|
|
largeset : tlargeset;
|
|
largeset : tlargeset;
|
|
begin
|
|
begin
|
|
@@ -222,49 +224,49 @@ function func_largeset : tlargeset;popstack;
|
|
func_largeset := largeset;
|
|
func_largeset := largeset;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_u8bit : byte;popstack;
|
|
|
|
|
|
+function func_u8bit : byte;oldfpcall;
|
|
begin
|
|
begin
|
|
func_u8bit := RESULT_U8BIT;
|
|
func_u8bit := RESULT_U8BIT;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_u16bit : word;popstack;
|
|
|
|
|
|
+function func_u16bit : word;oldfpcall;
|
|
begin
|
|
begin
|
|
func_u16bit := RESULT_U16BIT;
|
|
func_u16bit := RESULT_U16BIT;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_s32bit : longint;popstack;
|
|
|
|
|
|
+function func_s32bit : longint;oldfpcall;
|
|
begin
|
|
begin
|
|
func_s32bit := RESULT_S32BIT;
|
|
func_s32bit := RESULT_S32BIT;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_s64bit : int64;popstack;
|
|
|
|
|
|
+function func_s64bit : int64;oldfpcall;
|
|
begin
|
|
begin
|
|
func_s64bit := RESULT_S64BIT;
|
|
func_s64bit := RESULT_S64BIT;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_s32real : single;popstack;
|
|
|
|
|
|
+function func_s32real : single;oldfpcall;
|
|
begin
|
|
begin
|
|
func_s32real := RESULT_S32REAL;
|
|
func_s32real := RESULT_S32REAL;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_s64real : double;popstack;
|
|
|
|
|
|
+function func_s64real : double;oldfpcall;
|
|
begin
|
|
begin
|
|
func_s64real := RESULT_S64REAl;
|
|
func_s64real := RESULT_S64REAl;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_ansistring : ansistring;popstack;
|
|
|
|
|
|
+function func_ansistring : ansistring;oldfpcall;
|
|
begin
|
|
begin
|
|
func_ansistring := RESULT_BIGSTRING;
|
|
func_ansistring := RESULT_BIGSTRING;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_pchar : pchar;popstack;
|
|
|
|
|
|
+function func_pchar : pchar;oldfpcall;
|
|
begin
|
|
begin
|
|
func_pchar := RESULT_PCHAR;
|
|
func_pchar := RESULT_PCHAR;
|
|
end;
|
|
end;
|
|
|
|
|
|
{************************** FUNCTION RESULT WITH PARAMS ******************}
|
|
{************************** FUNCTION RESULT WITH PARAMS ******************}
|
|
{ LOC_MEM return values }
|
|
{ LOC_MEM return values }
|
|
-function func_array_mixed(b: byte): tsmallarray;popstack;
|
|
|
|
|
|
+function func_array_mixed(b: byte): tsmallarray;oldfpcall;
|
|
var
|
|
var
|
|
local_b: byte;
|
|
local_b: byte;
|
|
smallarray: tsmallarray;
|
|
smallarray: tsmallarray;
|
|
@@ -277,7 +279,7 @@ function func_array_mixed(b: byte): tsmallarray;popstack;
|
|
global_u8bit := b;
|
|
global_u8bit := b;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_largerecord_mixed(b: byte): tlargerecord;popstack;
|
|
|
|
|
|
+function func_largerecord_mixed(b: byte): tlargerecord;oldfpcall;
|
|
var
|
|
var
|
|
local_b: byte;
|
|
local_b: byte;
|
|
largerecord : tlargerecord;
|
|
largerecord : tlargerecord;
|
|
@@ -290,7 +292,7 @@ function func_largerecord_mixed(b: byte): tlargerecord;popstack;
|
|
global_u8bit := b;
|
|
global_u8bit := b;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_shortstring_mixed(b: byte): shortstring;popstack;
|
|
|
|
|
|
+function func_shortstring_mixed(b: byte): shortstring;oldfpcall;
|
|
var
|
|
var
|
|
local_b: byte;
|
|
local_b: byte;
|
|
begin
|
|
begin
|
|
@@ -299,7 +301,7 @@ function func_shortstring_mixed(b: byte): shortstring;popstack;
|
|
global_u8bit := b;
|
|
global_u8bit := b;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_largeset_mixed(b: byte) : tlargeset;popstack;
|
|
|
|
|
|
+function func_largeset_mixed(b: byte) : tlargeset;oldfpcall;
|
|
var
|
|
var
|
|
local_b: byte;
|
|
local_b: byte;
|
|
largeset : tlargeset;
|
|
largeset : tlargeset;
|
|
@@ -310,7 +312,7 @@ function func_largeset_mixed(b: byte) : tlargeset;popstack;
|
|
global_u8bit := b;
|
|
global_u8bit := b;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_u8bit_mixed(b: byte) : byte;popstack;
|
|
|
|
|
|
+function func_u8bit_mixed(b: byte) : byte;oldfpcall;
|
|
var
|
|
var
|
|
local_b: byte;
|
|
local_b: byte;
|
|
begin
|
|
begin
|
|
@@ -319,7 +321,7 @@ function func_u8bit_mixed(b: byte) : byte;popstack;
|
|
global_u8bit := b;
|
|
global_u8bit := b;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_u16bit_mixed(b: byte) : word;popstack;
|
|
|
|
|
|
+function func_u16bit_mixed(b: byte) : word;oldfpcall;
|
|
var
|
|
var
|
|
local_b: byte;
|
|
local_b: byte;
|
|
begin
|
|
begin
|
|
@@ -328,7 +330,7 @@ function func_u16bit_mixed(b: byte) : word;popstack;
|
|
global_u8bit := b;
|
|
global_u8bit := b;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_s32bit_mixed(b: byte) : longint;popstack;
|
|
|
|
|
|
+function func_s32bit_mixed(b: byte) : longint;oldfpcall;
|
|
var
|
|
var
|
|
local_b: byte;
|
|
local_b: byte;
|
|
begin
|
|
begin
|
|
@@ -337,7 +339,7 @@ function func_s32bit_mixed(b: byte) : longint;popstack;
|
|
global_u8bit := b;
|
|
global_u8bit := b;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_s64bit_mixed(b: byte) : int64;popstack;
|
|
|
|
|
|
+function func_s64bit_mixed(b: byte) : int64;oldfpcall;
|
|
var
|
|
var
|
|
local_b: byte;
|
|
local_b: byte;
|
|
begin
|
|
begin
|
|
@@ -346,7 +348,7 @@ function func_s64bit_mixed(b: byte) : int64;popstack;
|
|
global_u8bit := b;
|
|
global_u8bit := b;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_s32real_mixed(b: byte) : single;popstack;
|
|
|
|
|
|
+function func_s32real_mixed(b: byte) : single;oldfpcall;
|
|
var
|
|
var
|
|
local_b: byte;
|
|
local_b: byte;
|
|
begin
|
|
begin
|
|
@@ -355,7 +357,7 @@ function func_s32real_mixed(b: byte) : single;popstack;
|
|
global_u8bit := b;
|
|
global_u8bit := b;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_s64real_mixed(b: byte) : double;popstack;
|
|
|
|
|
|
+function func_s64real_mixed(b: byte) : double;oldfpcall;
|
|
var
|
|
var
|
|
local_b: byte;
|
|
local_b: byte;
|
|
begin
|
|
begin
|
|
@@ -364,7 +366,7 @@ function func_s64real_mixed(b: byte) : double;popstack;
|
|
global_u8bit := b;
|
|
global_u8bit := b;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_ansistring_mixed(b: byte) : ansistring;popstack;
|
|
|
|
|
|
+function func_ansistring_mixed(b: byte) : ansistring;oldfpcall;
|
|
var
|
|
var
|
|
local_b: byte;
|
|
local_b: byte;
|
|
begin
|
|
begin
|
|
@@ -373,7 +375,7 @@ function func_ansistring_mixed(b: byte) : ansistring;popstack;
|
|
global_u8bit := b;
|
|
global_u8bit := b;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_pchar_mixed(b: byte) : pchar;popstack;
|
|
|
|
|
|
+function func_pchar_mixed(b: byte) : pchar;oldfpcall;
|
|
var
|
|
var
|
|
local_b: byte;
|
|
local_b: byte;
|
|
begin
|
|
begin
|
|
@@ -384,7 +386,7 @@ function func_pchar_mixed(b: byte) : pchar;popstack;
|
|
|
|
|
|
{********************* FUNCTION RESULT WITH PARAMS (NESTED) ******************}
|
|
{********************* FUNCTION RESULT WITH PARAMS (NESTED) ******************}
|
|
{ LOC_MEM return values }
|
|
{ LOC_MEM return values }
|
|
-function func_array_mixed_nested(b: byte): tsmallarray;popstack;
|
|
|
|
|
|
+function func_array_mixed_nested(b: byte): tsmallarray;oldfpcall;
|
|
|
|
|
|
procedure nested_one_proc(l: longint);
|
|
procedure nested_one_proc(l: longint);
|
|
begin
|
|
begin
|
|
@@ -430,7 +432,7 @@ function func_array_mixed_nested(b: byte): tsmallarray;popstack;
|
|
{ nested_one_proc(RESULT_S32BIT);}
|
|
{ nested_one_proc(RESULT_S32BIT);}
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_largerecord_mixed_nested(b: byte): tlargerecord;popstack;
|
|
|
|
|
|
+function func_largerecord_mixed_nested(b: byte): tlargerecord;oldfpcall;
|
|
|
|
|
|
procedure nested_one_proc(l: longint);
|
|
procedure nested_one_proc(l: longint);
|
|
begin
|
|
begin
|
|
@@ -475,7 +477,7 @@ function func_largerecord_mixed_nested(b: byte): tlargerecord;popstack;
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_shortstring_mixed_nested(b: byte): shortstring;popstack;
|
|
|
|
|
|
+function func_shortstring_mixed_nested(b: byte): shortstring;oldfpcall;
|
|
|
|
|
|
procedure nested_one_proc(l: longint);
|
|
procedure nested_one_proc(l: longint);
|
|
begin
|
|
begin
|
|
@@ -515,7 +517,7 @@ function func_shortstring_mixed_nested(b: byte): shortstring;popstack;
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_largeset_mixed_nested(b: byte) : tlargeset;popstack;
|
|
|
|
|
|
+function func_largeset_mixed_nested(b: byte) : tlargeset;oldfpcall;
|
|
|
|
|
|
procedure nested_one_proc(l: longint);
|
|
procedure nested_one_proc(l: longint);
|
|
begin
|
|
begin
|
|
@@ -558,7 +560,7 @@ function func_largeset_mixed_nested(b: byte) : tlargeset;popstack;
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_u8bit_mixed_nested(b: byte) : byte;popstack;
|
|
|
|
|
|
+function func_u8bit_mixed_nested(b: byte) : byte;oldfpcall;
|
|
|
|
|
|
procedure nested_one_proc(l: longint);
|
|
procedure nested_one_proc(l: longint);
|
|
begin
|
|
begin
|
|
@@ -599,7 +601,7 @@ function func_u8bit_mixed_nested(b: byte) : byte;popstack;
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_u16bit_mixed_nested(b: byte) : word;popstack;
|
|
|
|
|
|
+function func_u16bit_mixed_nested(b: byte) : word;oldfpcall;
|
|
|
|
|
|
procedure nested_one_proc(l: longint);
|
|
procedure nested_one_proc(l: longint);
|
|
begin
|
|
begin
|
|
@@ -640,7 +642,7 @@ function func_u16bit_mixed_nested(b: byte) : word;popstack;
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_s32bit_mixed_nested(b: byte) : longint;popstack;
|
|
|
|
|
|
+function func_s32bit_mixed_nested(b: byte) : longint;oldfpcall;
|
|
|
|
|
|
procedure nested_one_proc(l: longint);
|
|
procedure nested_one_proc(l: longint);
|
|
begin
|
|
begin
|
|
@@ -681,7 +683,7 @@ function func_s32bit_mixed_nested(b: byte) : longint;popstack;
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_s64bit_mixed_nested(b: byte) : int64;popstack;
|
|
|
|
|
|
+function func_s64bit_mixed_nested(b: byte) : int64;oldfpcall;
|
|
|
|
|
|
procedure nested_one_proc(l: longint);
|
|
procedure nested_one_proc(l: longint);
|
|
begin
|
|
begin
|
|
@@ -722,7 +724,7 @@ function func_s64bit_mixed_nested(b: byte) : int64;popstack;
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_s32real_mixed_nested(b: byte) : single;popstack;
|
|
|
|
|
|
+function func_s32real_mixed_nested(b: byte) : single;oldfpcall;
|
|
|
|
|
|
procedure nested_one_proc(l: longint);
|
|
procedure nested_one_proc(l: longint);
|
|
begin
|
|
begin
|
|
@@ -763,7 +765,7 @@ function func_s32real_mixed_nested(b: byte) : single;popstack;
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_s64real_mixed_nested(b: byte) : double;popstack;
|
|
|
|
|
|
+function func_s64real_mixed_nested(b: byte) : double;oldfpcall;
|
|
|
|
|
|
procedure nested_one_proc(l: longint);
|
|
procedure nested_one_proc(l: longint);
|
|
begin
|
|
begin
|
|
@@ -804,7 +806,7 @@ function func_s64real_mixed_nested(b: byte) : double;popstack;
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_ansistring_mixed_nested(b: byte) : ansistring;popstack;
|
|
|
|
|
|
+function func_ansistring_mixed_nested(b: byte) : ansistring;oldfpcall;
|
|
|
|
|
|
procedure nested_one_proc(l: longint);
|
|
procedure nested_one_proc(l: longint);
|
|
begin
|
|
begin
|
|
@@ -845,7 +847,7 @@ function func_ansistring_mixed_nested(b: byte) : ansistring;popstack;
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
global_u8bit := nested_one_func(local_b, RESULT_BIGSTRING);
|
|
end;
|
|
end;
|
|
|
|
|
|
-function func_pchar_mixed_nested(b: byte) : pchar;popstack;
|
|
|
|
|
|
+function func_pchar_mixed_nested(b: byte) : pchar;oldfpcall;
|
|
|
|
|
|
procedure nested_one_proc(l: longint);
|
|
procedure nested_one_proc(l: longint);
|
|
begin
|
|
begin
|
|
@@ -1402,7 +1404,10 @@ end.
|
|
|
|
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.4 2003-04-22 10:24:29 florian
|
|
|
|
|
|
+ Revision 1.5 2003-10-03 14:46:37 peter
|
|
|
|
+ * popstack to oldfpccall
|
|
|
|
+
|
|
|
|
+ Revision 1.4 2003/04/22 10:24:29 florian
|
|
* fixed defines for powerpc
|
|
* fixed defines for powerpc
|
|
|
|
|
|
Revision 1.3 2002/09/07 15:40:51 peter
|
|
Revision 1.3 2002/09/07 15:40:51 peter
|