compiler: give error for non-int arguments to make
[official-gcc.git] / gcc / testsuite / gnat.dg / unchecked_convert5.adb
blobe3e4312d73107c0d61457458388b17425b21067a
1 -- { dg-do run { target hppa*-*-* sparc*-*-* powerpc*-*-* } }
3 with Unchecked_Conversion;
5 procedure Unchecked_Convert5 is
7 subtype c_1 is string(1..1);
9 function int2c1 is -- { dg-warning "different sizes" }
10 new unchecked_conversion (source => integer, target => c_1);
12 c1 : c_1;
14 begin
16 c1 := int2c1(16#12#);
18 if c1 (1) /= ASCII.Nul then
19 raise Program_Error;
20 end if;
22 end;