Break circular dependency between FIR dialect and utilities
[llvm-project.git] / flang / test / Semantics / io06.f90
blobba73187e829f14db188fd1354c5d77ccd4a9023d
1 ! RUN: %python %S/test_errors.py %s %flang_fc1
2 character(kind=1,len=100) msg1
3 character(kind=2,len=200) msg2
4 character, parameter :: const_msg = 'doof'
5 integer(1) stat1
6 integer(2) stat2
7 integer(8) stat8
9 open(10)
11 backspace(10)
12 backspace(10, iomsg=msg1, iostat=stat1, err=9)
14 endfile(unit=10)
15 endfile(iostat=stat2, err=9, unit=10, iomsg=msg1)
17 rewind(10)
18 rewind(iomsg=msg1, iostat=stat2, err=9, unit=10)
20 flush(10)
21 flush(iomsg=msg1, unit=10, iostat=stat8, err=9)
23 wait(10)
24 wait(99, id=id1, end=9, eor=9, err=9, iostat=stat1, iomsg=msg1)
26 !ERROR: Duplicate UNIT specifier
27 backspace(10, unit=11)
29 !ERROR: Duplicate IOSTAT specifier
30 endfile(iostat=stat2, err=9, unit=10, iostat=stat8, iomsg=msg1)
32 !ERROR: IOMSG variable 'const_msg' is not definable
33 !BECAUSE: '"d"' is not a variable or pointer
34 flush(iomsg=const_msg, unit=10, iostat=stat8, err=9)
36 !ERROR: REWIND statement must have a UNIT number specifier
37 rewind(iostat=stat2)
39 !ERROR: Duplicate ERR specifier
40 flush(err=9, unit=10, &
41 err=9, &
42 err=9)
44 !ERROR: Duplicate ID specifier
45 !ERROR: WAIT statement must have a UNIT number specifier
46 wait(id=id2, eor=9, id=id3)
48 9 continue
49 end