Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / gnat.dg / address_conversion.adb
blob5813638c46b34c119b1dce583bbd953db4836ce0
1 -- { dg-do run }
2 -- { dg-options "-O2" }
4 with System.Address_To_Access_Conversions;
6 procedure address_conversion is
8 type Integer_type1 is new Integer;
9 type Integer_type2 is new Integer;
11 package AA is new System.Address_To_Access_Conversions (Integer_type1);
13 K1 : Integer_type1;
14 K2 : Integer_type2;
16 begin
17 K1 := 1;
18 K2 := 2;
20 AA.To_Pointer(K2'Address).all := K1;
21 if K2 /= 1 then
22 raise Program_Error;
23 end if;
24 end;