OSDN Git Service

* gnat.dg/lto[12456].adb: Add "target lto" marker.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gnat.dg / slice5.adb
1 --  { dg-do compile }
2 --  { dg-options "-gnatwr" }
3
4 procedure Slice5 is
5    
6    type Item_Type is record
7       I : Integer;
8    end record;
9    
10    type Index_Type is (A, B);
11
12    type table is array (integer range <>) of integer;
13    subtype Small is Integer range 1 .. 10;
14    T1 : constant Table (Small) := (Small => 0);
15    T2 : constant Table (Small) := T1 (Small);  -- { dg-warning "redundant slice denotes whole array" }
16    
17    Item_Array : constant array (Index_Type) of Item_Type
18      := (A => (I => 10), B => (I => 22));
19
20    Item : Item_Type;
21    for Item'Address use Item_Array(Index_Type)'Address;   -- { dg-warning "redundant slice denotes whole array" }
22 begin
23    null;
24 end;