URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [list_read_3.f90] - Rev 694
Compare with Previous | Blame | View Log
! { dg-do run }! Program to test reading in a list of integer values into REAL variables.! The comma separator was not handled correctly.!program fgcharacter(len=80) bufflogical debugdebug = .FALSE.a = 0b = 0c = 0d = 0write (buff,'(a)') '10,20,30,40'read(buff,*) a, b, c, dif (debug) thenprint*,buffprint*,a, b, c, dend ifif (abs(10. - a) > 1e-5) call abortif (abs(20. - b) > 1e-5) call abortif (abs(30. - c) > 1e-5) call abortif (abs(40. - d) > 1e-5) call aborta = 0b = 0c = 0d = 0write (buff,'(a)') '10.,20.,30.,40.'read(buff,*) a, b, c, dif (abs(10. - a) > 1e-5) call abortif (abs(20. - b) > 1e-5) call abortif (abs(30. - c) > 1e-5) call abortif (abs(40. - d) > 1e-5) call abortif (debug) thenprint*,buffprint*,a, b, c, dend ifa = 0b = 0c = 0d = 0write (buff,'(a)') '10.0,20.0,30.0,40.0'read(buff,*) a, b, c, dif (abs(10. - a) > 1e-5) call abortif (abs(20. - b) > 1e-5) call abortif (abs(30. - c) > 1e-5) call abortif (abs(40. - d) > 1e-5) call abortif (debug) thenprint*,buffprint*,a, b, c, dend ifa = 0b = -99c = 0d = 0write (buff,'(a)') '10.0,,30.0,40.0'read(buff,*) a, b, c, dif (abs(10. - a) > 1e-5) call abortif (abs(-99. - b) > 1e-5) call abortif (abs(30. - c) > 1e-5) call abortif (abs(40. - d) > 1e-5) call abortif (debug) thenprint*,buffprint*,a, b, c, dend ifcall abcend programsubroutine abccharacter(len=80) buffa = 0b = 0c = 0d = 0write (buff,'(a)') '10,-20,30,-40'read(buff,*) a, b, c, dif (abs(10. - a) > 1e-5) call abortif (abs(-20. - b) > 1e-5) call abortif (abs(30. - c) > 1e-5) call abortif (abs(-40. - d) > 1e-5) call abortend subroutine abc
