mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-13 21:29:19 +02:00
parent
79866f9824
commit
c25585daee
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -11149,6 +11149,7 @@ tests/test/cg/taddint.pp svneol=native#text/plain
|
|||||||
tests/test/cg/taddlong.pp svneol=native#text/plain
|
tests/test/cg/taddlong.pp svneol=native#text/plain
|
||||||
tests/test/cg/taddr1.pp svneol=native#text/plain
|
tests/test/cg/taddr1.pp svneol=native#text/plain
|
||||||
tests/test/cg/taddr2.pp svneol=native#text/plain
|
tests/test/cg/taddr2.pp svneol=native#text/plain
|
||||||
|
tests/test/cg/taddr3.pp svneol=native#text/plain
|
||||||
tests/test/cg/taddreal1.pp svneol=native#text/plain
|
tests/test/cg/taddreal1.pp svneol=native#text/plain
|
||||||
tests/test/cg/taddreal2.pp svneol=native#text/plain
|
tests/test/cg/taddreal2.pp svneol=native#text/plain
|
||||||
tests/test/cg/taddreal3.pp svneol=native#text/plain
|
tests/test/cg/taddreal3.pp svneol=native#text/plain
|
||||||
|
@ -583,9 +583,13 @@ implementation
|
|||||||
in_addr_x :
|
in_addr_x :
|
||||||
begin
|
begin
|
||||||
consume(_LKLAMMER);
|
consume(_LKLAMMER);
|
||||||
in_args:=true;
|
got_addrn:=true;
|
||||||
p1:=comp_expr(true,false);
|
p1:=factor(true,false,false);
|
||||||
|
{ inside parentheses a full expression is allowed, see also tests\webtbs\tb27517.pp }
|
||||||
|
if token<>_RKLAMMER then
|
||||||
|
p1:=sub_expr(opcompare,true,false,p1);
|
||||||
p1:=caddrnode.create(p1);
|
p1:=caddrnode.create(p1);
|
||||||
|
got_addrn:=false;
|
||||||
consume(_RKLAMMER);
|
consume(_RKLAMMER);
|
||||||
statement_syssym:=p1;
|
statement_syssym:=p1;
|
||||||
end;
|
end;
|
||||||
|
28
tests/test/cg/taddr3.pp
Normal file
28
tests/test/cg/taddr3.pp
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
program taddr3;
|
||||||
|
|
||||||
|
{$ifndef FPC}
|
||||||
|
type
|
||||||
|
codepointer = pointer;
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
procedure testproc;
|
||||||
|
begin
|
||||||
|
end;
|
||||||
|
|
||||||
|
function testfunc: codepointer;
|
||||||
|
begin
|
||||||
|
testfunc:=nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
p1, p2: codepointer;
|
||||||
|
begin
|
||||||
|
p1 := @testproc;
|
||||||
|
p2 := Addr(testproc);
|
||||||
|
if p1<>p2 then
|
||||||
|
Halt(1);
|
||||||
|
p1 := @testfunc;
|
||||||
|
p2 := Addr(testfunc);
|
||||||
|
if p1<>p2 then
|
||||||
|
Halt(2);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user