File: io05.f90

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (60 lines) | stat: -rw-r--r-- 2,068 bytes parent folder | download | duplicates (2)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
! RUN: %S/test_errors.sh %s %t %f18
  character*20 c(25), cv
  character(kind=1,len=59) msg
  logical*2 v(5), lv
  integer*1 stat1
  integer*2 stat4
  integer*8 stat8, iv

  inquire(10)
  inquire(file='abc')
  inquire(10, pos=ipos, iomsg=msg, iostat=stat1)
  inquire(file='abc', &
      access=c(1), action=c(2), asynchronous=c(3), blank=c(4), decimal=c(5), &
      delim=c(6), direct=c(7), encoding=c(8), form=c(9), formatted=c(10), &
      name=c(11), pad=c(12), position=c(13), read=c(14), readwrite=c(15), &
      round=c(16), sequential=c(17), sign=c(18), stream=c(19), &
      unformatted=c(20), write=c(21), &
      err=9, &
      nextrec=nextrec, number=number, pos=jpos, recl=jrecl, size=jsize, &
      iomsg=msg, &
      iostat=stat4, &
      exist=v(1), named=v(2), opened=v(3), pending=v(4))
  inquire(pending=v(5), file='abc')
  inquire(10, id=id, pending=v(5))

  ! using variable 'cv' multiple times seems to be allowed
  inquire(file='abc', &
      access=cv, action=cv, asynchronous=cv, blank=cv, decimal=cv, &
      delim=cv, direct=cv, encoding=cv, form=cv, formatted=cv, &
      name=cv, pad=cv, position=cv, read=cv, readwrite=cv, &
      round=cv, sequential=cv, sign=cv, stream=cv, &
      unformatted=cv, write=cv, &
      nextrec=iv, number=iv, pos=iv, recl=iv, size=iv, &
      exist=lv, named=lv, opened=lv, pending=lv)

  !ERROR: INQUIRE statement must have a UNIT number or FILE specifier
  inquire(err=9)

  !ERROR: If FILE appears, UNIT must not appear
  inquire(10, file='abc', blank=c(22), iostat=stat8)

  !ERROR: Duplicate FILE specifier
  inquire(file='abc', file='xyz')

  !ERROR: Duplicate FORM specifier
  inquire(form=c(1), iostat=stat1, form=c(2), file='abc')

  !ERROR: Duplicate SIGN specifier
  !ERROR: Duplicate READ specifier
  !ERROR: Duplicate WRITE specifier
  inquire(1, read=c(1), write=c(2), sign=c(3), sign=c(4), read=c(5), write=c(1))

  !ERROR: Duplicate IOMSG specifier
  inquire(10, iomsg=msg, pos=ipos, iomsg=msg)

  !ERROR: If ID appears, PENDING must also appear
  inquire(file='abc', id=id)

9 continue
end