URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Subversion Repositories openrisc_me
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.fortran-torture/] [execute/] [seq_io.f90] - Rev 378
Go to most recent revision | Compare with Previous | Blame | View Log
! pr 15472! sequential access files!! this test verifies the most basic sequential unformatted I/O! write 3 records of various sizes! then read them back! and compare with what was written!implicit noneinteger sizeparameter(size=100)logical debugdata debug /.FALSE./! set debug to true for help in debugging failures.integer m(2)integer nreal*4 r(size)integer im(1) = Z'11111111'm(2) = Z'22222222'n = Z'33333333'do i = 1,sizer(i) = iend dowrite(9)m ! an array of 2write(9)n ! an integerwrite(9)r ! an array of reals! zero all the results so we can compare after they are read backdo i = 1,sizer(i) = 0end dom(1) = 0m(2) = 0n = 0rewind(9)read(9)mread(9)nread(9)r!! check resultsif (m(1).ne.Z'11111111') thenif (debug) thenprint '(A,Z8)','m(1) incorrect. m(1) = ',m(1)elsecall abortendifendifif (m(2).ne.Z'22222222') thenif (debug) thenprint '(A,Z8)','m(2) incorrect. m(2) = ',m(2)elsecall abortendifendifif (n.ne.Z'33333333') thenif (debug) thenprint '(A,Z8)','n incorrect. n = ',nelsecall abortendifendifdo i = 1,sizeif (int(r(i)).ne.i) thenif (debug) thenprint*,'element ',i,' was ',r(i),' should be ',ielsecall abortendifendifend do! use hexdump to look at the file "fort.9"if (debug) thenclose(9)elseclose(9,status='DELETE')endifend
Go to most recent revision | Compare with Previous | Blame | View Log
