* fixed linefeeds

This commit is contained in:
peter 2004-05-02 12:11:44 +00:00
parent 12efb6d19e
commit 87438454b9
20 changed files with 25279 additions and 25214 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -42,7 +42,7 @@ var
begin begin
getint64 := $10000000; getint64 := $10000000;
end; end;
function getint64_2 : int64; function getint64_2 : int64;
var var
i: longint; i: longint;
@ -200,7 +200,10 @@ end.
{ {
$Log$ $Log$
Revision 1.6 2002-09-29 14:37:22 carl Revision 1.7 2004-05-02 12:11:44 peter
* fixed linefeeds
Revision 1.6 2002/09/29 14:37:22 carl
* must more 64-bit testing (to detect endian specific problems) * must more 64-bit testing (to detect endian specific problems)
Revision 1.5 2002/09/27 17:46:01 carl Revision 1.5 2002/09/27 17:46:01 carl

View File

@ -28,7 +28,7 @@
{$endif} {$endif}
{$endif} {$endif}
{$H+} {$H+}
const const
{ exactly 255 characters in length } { exactly 255 characters in length }
@ -48,65 +48,65 @@ const
' aren''t any problems with maximum length strings. I hope you understand'+ ' aren''t any problems with maximum length strings. I hope you understand'+
HUGE_STRING_END; HUGE_STRING_END;
EMPTY_STRING = ''; EMPTY_STRING = '';
type type
shortstr = string[127]; shortstr = string[127];
var var
s2: shortstr; s2: shortstr;
str_ansi: ansistring; str_ansi: ansistring;
str_short: shortstring; str_short: shortstring;
{$ifdef haswidestring} {$ifdef haswidestring}
str_wide : widestring; str_wide : widestring;
{$endif} {$endif}
procedure fail; procedure fail;
begin begin
WriteLn('Failure!'); WriteLn('Failure!');
Halt(1); Halt(1);
end; end;
procedure test_ansi_to_short; procedure test_ansi_to_short;
begin begin
{************************************************************************} {************************************************************************}
{ ansistring -> shortstring } { ansistring -> shortstring }
{************************************************************************} {************************************************************************}
WriteLn('Test ansistring -> shortstring'); WriteLn('Test ansistring -> shortstring');
{ ansistring -> shortstring } { ansistring -> shortstring }
str_short := ''; str_short := '';
str_ansi:=''; str_ansi:='';
str_ansi := SMALL_STRING; str_ansi := SMALL_STRING;
str_short:=str_ansi; str_short:=str_ansi;
Write('small ansistring -> shortstring...'); Write('small ansistring -> shortstring...');
if str_short = str_ansi then if str_short = str_ansi then
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
str_short := ''; str_short := '';
str_ansi:=''; str_ansi:='';
str_ansi := EMPTY_STRING; str_ansi := EMPTY_STRING;
str_short:=str_ansi; str_short:=str_ansi;
Write('empty ansistring -> shortstring...'); Write('empty ansistring -> shortstring...');
if str_short = str_ansi then if str_short = str_ansi then
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
str_short := ''; str_short := '';
str_ansi:=''; str_ansi:='';
str_ansi := BIG_STRING; str_ansi := BIG_STRING;
str_short:=str_ansi; str_short:=str_ansi;
Write('big ansistring -> shortstring...'); Write('big ansistring -> shortstring...');
if str_short = str_ansi then if str_short = str_ansi then
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
Write('huge ansistring -> shortstring...'); Write('huge ansistring -> shortstring...');
str_short := ''; str_short := '';
str_ansi:=''; str_ansi:='';
str_ansi := HUGE_STRING; str_ansi := HUGE_STRING;
@ -121,17 +121,17 @@ begin
str_ansi:=''; str_ansi:='';
str_ansi := SMALL_STRING; str_ansi := SMALL_STRING;
s2:=str_ansi; s2:=str_ansi;
Write('small ansistring -> shortstring...'); Write('small ansistring -> shortstring...');
if s2 = str_ansi then if s2 = str_ansi then
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
s2 := ''; s2 := '';
str_ansi:=''; str_ansi:='';
str_ansi := EMPTY_STRING; str_ansi := EMPTY_STRING;
s2:=str_ansi; s2:=str_ansi;
Write('empty ansistring -> shortstring...'); Write('empty ansistring -> shortstring...');
if s2 = str_ansi then if s2 = str_ansi then
WriteLn('Success.') WriteLn('Success.')
else else
@ -141,18 +141,18 @@ begin
str_ansi:=''; str_ansi:='';
str_ansi := BIG_STRING; str_ansi := BIG_STRING;
s2:=str_ansi; s2:=str_ansi;
Write('big ansistring -> shortstring...'); Write('big ansistring -> shortstring...');
{ Should fail, since comparing different string lengths } { Should fail, since comparing different string lengths }
if s2 <> str_ansi then if s2 <> str_ansi then
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
s2 := ''; s2 := '';
str_ansi:=''; str_ansi:='';
str_ansi := HUGE_STRING; str_ansi := HUGE_STRING;
s2:=str_ansi; s2:=str_ansi;
Write('huge ansistring -> shortstring...'); Write('huge ansistring -> shortstring...');
{ Should fail, since comparing different string lengths } { Should fail, since comparing different string lengths }
if s2 <> str_ansi then if s2 <> str_ansi then
WriteLn('Success.') WriteLn('Success.')
@ -163,9 +163,9 @@ end;
procedure test_short_to_short; procedure test_short_to_short;
begin begin
{************************************************************************} {************************************************************************}
{ shortstring -> shortstring } { shortstring -> shortstring }
{************************************************************************} {************************************************************************}
WriteLn('Test shortstring -> shortstring...'); WriteLn('Test shortstring -> shortstring...');
{ shortstring -> shortstring } { shortstring -> shortstring }
str_short := ''; str_short := '';
@ -177,7 +177,7 @@ begin
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
str_short := ''; str_short := '';
s2:=''; s2:='';
s2 := EMPTY_STRING; s2 := EMPTY_STRING;
@ -222,7 +222,7 @@ begin
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
s2 := ''; s2 := '';
str_short:=''; str_short:='';
str_short := EMPTY_STRING; str_short := EMPTY_STRING;
@ -244,7 +244,7 @@ begin
else else
fail; fail;
{$ifdef fpc} {$ifdef fpc}
s2 := ''; s2 := '';
str_short:=''; str_short:='';
str_short := HUGE_STRING; str_short := HUGE_STRING;
@ -255,17 +255,17 @@ begin
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
{$endif} {$endif}
end; end;
procedure test_short_to_ansi; procedure test_short_to_ansi;
begin begin
{************************************************************************} {************************************************************************}
{ shortstring -> ansistring } { shortstring -> ansistring }
{************************************************************************} {************************************************************************}
WriteLn('Test shortstring -> ansistring'); WriteLn('Test shortstring -> ansistring');
Write('small shortstring -> ansistring...'); Write('small shortstring -> ansistring...');
{ shortstring -> ansistring } { shortstring -> ansistring }
str_short := SMALL_STRING; str_short := SMALL_STRING;
str_ansi:=str_short; str_ansi:=str_short;
@ -273,8 +273,8 @@ begin
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
Write('empty shortstring -> ansistring...'); Write('empty shortstring -> ansistring...');
str_short := EMPTY_STRING; str_short := EMPTY_STRING;
str_ansi:=str_short; str_ansi:=str_short;
if str_short = str_ansi then if str_short = str_ansi then
@ -282,7 +282,7 @@ begin
else else
fail; fail;
Write('big shortstring -> ansistring...'); Write('big shortstring -> ansistring...');
str_short := BIG_STRING; str_short := BIG_STRING;
str_ansi:=str_short; str_ansi:=str_short;
if str_short = str_ansi then if str_short = str_ansi then
@ -290,7 +290,7 @@ begin
else else
fail; fail;
Write('small shortstring -> ansistring...'); Write('small shortstring -> ansistring...');
{ shortstring -> ansistring } { shortstring -> ansistring }
s2 := SMALL_STRING; s2 := SMALL_STRING;
str_ansi:=s2; str_ansi:=s2;
@ -298,8 +298,8 @@ begin
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
Write('empty shortstring -> ansistring...'); Write('empty shortstring -> ansistring...');
s2 := EMPTY_STRING; s2 := EMPTY_STRING;
str_ansi:=s2; str_ansi:=s2;
if s2 = str_ansi then if s2 = str_ansi then
@ -313,11 +313,11 @@ end;
{$ifdef haswidestring} {$ifdef haswidestring}
procedure test_wide_to_ansi; procedure test_wide_to_ansi;
begin begin
{************************************************************************} {************************************************************************}
{ widestring -> ansistring } { widestring -> ansistring }
{************************************************************************} {************************************************************************}
WriteLn('Test widestring -> ansistring'); WriteLn('Test widestring -> ansistring');
Write('small widestring -> ansistring...'); Write('small widestring -> ansistring...');
{ widestring -> ansistring } { widestring -> ansistring }
str_wide := SMALL_STRING; str_wide := SMALL_STRING;
str_ansi:=str_wide; str_ansi:=str_wide;
@ -325,8 +325,8 @@ begin
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
Write('empty widestring -> ansistring...'); Write('empty widestring -> ansistring...');
str_wide := EMPTY_STRING; str_wide := EMPTY_STRING;
str_ansi:=str_wide; str_ansi:=str_wide;
if str_wide = str_ansi then if str_wide = str_ansi then
@ -334,7 +334,7 @@ begin
else else
fail; fail;
Write('big widestring -> ansistring...'); Write('big widestring -> ansistring...');
str_wide := BIG_STRING; str_wide := BIG_STRING;
str_ansi:=str_wide; str_ansi:=str_wide;
if str_wide = str_ansi then if str_wide = str_ansi then
@ -342,7 +342,7 @@ begin
else else
fail; fail;
Write('huge widestring -> ansistring...'); Write('huge widestring -> ansistring...');
str_wide := HUGE_STRING; str_wide := HUGE_STRING;
str_ansi:=str_wide; str_ansi:=str_wide;
if str_wide = str_ansi then if str_wide = str_ansi then
@ -356,11 +356,11 @@ end;
procedure test_short_to_wide; procedure test_short_to_wide;
begin begin
{************************************************************************} {************************************************************************}
{ shortstring -> widestring } { shortstring -> widestring }
{************************************************************************} {************************************************************************}
WriteLn('Test shortstring -> widestring'); WriteLn('Test shortstring -> widestring');
Write('small shortstring -> widestring...'); Write('small shortstring -> widestring...');
{ shortstring -> widestring } { shortstring -> widestring }
str_short := SMALL_STRING; str_short := SMALL_STRING;
str_wide:=str_short; str_wide:=str_short;
@ -368,8 +368,8 @@ begin
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
Write('empty shortstring -> widestring...'); Write('empty shortstring -> widestring...');
str_short := EMPTY_STRING; str_short := EMPTY_STRING;
str_wide:=str_short; str_wide:=str_short;
if str_short = str_wide then if str_short = str_wide then
@ -377,7 +377,7 @@ begin
else else
fail; fail;
Write('big shortstring -> widestring...'); Write('big shortstring -> widestring...');
str_short := BIG_STRING; str_short := BIG_STRING;
str_wide:=str_short; str_wide:=str_short;
if str_short = str_wide then if str_short = str_wide then
@ -385,7 +385,7 @@ begin
else else
fail; fail;
Write('small shortstring -> widestring...'); Write('small shortstring -> widestring...');
{ shortstring -> widestring } { shortstring -> widestring }
s2 := SMALL_STRING; s2 := SMALL_STRING;
str_wide:=s2; str_wide:=s2;
@ -393,8 +393,8 @@ begin
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
Write('empty shortstring -> widestring...'); Write('empty shortstring -> widestring...');
s2 := EMPTY_STRING; s2 := EMPTY_STRING;
str_wide:=s2; str_wide:=s2;
if s2 = str_wide then if s2 = str_wide then
@ -407,11 +407,11 @@ end;
procedure test_ansi_to_wide; procedure test_ansi_to_wide;
begin begin
{************************************************************************} {************************************************************************}
{ ansistring -> widestring } { ansistring -> widestring }
{************************************************************************} {************************************************************************}
WriteLn('Test ansistring -> widestring'); WriteLn('Test ansistring -> widestring');
Write('small ansistring -> widestring...'); Write('small ansistring -> widestring...');
{ ansistring -> widestring } { ansistring -> widestring }
str_ansi := SMALL_STRING; str_ansi := SMALL_STRING;
str_wide:=str_ansi; str_wide:=str_ansi;
@ -419,8 +419,8 @@ begin
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
Write('empty ansistring -> widestring...'); Write('empty ansistring -> widestring...');
str_ansi := EMPTY_STRING; str_ansi := EMPTY_STRING;
str_wide:=str_ansi; str_wide:=str_ansi;
if str_ansi = str_wide then if str_ansi = str_wide then
@ -428,7 +428,7 @@ begin
else else
fail; fail;
Write('big ansistring -> widestring...'); Write('big ansistring -> widestring...');
str_ansi := BIG_STRING; str_ansi := BIG_STRING;
str_wide:=str_ansi; str_wide:=str_ansi;
if str_ansi = str_wide then if str_ansi = str_wide then
@ -436,7 +436,7 @@ begin
else else
fail; fail;
Write('small ansistring -> widestring...'); Write('small ansistring -> widestring...');
{ ansistring -> widestring } { ansistring -> widestring }
s2 := SMALL_STRING; s2 := SMALL_STRING;
str_wide:=s2; str_wide:=s2;
@ -444,8 +444,8 @@ begin
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
Write('empty ansistring -> widestring...'); Write('empty ansistring -> widestring...');
s2 := EMPTY_STRING; s2 := EMPTY_STRING;
str_wide:=s2; str_wide:=s2;
if s2 = str_wide then if s2 = str_wide then
@ -459,33 +459,33 @@ end;
procedure test_wide_to_short; procedure test_wide_to_short;
begin begin
{************************************************************************} {************************************************************************}
{ widestring -> shortstring } { widestring -> shortstring }
{************************************************************************} {************************************************************************}
WriteLn('Test widestring -> shortstring'); WriteLn('Test widestring -> shortstring');
{ widestring -> shortstring } { widestring -> shortstring }
str_short := ''; str_short := '';
str_wide:=''; str_wide:='';
str_wide := SMALL_STRING; str_wide := SMALL_STRING;
Write('small widestring -> shortstring...'); Write('small widestring -> shortstring...');
str_short:=str_wide;
if str_short = str_wide then
WriteLn('Success.')
else
fail;
str_short := '';
str_wide:='';
str_wide := EMPTY_STRING;
Write('empty widestring -> shortstring...');
str_short:=str_wide; str_short:=str_wide;
if str_short = str_wide then if str_short = str_wide then
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
str_short := '';
Write('big widestring -> shortstring...'); str_wide:='';
str_wide := EMPTY_STRING;
Write('empty widestring -> shortstring...');
str_short:=str_wide;
if str_short = str_wide then
WriteLn('Success.')
else
fail;
Write('big widestring -> shortstring...');
str_short := ''; str_short := '';
str_wide:=''; str_wide:='';
str_wide := BIG_STRING; str_wide := BIG_STRING;
@ -495,16 +495,16 @@ begin
else else
fail; fail;
Write('huge widestring -> shortstring...'); Write('huge widestring -> shortstring...');
str_wide := HUGE_STRING; str_wide := HUGE_STRING;
str_short:=str_wide; str_short:=str_wide;
if str_short <> str_wide then if str_short <> str_wide then
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
{} {}
Write('small widestring -> shortstring...'); Write('small widestring -> shortstring...');
s2 := ''; s2 := '';
str_wide:=''; str_wide:='';
str_wide := SMALL_STRING; str_wide := SMALL_STRING;
@ -513,8 +513,8 @@ begin
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
Write('empty widestring -> shortstring...'); Write('empty widestring -> shortstring...');
s2 := ''; s2 := '';
str_wide:=''; str_wide:='';
str_wide := EMPTY_STRING; str_wide := EMPTY_STRING;
@ -524,7 +524,7 @@ begin
else else
fail; fail;
Write('big widestring -> shortstring...'); Write('big widestring -> shortstring...');
s2 := ''; s2 := '';
str_wide:=''; str_wide:='';
str_wide := BIG_STRING; str_wide := BIG_STRING;
@ -533,8 +533,8 @@ begin
WriteLn('Success.') WriteLn('Success.')
else else
fail; fail;
Write('huge widestring -> shortstring...'); Write('huge widestring -> shortstring...');
s2 := ''; s2 := '';
str_wide:=''; str_wide:='';
str_wide := HUGE_STRING; str_wide := HUGE_STRING;
@ -551,17 +551,20 @@ Begin
test_short_to_short; test_short_to_short;
test_short_to_ansi; test_short_to_ansi;
{ requires widestring support } { requires widestring support }
{$ifdef haswidestring} {$ifdef haswidestring}
test_short_to_wide; test_short_to_wide;
test_ansi_to_wide; test_ansi_to_wide;
test_wide_to_short; test_wide_to_short;
test_wide_to_ansi; test_wide_to_ansi;
{$endif} {$endif}
End. End.
{ {
$Log$ $Log$
Revision 1.3 2002-10-02 19:26:49 carl Revision 1.4 2004-05-02 12:11:44 peter
* fixed linefeeds
Revision 1.3 2002/10/02 19:26:49 carl
+ added much much more testing of different string types + added much much more testing of different string types
* str() format depends on size of real * str() format depends on size of real

View File

@ -26,10 +26,10 @@ procedure fail;
var var
str_ansi : ansistring; str_ansi : ansistring;
str_short : shortstring; str_short : shortstring;
{$ifdef haswidestring} {$ifdef haswidestring}
str_wide : widestring; str_wide : widestring;
wc : widechar; wc : widechar;
{$endif haswidestring} {$endif haswidestring}
c: char; c: char;
_result : boolean; _result : boolean;
Begin Begin
@ -40,7 +40,7 @@ Begin
{ empty string -> shortstring } { empty string -> shortstring }
str_short := ''; str_short := '';
if str_short <> '' then if str_short <> '' then
_result := false; _result := false;
{ constant char -> shortstring } { constant char -> shortstring }
str_short := 'c'; str_short := 'c';
if str_short <> 'c' then if str_short <> 'c' then
@ -52,12 +52,12 @@ Begin
if str_short <> 'c' then if str_short <> 'c' then
_result := false; _result := false;
{* wide char *} {* wide char *}
{$ifdef haswidestring} {$ifdef haswidestring}
{ constant char -> shortstring } { constant char -> shortstring }
str_short := shortstring(widechar('c')); str_short := shortstring(widechar('c'));
if str_short <> 'c' then if str_short <> 'c' then
_result := false; _result := false;
{$endif} {$endif}
{ wide char -> shortstring } { wide char -> shortstring }
{ This should not compile - at least it does not compile under Delphi } { This should not compile - at least it does not compile under Delphi }
{ str_short := ''; { str_short := '';
@ -65,8 +65,8 @@ Begin
str_short:=wc; str_short:=wc;
if str_short <> 'c' then if str_short <> 'c' then
_result := false;} _result := false;}
if _result then if _result then
WriteLn('Success!') WriteLn('Success!')
else else
@ -78,7 +78,7 @@ Begin
{ empty string -> ansistring } { empty string -> ansistring }
str_ansi := ''; str_ansi := '';
if str_ansi <> '' then if str_ansi <> '' then
_result := false; _result := false;
{ constant char -> ansistring } { constant char -> ansistring }
str_ansi := 'c'; str_ansi := 'c';
if str_ansi <> 'c' then if str_ansi <> 'c' then
@ -90,7 +90,7 @@ Begin
if str_ansi <> 'c' then if str_ansi <> 'c' then
_result := false; _result := false;
{* wide char *} {* wide char *}
{$ifdef haswidestring} {$ifdef haswidestring}
{ constant char -> ansistring } { constant char -> ansistring }
str_ansi := widechar('c'); str_ansi := widechar('c');
if str_ansi <> 'c' then if str_ansi <> 'c' then
@ -101,14 +101,14 @@ Begin
str_ansi:=wc; str_ansi:=wc;
if str_ansi <> 'c' then if str_ansi <> 'c' then
_result := false; _result := false;
{$endif} {$endif}
if _result then if _result then
WriteLn('Success!') WriteLn('Success!')
else else
fail; fail;
{} {}
{$ifdef haswidestring} {$ifdef haswidestring}
{********************** char/widechar -> widestring *******************} {********************** char/widechar -> widestring *******************}
Write('widechar/char -> widestring...'); Write('widechar/char -> widestring...');
{* normal char *} {* normal char *}
@ -116,7 +116,7 @@ Begin
{ empty string -> widestring } { empty string -> widestring }
str_wide := ''; str_wide := '';
if str_wide <> '' then if str_wide <> '' then
_result := false; _result := false;
{ constant char -> widestring } { constant char -> widestring }
str_wide := 'c'; str_wide := 'c';
if str_wide <> 'c' then if str_wide <> 'c' then
@ -138,8 +138,8 @@ Begin
str_wide:=wc; str_wide:=wc;
if str_wide <> 'c' then if str_wide <> 'c' then
_result := false; _result := false;
if _result then if _result then
WriteLn('Success!') WriteLn('Success!')
else else

View File

@ -27,7 +27,7 @@ var
int64res : int64; int64res : int64;
int64cnt : int64; int64cnt : int64;
begin begin
{ RIGHT : LOC_REFERENCE } { RIGHT : LOC_REFERENCE }
{ LEFT : LOC_REGISTER } { LEFT : LOC_REGISTER }
int64res := 1; int64res := 1;
@ -36,7 +36,10 @@ begin
end. end.
{ {
$Log$ $Log$
Revision 1.1 2002-09-21 13:28:06 carl Revision 1.2 2004-05-02 12:11:44 peter
* fixed linefeeds
Revision 1.1 2002/09/21 13:28:06 carl
+ division by zero testing + division by zero testing
} }

View File

@ -25,14 +25,17 @@ var
longres : longint; longres : longint;
longcnt : longint; longcnt : longint;
begin begin
longres := 1; longres := 1;
longcnt := 0; longcnt := 0;
longres := longres div longcnt; longres := longres div longcnt;
end. end.
{ {
$Log$ $Log$
Revision 1.1 2002-09-21 13:28:06 carl Revision 1.2 2004-05-02 12:11:44 peter
* fixed linefeeds
Revision 1.1 2002/09/21 13:28:06 carl
+ division by zero testing + division by zero testing
} }

17
tests/test/cg/tpara1.pp Normal file
View File

@ -0,0 +1,17 @@
function f(l1,l2,l3,l4,l5,l6,l7,l8:longint):longint;
begin
f:=l1+l2+l3+l4+l5+l6+l7+l8;
end;
var
l : longint;
begin
l:=f(f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8),f(1,2,3,4,5,6,7,8));
writeln('Got ',l,' expected ',8*(1+2+3+4+5+6+7+8));
if l<>8*(1+2+3+4+5+6+7+8) then
begin
writeln('Error!');
halt(1);
end;
end.

View File

@ -10,7 +10,7 @@ var
value : longint; value : longint;
begin begin
value:=1; value:=1;
getint64_1 := int64(value) shl 40; getint64_1 := int64(value) shl 40;
end; end;
function getint64_2 : int64; function getint64_2 : int64;
@ -18,7 +18,7 @@ var
value : longint; value : longint;
begin begin
value:=65535; value:=65535;
getint64_2 := value; getint64_2 := value;
end; end;
procedure test_rwtext; procedure test_rwtext;
@ -65,7 +65,7 @@ begin
a := 'this is an ansistring'; a := 'this is an ansistring';
writeln(a); writeln(a);
vl:=getint64_1; vl:=getint64_1;
vl1:=getint64_2; vl1:=getint64_2;
writeln('int64 test : ',vl, ' ',vl1); writeln('int64 test : ',vl, ' ',vl1);

View File

@ -251,7 +251,7 @@ Begin
int64res := int64res shl int64cnt; int64res := int64res shl int64cnt;
Write('(SHL) Value should be -32768...'); Write('(SHL) Value should be -32768...');
test(int64res, -32768); test(int64res, -32768);
int64res := 1; int64res := 1;
int64cnt := 33; int64cnt := 33;
int64res := int64res shl int64cnt; int64res := int64res shl int64cnt;
@ -282,7 +282,7 @@ Begin
{ left : LOC_REFERENCE } { left : LOC_REFERENCE }
{ right : LOC_REGISRER } { right : LOC_REGISRER }
{ {
WriteLn('(left) : LOC_REFERENCE; (right) : LOC_REGISTER'); WriteLn('(left) : LOC_REFERENCE; (right) : LOC_REGISTER');
int64res := 1; int64res := 1;
bytecnt := -2; bytecnt := -2;
@ -317,14 +317,14 @@ Begin
int64res := int64res shr bytecnt; int64res := int64res shr bytecnt;
Write('(SHR) Value should be 1...'); Write('(SHR) Value should be 1...');
test(int64res, 1); test(int64res, 1);
int64res := 1; int64res := 1;
bytecnt := 33; bytecnt := 33;
int64res := int64res shl bytecnt; int64res := int64res shl bytecnt;
Write('(SHL) Value should be 2 in high longint (85899345)...'); Write('(SHL) Value should be 2 in high longint (85899345)...');
move(int64res,int64rec, sizeof(int64)); move(int64res,int64rec, sizeof(int64));
test(int64rec.highval, 2); test(int64rec.highval, 2);
{ int64res:=-1; { int64res:=-1;
bytecnt := 15; bytecnt := 15;
int64res := int64res shr bytecnt; int64res := int64res shr bytecnt;
@ -335,7 +335,10 @@ end.
{ {
$Log$ $Log$
Revision 1.7 2003-12-07 11:59:44 jonas Revision 1.8 2004-05-02 12:11:44 peter
* fixed linefeeds
Revision 1.7 2003/12/07 11:59:44 jonas
* test procedure uses 64bit arguments under FPC * test procedure uses 64bit arguments under FPC
- disabled tests with negative shift counts (illegal) - disabled tests with negative shift counts (illegal)

View File

@ -64,7 +64,7 @@ begin
{ for more in-depth tests of str_real, see ../tstreal[1,2].pp } { for more in-depth tests of str_real, see ../tstreal[1,2].pp }
f := -1.12345; f := -1.12345;
{$IFOPT E-} {$IFOPT E-}
str(f,s); str(f,s);
if (sizeof(extended) = 10) or if (sizeof(extended) = 10) or
(sizeof(extended) = 12) then (sizeof(extended) = 12) then
@ -73,7 +73,7 @@ begin
check('-1.12345000000000E+000') check('-1.12345000000000E+000')
else else
check('error, not yet implemented!!!!'); check('error, not yet implemented!!!!');
{$endif} {$endif}
{ the number of exponents depends on the maaping of the real type } { the number of exponents depends on the maaping of the real type }
if sizeof(real) = 8 then if sizeof(real) = 8 then
begin begin
@ -248,7 +248,7 @@ begin
{ for more in-depth tests of str_real, see ../tstreal[1,2].pp } { for more in-depth tests of str_real, see ../tstreal[1,2].pp }
f := -1.12345; f := -1.12345;
{$IFOPT E-} {$IFOPT E-}
str(f,s); str(f,s);
if (sizeof(extended) = 10) or if (sizeof(extended) = 10) or
(sizeof(extended) = 12) then (sizeof(extended) = 12) then
@ -257,7 +257,7 @@ begin
check('-1.12345000000000E+000') check('-1.12345000000000E+000')
else else
check('error, not yet implemented!!!!'); check('error, not yet implemented!!!!');
{$endif} {$endif}
{ the number of exponents depends on the maaping of the real type } { the number of exponents depends on the maaping of the real type }
if sizeof(real) = 8 then if sizeof(real) = 8 then
begin begin
@ -433,7 +433,7 @@ begin
{ for more in-depth tests of str_real, see ../tstreal[1,2].pp } { for more in-depth tests of str_real, see ../tstreal[1,2].pp }
f := -1.12345; f := -1.12345;
{$IFOPT E-} {$IFOPT E-}
str(f,s); str(f,s);
if sizeof(extended) = 10 then if sizeof(extended) = 10 then
check('-1.123450000000000E+000') check('-1.123450000000000E+000')
@ -441,7 +441,7 @@ begin
check('-1.12345000000000E+000') check('-1.12345000000000E+000')
else else
check('error, not yet implemented!!!!'); check('error, not yet implemented!!!!');
{$endif} {$endif}
{ the number of exponents depends on the maaping of the real type } { the number of exponents depends on the maaping of the real type }
if sizeof(real) = 8 then if sizeof(real) = 8 then
begin begin