brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.7 KiB · 3841735 Raw
215 lines · plain
1! RUN: %python %S/test_errors.py %s %flang_fc12  character(kind=1,len=50) internal_file3  character(kind=2,len=50) internal_file24  character(kind=4,len=50) internal_file45  character(kind=1,len=50) internal_fileA(20)6  character(kind=1,len=111) msg7  character(20) advance8  character(20) :: cvar;9  character, parameter :: const_internal_file = "(I6)"10  character, parameter :: const_cvar*(*) = "Ceci n'est pas une pipe."11  integer*1 stat112  integer*2 stat2, id213  integer*8 stat814  integer :: iunit = 1015  integer, parameter :: junit = 11, const_size = 13, const_int = 1516  integer :: vv(10) = 717 18  namelist /mmm/ mm1, mm219  namelist /nnn/ nn1, nn220 21  advance='no'22 23  open(10)24 25  read*26  print*, 'Ok'27  read(*)28  read*, jj29  read(*, *) jj30  read(unit=*, *) jj31  read(*, fmt=*) jj32  read(*, '(I4)') jj33  read(*, fmt='(I4)') jj34  read(fmt='(I4)', unit=*) jj35  read(iunit, *) jj36  read(junit, *) jj37  read(10, *) jj, cvar, cvar(7:17)38  read(internal_file, *) jj39  read(internal_fileA(3), *) jj40  read(internal_fileA(4:9), *) jj41  read(10, nnn)42  read(internal_file, nnn)43  read(internal_file, nml=nnn)44  read(const_internal_file, *)45  read(fmt=*, unit=internal_file)46  read(nml=nnn, unit=internal_file)47  read(iunit, nnn)48  read(10, nml=nnn)49  read(10, asynchronous='no') jj50  read(10, asynchronous='yes') jj51  read(10, eor=9, advance='no', fmt='(I4)') jj52  read(10, eor=9, advance='no', fmt='(I4)') jj53  read(10, asynchronous='yes', id=id) jj54  read(10, '(I4)', advance='no', asynchronous='yes', blank='null', &55      decimal='comma', end=9, eor=9, err=9, id=id, iomsg=msg, iostat=stat2, &56      pad='no', round='processor_defined', size=kk) jj57 58  read(internal_file2, *) jj59  read(internal_file4, *) jj60 61  !This is a valid statement but it's not what it looks like; "(internal-file)"62  !must be parsed as a format expression, not as an internal unit.63  read(internal_file) jj64 65  !ERROR: If UNIT=internal-file appears, FMT or NML must also appear66  read(internal_file, iostat=stat1) jj67 68  !ERROR: Internal file must not have a vector subscript69  read(internal_fileA(vv), *) jj70 71  !ERROR: Input variable 'const_int' is not definable72  !BECAUSE: '15_4' is not a variable or pointer73  read(11, *) const_int74 75  !ERROR: SIZE variable 'const_size' is not definable76  !BECAUSE: '13_4' is not a variable or pointer77  read(11, pos=ipos, size=const_size, end=9)78 79  !ERROR: Input variable 'const_cvar' is not definable80  !BECAUSE: '"Ceci n'est pas une pipe."' is not a variable or pointer81  read(11, *) const_cvar82 83  !ERROR: Input variable 'const_cvar(3:13)' is not definable84  !BECAUSE: '"ci n'est pa"' is not a variable or pointer85  read(11, *) const_cvar(3:13)86 87  !ERROR: Duplicate IOSTAT specifier88  read(11, pos=ipos, iostat=stat1, iostat=stat2)89 90  !ERROR: Duplicate END specifier91  read(11, end=9, pos=ipos, end=9)92 93  !ERROR: Duplicate NML specifier94  read(10, nml=mmm, nml=nnn)95 96  !ERROR: READ statement must have a UNIT specifier97  read(err=9, iostat=stat8) jj98 99  !ERROR: READ statement must not have a DELIM specifier100  !ERROR: READ statement must not have a SIGN specifier101  read(10, delim='quote', sign='plus') jj102 103  !ERROR: If NML appears, REC must not appear104  read(10, nnn, rec=nn)105 106  !ERROR: If NML appears, FMT must not appear107  !ERROR: If NML appears, a data list must not appear108  read(10, fmt=*, nml=nnn) jj109 110  !ERROR: If UNIT=* appears, REC must not appear111  read(*, rec=13)112 113  !ERROR: If UNIT=* appears, POS must not appear114  read(*, pos=13)115 116  !ERROR: If UNIT=internal-file appears, FMT or NML must also appear117  !ERROR: If UNIT=internal-file appears, REC must not appear118  read(internal_file, rec=13)119 120  !ERROR: If UNIT=internal-file appears, POS must not appear121  read(internal_file, *, pos=13)122 123  !ERROR: If REC appears, END must not appear124  read(10, fmt='(I4)', end=9, rec=13) jj125 126  !ERROR: If REC appears, FMT=* must not appear127  read(10, *, rec=13) jj128 129  !ERROR: If ADVANCE appears, UNIT=internal-file must not appear130  read(internal_file, '(I4)', eor=9, advance='no') jj131 132  !ERROR: If ADVANCE appears, an explicit format must also appear133  !ERROR: If EOR appears, ADVANCE with value 'NO' must also appear134  read(10, eor=9, advance='yes')135 136  !ERROR: If EOR appears, ADVANCE with value 'NO' must also appear137  read(10, eor=9)138 139  !ERROR: Invalid ASYNCHRONOUS value 'nay'140  read(10, asynchronous='nay') ! prog req141 142  !ERROR: If ASYNCHRONOUS='YES' appears, UNIT=number must also appear143  read(*, asynchronous='yes')144 145  !ERROR: If ASYNCHRONOUS='YES' appears, UNIT=number must also appear146  read(internal_file, *, asynchronous='y'//'es')147 148  !ERROR: If ID appears, ASYNCHRONOUS='YES' must also appear149  read(10, id=id)150 151  !ERROR: If ID appears, ASYNCHRONOUS='YES' must also appear152  read(10, asynchronous='n'//'o', id=id)153 154  !ERROR: If POS appears, REC must not appear155  read(10, pos=13, rec=13) jj156 157  !ERROR: If DECIMAL appears, FMT or NML must also appear158  !ERROR: If BLANK appears, FMT or NML must also appear159  !ERROR: Invalid DECIMAL value 'Punkt'160  read(10, decimal='Punkt', blank='null') jj161 162  !ERROR: If ROUND appears, FMT or NML must also appear163  !ERROR: If PAD appears, FMT or NML must also appear164  read(10, pad='no', round='nearest') jj165 166  !PORTABILITY: If NML appears, SIZE should not appear167  read(10, nml=nnn, size=kk)168  !PORTABILITY: If FMT=* appears, SIZE should not appear169  read(10, *, size=kk) jj170 171  !ERROR: ID kind (2) is smaller than default INTEGER kind (4)172  read(10, id=id2, asynchronous='yes') jj173 174  !ERROR: I/O unit must be a character variable or a scalar integer expression, but is an expression of type CHARACTER(1)175  read((msg), *)176  !ERROR: I/O unit must be a character variable or a scalar integer expression, but is an expression of type CHARACTER(KIND=1,LEN=8_8)177  read("a string", *)178  !ERROR: I/O unit must be a character variable or a scalar integer expression, but is an expression of type CHARACTER(1)179  read(msg//msg, *)180  !ERROR: I/O unit must be a character variable or a scalar integer expression, but is an expression of type LOGICAL(4)181  read(.true., *)182  !ERROR: I/O unit must be a character variable or a scalar integer expression, but is an expression of type REAL(4)183  read(1.0, *)184  read(internal_fileA, *)185  !ERROR: I/O unit must be a character variable or a scalar integer expression, but is an expression of type CHARACTER(1)186  read((internal_fileA), *)187  !ERROR: I/O unit number must be scalar188  read([1,2,3], *)189 1909 continue191end192 193subroutine s(aa, n)194  integer :: aa(5,*)195  integer, intent(in) :: n196  integer :: bb(10), vv(10)197  type tt198    real :: x, y, z199  end type tt200  type(tt) :: qq(20)201 202  vv = 1203 204  read(*, *) aa(n,1)205  read(*, *) aa(n:n+2,2)206  read(*, *) qq(2:5)%y207 208  !ERROR: Input variable 'n' is not definable209  !BECAUSE: 'n' is an INTENT(IN) dummy argument210  read(*, *) n211 212  !ERROR: Whole assumed-size array 'aa' may not appear here without subscripts213  read(*, *) aa214end215