OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [read_comma.f] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
! { dg-do run }
2
! PR25039 This test checks that commas in input fields for formatted sequential
3
! reads are interpreted as the read completion.  If no comma is encountered the
4
! normal field width determines the end of the read.  The test case also checks
5
! that default blanks are interpreted as NULL in numerics.
6
! Test case derived from sample provided in PR by Iwan Kawrakow.
7
! Contributed by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
8
!
9
      program pr25039
10
      implicit none
11
      integer :: i1, i2, i3
12
      character(10) :: a1
13
      open(10, status="scratch")
14
      write(10,'(a)') "1, 235"
15
      rewind(10)
16
      read(10,'(3i2)') i1,i2,i3
17
      if(i1.ne.1) call abort()
18
      if(i2.ne.2) call abort()
19
      if(i3.ne.35) call abort()
20
      rewind(10)
21
!     Make sure commas are read in character strings.      
22
      write(10,'(a)') "1234,6789,"
23
      rewind(10)
24
      read(10,'(a10)') a1
25
      if(a1.ne."1234,6789,") call abort()
26
      end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.