1-- { dg-do run } 2-- { dg-options "-gnato" } 3 4procedure Overflow_Sum3 is 5 6 function Ident (I : Integer) return Integer is 7 begin 8 return I; 9 end; 10 11 X : Short_Short_Integer := Short_Short_Integer (Ident (127)); 12 13begin 14 if X+1 <= 127 then 15 raise Program_Error; 16 end if; 17exception 18 when Constraint_Error => null; 19end; 20