mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 22:47:54 +02:00
compiler: change Addr function to return untyped pointer by Blaise Thorn (issue #0018512), change/add tests
git-svn-id: trunk@16777 -
This commit is contained in:
parent
774978a687
commit
731291aee0
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10954,6 +10954,7 @@ tests/webtbs/tw18334.pp svneol=native#text/plain
|
||||
tests/webtbs/tw18443.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw1850.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1851.pp svneol=native#text/plain
|
||||
tests/webtbs/tw18512.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw1856.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1862.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1863.pp svneol=native#text/plain
|
||||
|
@ -535,8 +535,6 @@ implementation
|
||||
in_args:=true;
|
||||
p1:=comp_expr(true,false);
|
||||
p1:=caddrnode.create(p1);
|
||||
if cs_typed_addresses in current_settings.localswitches then
|
||||
include(p1.flags,nf_typedaddr);
|
||||
consume(_RKLAMMER);
|
||||
statement_syssym:=p1;
|
||||
end;
|
||||
|
@ -18,7 +18,8 @@ BEGIN
|
||||
bb0^[0] := 1;
|
||||
bb0^[1] := 2;
|
||||
{$T+}
|
||||
bw:=word(Addr(bb0^[mr.i1])^);
|
||||
// Addr return untyped pointer, @ typed
|
||||
bw:=word((@bb0^[mr.i1])^);
|
||||
if bw <> 1 then
|
||||
halt(1);
|
||||
{$T-}
|
||||
|
10
tests/webtbs/tw18512.pp
Normal file
10
tests/webtbs/tw18512.pp
Normal file
@ -0,0 +1,10 @@
|
||||
{ %norun }
|
||||
program tw18152;
|
||||
{$TypedAddress on}
|
||||
var
|
||||
p: ^integer;
|
||||
c: char;
|
||||
begin
|
||||
// test that addr return untyped pointer inspite of $TypedAddress directive
|
||||
p := addr(c)
|
||||
end.
|
Loading…
Reference in New Issue
Block a user