mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 15:05:58 +02:00
* make test working for architectures with no float and ansistring support
git-svn-id: trunk@35460 -
This commit is contained in:
parent
1c985f0a43
commit
a80fcb74d8
@ -44,8 +44,10 @@ const
|
|||||||
RET_U16BIT = $5555;
|
RET_U16BIT = $5555;
|
||||||
RET_S8BIT = -80;
|
RET_S8BIT = -80;
|
||||||
RET_U8BIT = $AA;
|
RET_U8BIT = $AA;
|
||||||
|
{$ifndef FPUNONE}
|
||||||
RET_SINGLE = 57689.15;
|
RET_SINGLE = 57689.15;
|
||||||
RET_DOUBLE = 100012.345;
|
RET_DOUBLE = 100012.345;
|
||||||
|
{$endif FPUNONE}
|
||||||
PCHAR_STRING: pchar = 'HELLO STRING';
|
PCHAR_STRING: pchar = 'HELLO STRING';
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -93,7 +95,7 @@ var
|
|||||||
gets64bit := RET_S64BIT;
|
gets64bit := RET_S64BIT;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$ifndef FPUNONE}
|
||||||
function gets32real : single;
|
function gets32real : single;
|
||||||
begin
|
begin
|
||||||
gets32real := RET_SINGLE;
|
gets32real := RET_SINGLE;
|
||||||
@ -104,6 +106,7 @@ var
|
|||||||
begin
|
begin
|
||||||
gets64real := RET_DOUBLE;
|
gets64real := RET_DOUBLE;
|
||||||
end;
|
end;
|
||||||
|
{$endif FPUNONE}
|
||||||
|
|
||||||
function getpchar: pchar;
|
function getpchar: pchar;
|
||||||
begin
|
begin
|
||||||
@ -248,7 +251,7 @@ function exit_loc_ref_ordinal_u8bit : byte;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{$ifndef FPUNONE}
|
||||||
function exit_loc_ref_float_s32real : single;
|
function exit_loc_ref_float_s32real : single;
|
||||||
var
|
var
|
||||||
s: single;
|
s: single;
|
||||||
@ -277,6 +280,7 @@ function exit_loc_reg_float_s64real : double;
|
|||||||
begin
|
begin
|
||||||
exit(gets64real);
|
exit(gets64real);
|
||||||
end;
|
end;
|
||||||
|
{$endif FPUNONE}
|
||||||
|
|
||||||
|
|
||||||
function exit_loc_flags : boolean;
|
function exit_loc_flags : boolean;
|
||||||
@ -296,15 +300,14 @@ function exit_loc_jump : boolean;
|
|||||||
exit(b and c);
|
exit(b and c);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
|
||||||
function exit_loc_ansi(w: word) : ansistring;
|
function exit_loc_ansi(w: word) : ansistring;
|
||||||
var d: ansistring;
|
var d: ansistring;
|
||||||
begin
|
begin
|
||||||
str(w,d);
|
str(w,d);
|
||||||
exit(d);
|
exit(d);
|
||||||
end;
|
end;
|
||||||
|
{$endif FPC_HAS_FEATURE_ANSISTRINGS}
|
||||||
|
|
||||||
|
|
||||||
var
|
var
|
||||||
failed : boolean;
|
failed : boolean;
|
||||||
@ -373,6 +376,7 @@ Begin
|
|||||||
else
|
else
|
||||||
writeln('Passed!');
|
writeln('Passed!');
|
||||||
|
|
||||||
|
{$ifndef FPUNONE}
|
||||||
write(' floating point return value...');
|
write(' floating point return value...');
|
||||||
failed := false;
|
failed := false;
|
||||||
if (trunc(exit_loc_ref_float_s32real) <> trunc(RET_SINGLE)) then
|
if (trunc(exit_loc_ref_float_s32real) <> trunc(RET_SINGLE)) then
|
||||||
@ -383,6 +387,7 @@ Begin
|
|||||||
fail
|
fail
|
||||||
else
|
else
|
||||||
writeln('Passed!');
|
writeln('Passed!');
|
||||||
|
{$endif FPUNONE}
|
||||||
|
|
||||||
{ procvardef is not tested since it is the same as pointer return value...}
|
{ procvardef is not tested since it is the same as pointer return value...}
|
||||||
write(' pointer/procedure variable return value...');
|
write(' pointer/procedure variable return value...');
|
||||||
@ -420,6 +425,7 @@ Begin
|
|||||||
else
|
else
|
||||||
writeln('Passed!');
|
writeln('Passed!');
|
||||||
|
|
||||||
|
{$ifndef FPUNONE}
|
||||||
write(' floating point return value...');
|
write(' floating point return value...');
|
||||||
failed := false;
|
failed := false;
|
||||||
if (trunc(exit_loc_reg_float_s32real) <> trunc(RET_SINGLE)) then
|
if (trunc(exit_loc_reg_float_s32real) <> trunc(RET_SINGLE)) then
|
||||||
@ -430,6 +436,7 @@ Begin
|
|||||||
fail
|
fail
|
||||||
else
|
else
|
||||||
writeln('Passed!');
|
writeln('Passed!');
|
||||||
|
{$endif FPUNONE}
|
||||||
|
|
||||||
{ procvardef is not tested since it is the same as pointer return value...}
|
{ procvardef is not tested since it is the same as pointer return value...}
|
||||||
write(' pointer/procedure variable return value...');
|
write(' pointer/procedure variable return value...');
|
||||||
@ -465,6 +472,7 @@ Begin
|
|||||||
else
|
else
|
||||||
writeln('Passed!');
|
writeln('Passed!');
|
||||||
|
|
||||||
|
{$ifdef FPC_HAS_FEATURE_ANSISTRINGS}
|
||||||
write('Testing secondexitn() ansistring case...');
|
write('Testing secondexitn() ansistring case...');
|
||||||
failed := false;
|
failed := false;
|
||||||
if exit_loc_ansi(10) <> '10' then
|
if exit_loc_ansi(10) <> '10' then
|
||||||
@ -473,5 +481,6 @@ Begin
|
|||||||
fail
|
fail
|
||||||
else
|
else
|
||||||
writeln('Passed!');
|
writeln('Passed!');
|
||||||
|
{$endif FPC_HAS_FEATURE_ANSISTRINGS}
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user