-- Shows stack protocol of locals

with Text_IO; use Text_IO;
with System.Address_Image;
procedure aliasedLocal2a is

    procedure A is
        ai: Integer;
    begin
        put_line("Address of ai: " & System.Address_Image(ai'address));
    end a; 

    procedure B is
        bi: Integer;
    begin
        put_line("Address of bi: " & System.Address_Image(bi'address));
        A;
    end b; 

    i: Integer;      -- Address of i: BFA5733C
    j: Integer;      -- Address of j: BFA57338

begin
    put_line("Address of i: " & System.Address_Image(i'address));
    put_line("Address of j: " & System.Address_Image(j'address));

    B;               -- Address of bi: BFA572CC
                     -- Address of ai: BFA5725C
      
    A;               -- Address of ai: BFA572CC

end aliasedLocal2a;