Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / io02.f90
blobbbcf18e9326b3c3a01bb50ba2a5eb37bbf14b937
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 integer :: unit10 = 10
3 integer :: unit11 = 11
4 integer, parameter :: const_stat = 6666
6 integer(kind=1) :: stat1
7 integer(kind=8) :: stat8
9 character(len=55) :: msg
11 close(unit10)
12 close(unit=unit11, err=9, iomsg=msg, iostat=stat1)
13 close(12, status='Keep')
15 close(iostat=stat8, 11) ! nonstandard
17 !ERROR: CLOSE statement must have a UNIT number specifier
18 close(iostat=stat1)
20 !ERROR: Duplicate UNIT specifier
21 close(13, unit=14, err=9)
23 !ERROR: Duplicate ERR specifier
24 close(err=9, unit=15, err=9, iostat=stat8)
26 !ERROR: Invalid STATUS value 'kept'
27 close(status='kept', unit=16)
29 !ERROR: Invalid STATUS value 'old'
30 close(status='old', unit=17)
32 !Ok: trailing spaces ignored
33 close(status='keep ', unit=17)
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)
39 9 continue
40 end