xref: /llvm-project/flang/test/Semantics/io02.f90 (revision 573fc6187b82290665ed7d94aa50641d06260a9e)
1! RUN: %python %S/test_errors.py %s %flang_fc1
2  integer :: unit10 = 10
3  integer :: unit11 = 11
4  integer, parameter :: const_stat = 6666
5
6  integer(kind=1) :: stat1
7  integer(kind=8) :: stat8
8
9  character(len=55) :: msg
10
11  close(unit10)
12  close(unit=unit11, err=9, iomsg=msg, iostat=stat1)
13  close(12, status='Keep')
14
15  close(iostat=stat8, 11) ! nonstandard
16
17  !ERROR: CLOSE statement must have a UNIT number specifier
18  close(iostat=stat1)
19
20  !ERROR: Duplicate UNIT specifier
21  close(13, unit=14, err=9)
22
23  !ERROR: Duplicate ERR specifier
24  close(err=9, unit=15, err=9, iostat=stat8)
25
26  !ERROR: Invalid STATUS value 'kept'
27  close(status='kept', unit=16)
28
29  !ERROR: Invalid STATUS value 'old'
30  close(status='old', unit=17)
31
32  !Ok: trailing spaces ignored
33  close(status='keep ', unit=17)
34
35  !ERROR: IOSTAT variable 'const_stat' is not definable
36  !BECAUSE: '6666_4' is not a variable or pointer
37  close(14, iostat=const_stat)
38
399 continue
40end
41