2017-07-25 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gnat.dg / enclosing_record_reference.adb
blob69c85bcc66e642e0d273354102c1122f6f375164
1 -- { dg-do compile }
2 package body Enclosing_Record_Reference is
4 R: aliased T;
6 function F1 (x: integer) return T is begin return R; end;
7 function F2 (x: T) return integer is begin return 0; end;
8 function F3 (x: T) return T is begin return R; end;
9 function F4 (x: integer) return access T is begin return R'access; end;
10 function F5 (x: access T) return integer is begin return 0; end;
11 function F6 (x: access T) return access T is begin return R'access; end;
12 function F7 (x: T) return access T is begin return R'access; end;
13 function F8 (x: access T) return T is begin return R; end;
15 begin
16 R.F1 := F1'Access;
17 R.F2 := F2'Access;
18 R.F3 := F3'Access;
19 R.F4 := F4'Access;
20 R.F5 := F5'Access;
21 R.F6 := F6'Access;
22 R.F7 := F7'Access;
23 R.F8 := F8'Access;
24 end Enclosing_Record_Reference;