Preserving locations for variable-uses and constants (PR c++/43486)
[official-gcc.git] / gcc / testsuite / gnat.dg / fp_exception.adb
bloba8bf62fa9233f8754e5ac035e56d4572d37d73eb
1 -- { dg-do run { target *-*-solaris2.* } }
2 -- { dg-options "-ftrapping-math" }
4 procedure FP_Exception is
6 type my_fixed is digits 15;
7 for my_fixed'size use 64;
8 fixed1 : my_fixed := 1.0;
9 fixed2 : my_fixed := -0.0;
10 mask_all : constant integer := 16#1F#;
12 procedure fpsetmask(mask : in integer);
13 pragma IMPORT (C, fpsetmask, "fpsetmask");
15 begin
17 -- Mask all floating point exceptions so they can be trapped
18 fpsetmask (mask_all);
20 fixed1 := fixed1 / fixed2;
22 exception
23 when others => null;
24 end;