PR target/84336
[official-gcc.git] / gcc / testsuite / gnat.dg / unchecked_convert6b.adb
blobd696f7d5f09249dc8f80f2c84e618ac20ce26668
1 -- { dg-do run { target i?86-*-* x86_64-*-* alpha*-*-* ia64-*-* } }
3 with Unchecked_Conversion;
5 procedure Unchecked_Convert6b is
7 subtype c_5 is string(1..5);
9 function int2c5 is -- { dg-warning "different sizes" }
10 new unchecked_conversion (source => integer, target => c_5);
12 c5 : c_5;
14 begin
16 c5 := int2c5(16#12#);
18 if c5 (1) /= ASCII.DC2 then
19 raise Program_Error;
20 end if;
22 end;