AArch64: correct constraint on Upl early clobber alternatives
[official-gcc.git] / gcc / testsuite / gfortran.dg / nan_6.f90
blobd03cc271713ecd3f8793907b7ca931dcf673756b
1 ! { dg-do run }
2 ! { dg-add-options ieee }
4 ! List-directed part of PR fortran/43298
5 ! and follow up to PR fortran/34319.
7 ! Check handling of "NAN(alphanum)"
9 character(len=200) :: str
10 real :: r
11 complex :: z
13 ! read_real:
15 r = 1.0
16 str = 'INfinity' ; read(str,*) r
17 if (r < 0 .or. r /= r*1.1) STOP 1
19 r = 1.0
20 str = '-INF' ; read(str,*) r
21 if (r > 0 .or. r /= r*1.1) STOP 2
23 r = 1.0
24 str = '+INF' ; read(str,*) r
25 if (r < 0 .or. r /= r*1.1) STOP 3
27 r = 1.0
28 str = '-inFiniTY' ; read(str,*) r
29 if (r > 0 .or. r /= r*1.1) STOP 4
31 r = 1.0
32 str = 'NAN' ; read(str,*) r
33 if (.not. isnan(r)) STOP 5
35 r = 1.0
36 str = '-NAN' ; read(str,*) r
37 if (.not. isnan(r)) STOP 6
39 r = 1.0
40 str = '+NAN' ; read(str,*) r
41 if (.not. isnan(r)) STOP 7
43 r = 1.0
44 str = 'NAN(0x111)' ; read(str,*) r
45 if (.not. isnan(r)) STOP 8
47 r = 1.0
48 str = '-NAN(123)' ; read(str,*) r
49 if (.not. isnan(r)) STOP 9
51 r = 1.0
52 str = '+NAN(0xFFE)' ; read(str,*) r
53 if (.not. isnan(r)) STOP 10
56 ! parse_real
58 z = cmplx(-2.0,-4.0)
59 str = '(0.0,INfinity)' ; read(str,*) z
60 if (aimag(z) < 0 .or. aimag(z) /= aimag(z)*1.1) STOP 11
62 z = cmplx(-2.0,-4.0)
63 str = '(-INF,0.0)' ; read(str,*) z
64 if (real(z) > 0 .or. real(z) /= real(z)*1.1) STOP 12
66 z = cmplx(-2.0,-4.0)
67 str = '(0.0,+INF)' ; read(str,*) z
68 if (aimag(z) < 0 .or. aimag(z) /= aimag(z)*1.1) STOP 13
70 z = cmplx(-2.0,-4.0)
71 str = '(-inFiniTY,0.0)' ; read(str,*) z
72 if (real(z) > 0 .or. real(z) /= real(z)*1.1) STOP 14
74 z = cmplx(-2.0,-4.0)
75 str = '(NAN,0.0)' ; read(str,*) z
76 if (.not. isnan(real(z))) STOP 15
78 z = cmplx(-2.0,-4.0)
79 str = '(0.0,-NAN)' ; read(str,*) z
80 if (.not. isnan(aimag(z))) STOP 16
82 z = cmplx(-2.0,-4.0)
83 str = '(+NAN,0.0)' ; read(str,*) z
84 if (.not. isnan(real(z))) STOP 17
86 z = cmplx(-2.0,-4.0)
87 str = '(NAN(0x111),0.0)' ; read(str,*) z
88 if (.not. isnan(real(z))) STOP 18
90 z = cmplx(-2.0,-4.0)
91 str = '(0.0,-NaN(123))' ; read(str,*) z
92 if (.not. isnan(aimag(z))) STOP 19
94 z = cmplx(-2.0,-4.0)
95 str = '(+nan(0xFFE),0.0)' ; read(str,*) z
96 if (.not. isnan(real(z))) STOP 20
98 end