1-- { dg-do run } 2-- { dg-options "-gnato -O" } 3 4procedure Overflow_Fixed is 5 6 type Unsigned_8_Bit is mod 2**8; 7 8 procedure Fixed_To_Eight (Value : Duration) is 9 Item : Unsigned_8_Bit; 10 begin 11 Item := Unsigned_8_Bit(Value); 12 raise Program_Error; 13 exception 14 when Constraint_Error => null; -- expected case 15 end; 16 17begin 18 Fixed_To_Eight (-0.5); 19end; 20