Debian Codegraph @

gcc/testsuite/gnat.dg/addr_slice.adb

raw
1 -- { dg-do compile }
2 -- { dg-options "-gnatws" }
3
4 procedure Addr_Slice is
5 type Item_Type is record
6 I : Integer;
7 end record;
8
9 type Index_Type is (A, B);
10 for Index_Type use (A => 1, B => 10);
11
12 Item_Array : constant array (Index_Type) of Item_Type
13 := (A => (I => 10), B => (I => 22));
14
15 Item : Item_Type;
16 for Item'Address use Item_Array(Index_Type)'Address;
17 begin
18 null;
19 end;