2016-11-21 Thomas Preud'homme <thomas.preudhomme@arm.com>
[official-gcc.git] / gcc / testsuite / gnat.dg / protected_self_ref1.adb
blobb6c2aef6809bcf65fc22a9f48c3cb94f9d4e29de
1 -- { dg-do run }
2 with System;
4 procedure Protected_Self_Ref1 is
6 protected type P is
7 procedure Foo;
8 end P;
10 protected body P is
11 procedure Foo is
12 Ptr : access P; -- here P denotes the type P
13 T : Integer;
14 A : System.Address;
15 begin
16 Ptr := P'Access; -- here P denotes the "this" instance of P
17 T := P'Size;
18 A := P'Address;
19 end;
20 end P;
22 O : P;
23 begin
24 O.Foo;
25 end Protected_Self_Ref1;