OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [nan_6.f90] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-add-options ieee }
3
! { dg-skip-if "NaN not supported" { spu-*-* } { "*" } { "" } }
4
!
5
! List-directed part of PR fortran/43298
6
! and follow up to PR fortran/34319.
7
!
8
! Check handling of "NAN(alphanum)"
9
!
10
character(len=200) :: str
11
real :: r
12
complex :: z
13
 
14
! read_real:
15
 
16
r = 1.0
17
str = 'INfinity' ; read(str,*) r
18
if (r < 0 .or. r /= r*1.1) call abort()
19
 
20
r = 1.0
21
str = '-INF' ; read(str,*) r
22
if (r > 0 .or. r /= r*1.1) call abort()
23
 
24
r = 1.0
25
str = '+INF' ; read(str,*) r
26
if (r < 0 .or. r /= r*1.1) call abort()
27
 
28
r = 1.0
29
str = '-inFiniTY' ; read(str,*) r
30
if (r > 0 .or. r /= r*1.1) call abort()
31
 
32
r = 1.0
33
str = 'NAN' ; read(str,*) r
34
if (.not. isnan(r)) call abort()
35
 
36
r = 1.0
37
str = '-NAN' ; read(str,*) r
38
if (.not. isnan(r)) call abort()
39
 
40
r = 1.0
41
str = '+NAN' ; read(str,*) r
42
if (.not. isnan(r)) call abort()
43
 
44
r = 1.0
45
str = 'NAN(0x111)' ; read(str,*) r
46
if (.not. isnan(r)) call abort()
47
 
48
r = 1.0
49
str = '-NAN(123)' ; read(str,*) r
50
if (.not. isnan(r)) call abort()
51
 
52
r = 1.0
53
str = '+NAN(0xFFE)' ; read(str,*) r
54
if (.not. isnan(r)) call abort()
55
 
56
 
57
! parse_real
58
 
59
z = cmplx(-2.0,-4.0)
60
str = '(0.0,INfinity)' ; read(str,*) z
61
if (aimag(z) < 0 .or. aimag(z) /= aimag(z)*1.1) call abort()
62
 
63
z = cmplx(-2.0,-4.0)
64
str = '(-INF,0.0)' ; read(str,*) z
65
if (real(z) > 0 .or. real(z) /= real(z)*1.1) call abort()
66
 
67
z = cmplx(-2.0,-4.0)
68
str = '(0.0,+INF)' ; read(str,*) z
69
if (aimag(z) < 0 .or. aimag(z) /= aimag(z)*1.1) call abort()
70
 
71
z = cmplx(-2.0,-4.0)
72
str = '(-inFiniTY,0.0)' ; read(str,*) z
73
if (real(z) > 0 .or. real(z) /= real(z)*1.1) call abort()
74
 
75
z = cmplx(-2.0,-4.0)
76
str = '(NAN,0.0)' ; read(str,*) z
77
if (.not. isnan(real(z))) call abort()
78
 
79
z = cmplx(-2.0,-4.0)
80
str = '(0.0,-NAN)' ; read(str,*) z
81
if (.not. isnan(aimag(z))) call abort()
82
 
83
z = cmplx(-2.0,-4.0)
84
str = '(+NAN,0.0)' ; read(str,*) z
85
if (.not. isnan(real(z))) call abort()
86
 
87
z = cmplx(-2.0,-4.0)
88
str = '(NAN(0x111),0.0)' ; read(str,*) z
89
if (.not. isnan(real(z))) call abort()
90
 
91
z = cmplx(-2.0,-4.0)
92
str = '(0.0,-NaN(123))' ; read(str,*) z
93
if (.not. isnan(aimag(z))) call abort()
94
 
95
z = cmplx(-2.0,-4.0)
96
str = '(+nan(0xFFE),0.0)' ; read(str,*) z
97
if (.not. isnan(real(z))) call abort()
98
 
99
end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.