mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 14:49:10 +02:00
+ tbs0182 from bug0182
This commit is contained in:
parent
c921c95996
commit
18acc6d871
31
tests/tbs0182.pp
Normal file
31
tests/tbs0182.pp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
TYPE Rec = RECORD
|
||||||
|
x:WORD;
|
||||||
|
y:WORD;
|
||||||
|
END;
|
||||||
|
|
||||||
|
Rec1 = Record
|
||||||
|
x,y : longint;
|
||||||
|
end;
|
||||||
|
Rec2 = Record
|
||||||
|
r,s : Rec1;
|
||||||
|
z : word;
|
||||||
|
end;
|
||||||
|
plongint = ^longint;
|
||||||
|
|
||||||
|
VAR s:WORD;
|
||||||
|
r:Rec;
|
||||||
|
rr : Rec2;
|
||||||
|
|
||||||
|
CONST p1:POINTER = @s; { Works fine }
|
||||||
|
p2:POINTER = @R.y; { illegal expression }
|
||||||
|
p3:pointer = @rr.s.y;
|
||||||
|
p4:plongint = @rr.s.y;
|
||||||
|
BEGIN
|
||||||
|
rr.s.y:=15;
|
||||||
|
if plongint(p3)^<>15 then
|
||||||
|
Begin
|
||||||
|
Writeln('Error : wrong code generated');
|
||||||
|
Halt(1);
|
||||||
|
End;
|
||||||
|
END.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user