Warn pointer to signed integer cast for ilp32
[official-gcc.git] / gcc / testsuite / gnat.dg / warn5.adb
blob77e4a66f7331336564911fc39ec2c3e9daeb93c2
1 -- { dg-do compile }
3 with System;
4 with Unchecked_Conversion;
6 procedure Warn5 is
8 type Digit_Type is range 0..15;
10 type Frequency_Type is array( 1..12) of Digit_Type;
11 pragma Pack(Frequency_Type);
13 type Element_Type is record
14 F : Frequency_Type;
15 end record;
17 type Array_Type is array (Natural range <>) of Element_Type;
19 type List_Type is record
20 A : Array_Type (0..1);
21 end record;
22 for List_Type'Alignment use 4;
24 type Pointer_Type is access Element_Type;
25 function To_Ptr is new Unchecked_Conversion(System.Address, Pointer_Type);
27 function Pointer (Pos : Natural; List : List_Type) return Pointer_Type is
28 begin
29 return To_Ptr(List.A(Pos)'Address); -- { dg-warning "source alignment" "" { target alpha*-*-* arm*-*-* hppa*-*-* ia64-*-* mips*-*-* sparc*-*-* } }
30 end;
32 begin
33 null;
34 end;