reflect: canonicalize types returned by StructOf() and friends
[official-gcc.git] / gcc / testsuite / gfortran.dg / real_const_3.f90
blob58e589f1227765feedc9838e8ec6c3cdf4e7a94a
1 !{ dg-do run }
2 !{ dg-options "-fno-range-check" }
3 !{ dg-add-options ieee }
4 !{ dg-skip-if "NaN not supported" { spu-*-* } }
5 ! PR19310 and PR19904, allow disabling range check during compile.
6 ! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>
7 program main
8 character(len=80) str
9 real, parameter :: zero=0, nan=0/zero
10 complex :: z = (-0.1,-2.2)/(0.0,0.0)
11 complex :: z2 = (0.1,1)/0
12 complex :: z3 = (1e35, -2e3)/1.234e-37
13 complex :: z4 = (1e-35, -2e-35)/1234e34
14 real :: a
15 a = exp(1000.0)
16 b = 1/exp(1000.0)
18 write(str,*) a
19 if (trim(adjustl(str)) .ne. 'Infinity') STOP 1
21 if (b .ne. 0.) STOP 2
23 write(str,*) -1.0/b
24 if (trim(adjustl(str)) .ne. '-Infinity') STOP 3
26 write(str,*) b/0.0
27 if (trim(adjustl(str)) .ne. 'NaN') STOP 4
29 write(str,*) 0.0/0.0
30 if (trim(adjustl(str)) .ne. 'NaN') STOP 5
32 write(str,*) 1.0/(-0.)
33 if (trim(adjustl(str)) .ne. '-Infinity') STOP 6
35 write(str,*) -2.0/0.
36 if (trim(adjustl(str)) .ne. '-Infinity') STOP 7
38 write(str,*) 3.0/0.
39 if (trim(adjustl(str)) .ne. 'Infinity') STOP 8
41 write(str,*) nan
42 if (trim(adjustl(str)) .ne. 'NaN') STOP 9
44 write(str,*) z
45 if (trim(adjustl(str)) .ne. '(NaN,NaN)') STOP 10
47 write(str,*) z2
48 if (trim(adjustl(str)) .ne. '(NaN,NaN)') STOP 11
50 write(str,*) z3
51 if (trim(adjustl(str)) .ne. '(Inf,-Inf)') STOP 12
53 write(str,*) z4
54 if (trim(adjustl(str)) .ne. '(0.00000000,-0.00000000)') STOP 13
55 end program main