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:
paul 2011-01-18 15:23:58 +00:00
parent 774978a687
commit 731291aee0
4 changed files with 13 additions and 3 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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;

View File

@ -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
View 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.