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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run { target fd_truncate } }
2
! { dg-add-options ieee }
3
! { dg-skip-if "NaN not supported" { spu-*-* } { "*" } { "" } }
4
!
5
! PR fortran/34427
6
!
7
! Check that namelists and the real values Inf, NaN, Infinity
8
! properly coexist.
9
!
10
 PROGRAM TEST
11
  IMPLICIT NONE
12
  real , DIMENSION(11) ::foo
13
  integer :: infinity
14
  NAMELIST /nl/ foo
15
  NAMELIST /nl/ infinity
16
  foo = -1.0
17
  infinity = -1
18
 
19
  open (10, status="scratch")
20
! Works:
21
  write (10,*) " &nl foo = 5, 5, 5, nan, infinity, infinity "
22
  write (10,*)
23
  write (10,*) "      = 1, /"
24
  rewind (10)
25
  READ (10, NML = nl)
26
  close (10)
27
 
28
  if(infinity /= 1) call abort()
29
  if(any(foo(1:3) /= [5.0, 5.0, 5.0]) .or. .not.isnan(foo(4)) &
30
     .or. foo(5) <= huge(foo) .or. any(foo(6:11) /= -1.0)) &
31
    call abort()
32
! Works too:
33
  foo = -1.0
34
  infinity = -1
35
 
36
  open (10, status="scratch")
37
  rewind (10)
38
  write (10,'(a)') "&nl foo = 5, 5, 5, nan, infinity, infinity"
39
  write (10,'(a)') "=1,/"
40
  rewind (10)
41
  READ (10, NML = nl)
42
  CLOSE (10)
43
 
44
  if(infinity /= 1) call abort()
45
  if(any(foo(1:3) /= [5.0, 5.0, 5.0]) .or. .not.isnan(foo(4)) &
46
     .or. foo(5) <= huge(foo) .or. any(foo(6:11) /= -1.0)) &
47
    call abort()
48
 END PROGRAM TEST

powered by: WebSVN 2.1.0

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