File: f2003_io_7.f03

package info (click to toggle)
gcc-arm-none-eabi 15%3A14.2.rel1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,099,328 kB
  • sloc: cpp: 3,627,108; ansic: 2,571,498; ada: 834,230; f90: 235,082; makefile: 79,231; asm: 74,984; xml: 51,692; exp: 39,736; sh: 33,298; objc: 15,629; python: 15,069; fortran: 14,429; pascal: 7,003; awk: 5,070; perl: 3,106; ml: 285; lisp: 253; lex: 204; haskell: 135
file content (27 lines) | stat: -rw-r--r-- 927 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
! { dg-do run }
! Test case prepared by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
! Test of sign=, decimal=, and blank= .
program iotests
  implicit none
  character(len=45) :: a
  character(len=4) :: mode = "what"
  real, parameter :: pi = 3.14159265358979323846
  real(kind=8), dimension(3) :: b
  !
  write(a,'(f10.3,s,f10.3,sp,f10.3,ss,f10.3)',SIGN='PLUS') pi, pi, pi, pi
  if (a /= "    +3.142     3.142    +3.142     3.142") STOP 1
  !
  open(8,sign="plus")
  write(8,'(f10.3,dc,f10.3,dp,f10.3)',DECIMAL='COMMA',&
        & sign="suppress") pi, pi, pi
  rewind(8)
  read(8,'(a)') a
  if (a /= "     3,142     3,142     3.142") STOP 2
  close(8,status="delete")
  !
  !              "123456789 123456789  12345678901
  write(a,'(a)') "53 256.84, 2 2 2.  ; 33.3 3   1  "
  read(a, '(f9.2,1x,f8.2,2x,f11.7)', blank="zero") b(1),b(2),b(3)
  if (any(abs(b - [530256.84, 20202.00, 33.3030001]) > .03)) STOP 3
end program iotests