mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 12:10:36 +02:00
+ secondderef()
This commit is contained in:
parent
b6d1844004
commit
d93055b1af
64
tests/test/cg/tderef.pp
Normal file
64
tests/test/cg/tderef.pp
Normal file
@ -0,0 +1,64 @@
|
||||
{****************************************************************}
|
||||
{ CODE GENERATOR TEST PROGRAM }
|
||||
{****************************************************************}
|
||||
{ NODE TESTED : secondderef() }
|
||||
{****************************************************************}
|
||||
{ PRE-REQUISITES: secondload() }
|
||||
{ secondassign() }
|
||||
{ secondcalln() }
|
||||
{ secondadd() }
|
||||
{ secondtypeconv() }
|
||||
{****************************************************************}
|
||||
{ DEFINES: }
|
||||
{****************************************************************}
|
||||
{ REMARKS: }
|
||||
{****************************************************************}
|
||||
program tderef;
|
||||
|
||||
type
|
||||
plongint = ^longint;
|
||||
ttestarray = array[1..64] of byte;
|
||||
ptestarray = ^ttestarray;
|
||||
pbyte = ^byte;
|
||||
|
||||
|
||||
|
||||
|
||||
var
|
||||
pl : plongint;
|
||||
parray : ptestarray;
|
||||
passed : boolean;
|
||||
ptr : pbyte;
|
||||
b: byte;
|
||||
Begin
|
||||
Write('secondderef() test...');
|
||||
passed := true;
|
||||
new(pl);
|
||||
new(parray);
|
||||
{ left : LOC_REFERENCE }
|
||||
pl^:= $F0F0;
|
||||
if pl^ <> $F0F0 then
|
||||
passed := false;
|
||||
FillChar(parray^,sizeof(ttestarray),0);
|
||||
ptr:=pbyte((longint(parray)+32));
|
||||
ptr^ := $A0;
|
||||
if parray^[33] <> $A0 then
|
||||
passed := false;
|
||||
{ left : LOC_REGISTER }
|
||||
b:=(pbyte((longint(parray)+32))^);
|
||||
if b <> $A0 then
|
||||
passed := false;
|
||||
dispose(pl);
|
||||
dispose(parray);
|
||||
if passed then
|
||||
WriteLn('Success.')
|
||||
else
|
||||
WriteLn('Failure.');
|
||||
end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.1 2001-06-30 02:02:06 carl
|
||||
+ secondderef()
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user