2002-01-26 David Billinghurst <David.Billinghurst@riotinto.com>
authorbillingd <billingd@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 27 Jan 2002 01:39:36 +0000 (01:39 +0000)
committerbillingd <billingd@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 27 Jan 2002 01:39:36 +0000 (01:39 +0000)
* g77.dg/f77-edit-i-in.f: New test
* g77.dg/f77-edit-i-out.f: New test

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49257 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/g77.dg/f77-edit-i-in.f [new file with mode: 0644]
gcc/testsuite/g77.dg/f77-edit-i-out.f [new file with mode: 0644]

index 9b6fb5b..5bf83f2 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-27  David Billinghurst  <David.Billinghurst@riotinto.com>
+       * g77.dg/f77-edit-i-in.f: New test
+       * g77.dg/f77-edit-i-out.f: New test
+
 2002-01-25  Geoffrey Keating  <geoffk@redhat.com>
 
        * gcc.dg/debug/debug.exp: New file.
diff --git a/gcc/testsuite/g77.dg/f77-edit-i-in.f b/gcc/testsuite/g77.dg/f77-edit-i-in.f
new file mode 100644 (file)
index 0000000..729a1f0
--- /dev/null
@@ -0,0 +1,24 @@
+C Test Fortran 77 I edit descriptor for input
+C      (ANSI X3.9-1978 Section 13.5.9.1)
+C
+C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
+C
+C { dg-do run }
+      integer i,j
+
+      open(unit=10,status='SCRATCH')
+      write(10,'(A)') '1'
+      write(10,'(A)') ' '
+      write(10,'(A)') '   -1'
+
+      rewind(10)
+
+      read(10,'(I1)') i
+      if ( i.ne.1 ) call abort()
+      read(10,'(I1)') i
+      if ( i.ne.0 ) call abort()
+      read(10,'(I2,X,I2)') i,j
+      if ( i.ne.0 ) call abort()
+      if ( j.ne.-1 ) call abort()
+
+      end
diff --git a/gcc/testsuite/g77.dg/f77-edit-i-out.f b/gcc/testsuite/g77.dg/f77-edit-i-out.f
new file mode 100644 (file)
index 0000000..5da5401
--- /dev/null
@@ -0,0 +1,27 @@
+C Test Fortran 77 I edit descriptor for output
+C      (ANSI X3.9-1978 Section 13.5.9.1)
+C
+C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
+C
+C { dg-do run }
+C { dg-output "^" }
+
+      write(*,'(I1)')    1  ! { dg-output "1\n" }
+      write(*,'(I1)')   -1  ! { dg-output "\*\n" }
+      write(*,'(I2)')    2  ! { dg-output " 2\n" }
+      write(*,'(I2)')   -2  ! { dg-output "-2\n" }
+      write(*,'(I3)')    3  ! { dg-output "  3\n" }
+      write(*,'(I3)')   -3  ! { dg-output " -3\n" }
+
+      write(*,'(I2.0)')  0  ! { dg-output "  \n" }
+      write(*,'(I1.1)')  4  ! { dg-output "4\n" }
+      write(*,'(I1.1)') -4  ! { dg-output "\*\n" }
+      write(*,'(I2.1)')  5  ! { dg-output " 5\n" }
+      write(*,'(I2.1)') -5  ! { dg-output "-5\n" }
+      write(*,'(I2.2)')  6  ! { dg-output "06\n" }
+      write(*,'(I2.2)') -6  ! { dg-output "\*\*\n" }
+      write(*,'(I3.2)')  7  ! { dg-output " 07\n" }
+      write(*,'(I3.2)') -7  ! { dg-output "-07\n" }
+
+C { dg-output "$" }
+      end