111
|
1 !{ dg-do run }
|
|
2 !{ dg-options "-fno-range-check" }
|
|
3 !{ dg-add-options ieee }
|
|
4 ! PR19310 and PR19904, allow disabling range check during compile.
|
|
5 ! Contributed by Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
|
6 program main
|
|
7 character(len=80) str
|
|
8 real, parameter :: zero=0, nan=0/zero
|
|
9 complex :: z = (-0.1,-2.2)/(0.0,0.0)
|
|
10 complex :: z2 = (0.1,1)/0
|
|
11 complex :: z3 = (1e35, -2e3)/1.234e-37
|
|
12 complex :: z4 = (1e-35, -2e-35)/1234e34
|
|
13 real :: a
|
|
14 a = exp(1000.0)
|
|
15 b = 1/exp(1000.0)
|
|
16
|
|
17 write(str,*) a
|
131
|
18 if (trim(adjustl(str)) .ne. 'Infinity') STOP 1
|
111
|
19
|
131
|
20 if (b .ne. 0.) STOP 2
|
111
|
21
|
|
22 write(str,*) -1.0/b
|
131
|
23 if (trim(adjustl(str)) .ne. '-Infinity') STOP 3
|
111
|
24
|
|
25 write(str,*) b/0.0
|
131
|
26 if (trim(adjustl(str)) .ne. 'NaN') STOP 4
|
111
|
27
|
|
28 write(str,*) 0.0/0.0
|
131
|
29 if (trim(adjustl(str)) .ne. 'NaN') STOP 5
|
111
|
30
|
|
31 write(str,*) 1.0/(-0.)
|
131
|
32 if (trim(adjustl(str)) .ne. '-Infinity') STOP 6
|
111
|
33
|
|
34 write(str,*) -2.0/0.
|
131
|
35 if (trim(adjustl(str)) .ne. '-Infinity') STOP 7
|
111
|
36
|
|
37 write(str,*) 3.0/0.
|
131
|
38 if (trim(adjustl(str)) .ne. 'Infinity') STOP 8
|
111
|
39
|
|
40 write(str,*) nan
|
131
|
41 if (trim(adjustl(str)) .ne. 'NaN') STOP 9
|
111
|
42
|
|
43 write(str,*) z
|
131
|
44 if (trim(adjustl(str)) .ne. '(NaN,NaN)') STOP 10
|
111
|
45
|
|
46 write(str,*) z2
|
131
|
47 if (trim(adjustl(str)) .ne. '(NaN,NaN)') STOP 11
|
111
|
48
|
|
49 write(str,*) z3
|
131
|
50 if (trim(adjustl(str)) .ne. '(Inf,-Inf)') STOP 12
|
111
|
51
|
|
52 write(str,*) z4
|
131
|
53 if (trim(adjustl(str)) .ne. '(0.00000000,-0.00000000)') STOP 13
|
111
|
54 end program main
|