2014-01-30 Alangi Derick <alangiderick@gmail.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / nan_5.f90
blobbe1169d93d1884f06f002e5b08632aa787a6926c
1 ! Check that we correctly simplify ISNAN
3 ! { dg-do compile }
5 ! { dg-options "-fno-range-check" }
6 ! { dg-add-options ieee }
7 ! { dg-skip-if "NaN not supported" { spu-*-* } { "*" } { "" } }
9 implicit none
10 real, parameter :: inf = 2 * huge(inf)
11 real, parameter :: nan1 = 0. / 0.
12 real, parameter :: nan2 = 1.5 * nan1
13 real, parameter :: nan3 = inf / inf
14 real, parameter :: nan4 = inf - inf
15 real, parameter :: nan5 = 0. * inf
16 real, parameter :: normal = 42.
18 integer(kind=merge(4, 0, isnan(nan1))) :: a
19 integer(kind=merge(4, 0, isnan(nan2))) :: b
20 integer(kind=merge(4, 0, isnan(nan3))) :: c
21 integer(kind=merge(4, 0, isnan(nan4))) :: d
22 integer(kind=merge(4, 0, isnan(nan5))) :: e
24 integer(kind=merge(0, 4, isnan(inf))) :: f
25 integer(kind=merge(0, 4, isnan(-inf))) :: g
26 integer(kind=merge(0, 4, isnan(normal))) :: h
28 end