mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-10 08:57:09 +08:00
f77-edit-apostrophe-out.f: New test
2002-03-25 David Billinghurst <David.Billinghurst@riotinto.com> * g77.dg/f77-edit-apostrophe-out.f: New test * g77.dg/f77-edit-h-out.f: New test * g77.dg/f77-edit-t-in.f: New test * g77.dg/f77-edit-t-out.f: New test * g77.dg/f77-edit-x-out.f: New test * g77.dg/f77-edit-slash-out.f: New test * g77.dg/f77-edit-colon-out.f: New test * g77.dg/f77-edit-s-out.f: New test From-SVN: r51287
This commit is contained in:
parent
2e6c150aa8
commit
c1dc83a16d
21
gcc/testsuite/g77.dg/f77-edit-apostrophe-out.f
Normal file
21
gcc/testsuite/g77.dg/f77-edit-apostrophe-out.f
Normal file
@ -0,0 +1,21 @@
|
||||
C Test Fortran 77 apostrophe edit descriptor
|
||||
C (ANSI X3.9-1978 Section 13.5.1)
|
||||
C
|
||||
C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
|
||||
C
|
||||
C { dg-do run }
|
||||
C { dg-output "^" }
|
||||
10 format('abcde')
|
||||
20 format('and an apostrophe -''-')
|
||||
30 format('''a leading apostrophe')
|
||||
40 format('a trailing apostrophe''')
|
||||
50 format('''and all of the above -''-''')
|
||||
|
||||
write(*,10) ! { dg-output "abcde(\n|\r\n|\r)" }
|
||||
write(*,20) ! { dg-output "and an apostrophe -'-(\n|\r\n|\r)" }
|
||||
write(*,30) ! { dg-output "'a leading apostrophe(\n|\r\n|\r)" }
|
||||
write(*,40) ! { dg-output "a trailing apostrophe'(\n|\r\n|\r)" }
|
||||
write(*,50) ! { dg-output "'and all of the above -'-'(\n|\r\n|\r)" }
|
||||
|
||||
C { dg-output "\$" }
|
||||
end
|
9
gcc/testsuite/g77.dg/f77-edit-colon-out.f
Normal file
9
gcc/testsuite/g77.dg/f77-edit-colon-out.f
Normal file
@ -0,0 +1,9 @@
|
||||
C Test Fortran 77 colon edit descriptor
|
||||
C (ANSI X3.9-1978 Section 13.5.5)
|
||||
C
|
||||
C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
|
||||
C
|
||||
C { dg-do run }
|
||||
C { dg-output "^123(\n|\r\n|\r)45(\n|\r\n|\r)\$" }
|
||||
write(*,'((3(I1:)))') (I,I=1,5)
|
||||
end
|
14
gcc/testsuite/g77.dg/f77-edit-h-out.f
Normal file
14
gcc/testsuite/g77.dg/f77-edit-h-out.f
Normal file
@ -0,0 +1,14 @@
|
||||
C Test Fortran 77 H edit descriptor
|
||||
C (ANSI X3.9-1978 Section 13.5.2)
|
||||
C
|
||||
C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
|
||||
C
|
||||
C { dg-do run }
|
||||
C { dg-output "^" }
|
||||
10 format(1H1)
|
||||
20 format(6H 6)
|
||||
write(*,10) ! { dg-output "1(\n|\r\n|\r)" }
|
||||
write(*,20) ! { dg-output " 6(\n|\r\n|\r)" }
|
||||
write(*,'(16H''apostrophe'' fun)') ! { dg-output "'apostrophe' fun(\n|\r\n|\r)" }
|
||||
C { dg-output "\$" }
|
||||
end
|
20
gcc/testsuite/g77.dg/f77-edit-s-out.f
Normal file
20
gcc/testsuite/g77.dg/f77-edit-s-out.f
Normal file
@ -0,0 +1,20 @@
|
||||
C Test Fortran 77 S, SS and SP edit descriptors
|
||||
C (ANSI X3.9-1978 Section 13.5.6)
|
||||
C
|
||||
C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
|
||||
C
|
||||
C { dg-do run }
|
||||
C ( dg-output "^" }
|
||||
10 format(SP,I3,1X,SS,I3)
|
||||
20 format(SP,I3,1X,SS,I3,SP,I3)
|
||||
30 format(SP,I3,1X,SS,I3,S,I3)
|
||||
40 format(SP,I3)
|
||||
50 format(SP,I2)
|
||||
write(*,10) 10, 20 ! { dg-output "\\+10 20(\n|\r\n|\r)" }
|
||||
write(*,20) 10, 20, 30 ! { dg-output "\\+10 20\\+30(\n|\r\n|\r)" }
|
||||
write(*,30) 10, 20, 30 ! { dg-output "\\+10 20 30(\n|\r\n|\r)" }
|
||||
write(*,40) 0 ! { dg-output " \\+0(\n|\r\n|\r)" }
|
||||
C 15.5.9 - Note 5: When SP editing is in effect, the plus sign is not optional
|
||||
write(*,50) 11 ! { dg-output "\\*\\*(\n|\r\n|\r)" }
|
||||
C { dg-output "\$" }
|
||||
end
|
9
gcc/testsuite/g77.dg/f77-edit-slash-out.f
Normal file
9
gcc/testsuite/g77.dg/f77-edit-slash-out.f
Normal file
@ -0,0 +1,9 @@
|
||||
C Test Fortran 77 colon slash descriptor
|
||||
C (ANSI X3.9-1978 Section 13.5.4)
|
||||
C
|
||||
C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
|
||||
C
|
||||
C { dg-do run }
|
||||
C { dg-output "^123(\n|\r\n|\r)45(\n|\r\n|\r)\$" }
|
||||
write(*,'(3(I1)/2(I1))') (I,I=1,5)
|
||||
end
|
31
gcc/testsuite/g77.dg/f77-edit-t-in.f
Normal file
31
gcc/testsuite/g77.dg/f77-edit-t-in.f
Normal file
@ -0,0 +1,31 @@
|
||||
C Test Fortran 77 T edit descriptor for input
|
||||
C (ANSI X3.9-1978 Section 13.5.3.2)
|
||||
C
|
||||
C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
|
||||
C
|
||||
C { dg-do run }
|
||||
integer i,j
|
||||
real a,b,c,d,e
|
||||
character*32 in
|
||||
|
||||
in = '1234 8'
|
||||
read(in,'(T3,I1)') i
|
||||
if ( i.ne.3 ) call abort()
|
||||
read(in,'(5X,TL4,I2)') i
|
||||
if ( i.ne.23 ) call abort()
|
||||
read(in,'(3X,I1,TR3,I1)') i,j
|
||||
if ( i.ne.4 ) call abort()
|
||||
if ( j.ne.8 ) call abort()
|
||||
|
||||
in = ' 1.5 -12.62 348.75 1.0E-6'
|
||||
100 format(F6.0,TL6,I4,1X,I1,8X,I5,F3.0,T10,F5.0,T17,F6.0,TR2,F6.0)
|
||||
read(in,100) a,i,j,k,b,c,d,e
|
||||
if ( abs(a-1.5).gt.1.0e-5 ) call abort()
|
||||
if ( i.ne.1 ) call abort()
|
||||
if ( j.ne.5 ) call abort()
|
||||
if ( k.ne.348 ) call abort()
|
||||
if ( abs(b-0.75).gt.1.0e-5 ) call abort()
|
||||
if ( abs(c-12.62).gt.1.0e-5 ) call abort()
|
||||
if ( abs(d-348.75).gt.1.0e-4 ) call abort()
|
||||
if ( abs(e-1.0e-6).gt.1.0e-11 ) call abort()
|
||||
end
|
12
gcc/testsuite/g77.dg/f77-edit-t-out.f
Normal file
12
gcc/testsuite/g77.dg/f77-edit-t-out.f
Normal file
@ -0,0 +1,12 @@
|
||||
C Test Fortran 77 T edit descriptor
|
||||
C (ANSI X3.9-1978 Section 13.5.3.2)
|
||||
C
|
||||
C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
|
||||
C
|
||||
C { dg-do run }
|
||||
C ( dg-output "^" }
|
||||
write(*,'(I4,T8,I1)') 1234,8 ! { dg-output "1234 8(\n|\r\n|\r)" }
|
||||
write(*,'(I4,TR3,I1)') 1234,8 ! { dg-output "1234 8(\n|\r\n|\r)" }
|
||||
write(*,'(I4,5X,TL2,I1)') 1234,8 ! { dg-output "1234 8(\n|\r\n|\r)" }
|
||||
C ( dg-output "\$" }
|
||||
end
|
12
gcc/testsuite/g77.dg/f77-edit-x-out.f
Normal file
12
gcc/testsuite/g77.dg/f77-edit-x-out.f
Normal file
@ -0,0 +1,12 @@
|
||||
C Test Fortran 77 X descriptor
|
||||
C (ANSI X3.9-1978 Section 13.5.3.2)
|
||||
C
|
||||
C Origin: David Billinghurst <David.Billinghurst@riotinto.com>
|
||||
C
|
||||
C { dg-do run }
|
||||
C ( dg-output "^" }
|
||||
write(*,'(I1,1X,I1,2X,I1)') 1,2,3 ! { dg-output "1 2 3(\n|\r\n|\r)" }
|
||||
C Section 13.5.3 explains why there are no trailing blanks
|
||||
write(*,'(I1,1X,I1,2X,I1,3X)') 1,2,3 ! { dg-output "1 2 3(\n|\r\n|\r)" }
|
||||
C { dg-output "\$" }
|
||||
end
|
Loading…
Reference in New Issue
Block a user