aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Billinghurst <billingd@gcc.gnu.org>2002-03-25 00:22:35 +0000
committerDavid Billinghurst <billingd@gcc.gnu.org>2002-03-25 00:22:35 +0000
commitc1dc83a16d68d4e15a637158c19e2541f65a8022 (patch)
tree91f9afbee6268252e1a51db3966343e829d092fb /gcc
parent2e6c150aa8bf040067b91305d10f8c2456186b83 (diff)
downloadgcc-c1dc83a16d68d4e15a637158c19e2541f65a8022.zip
gcc-c1dc83a16d68d4e15a637158c19e2541f65a8022.tar.gz
gcc-c1dc83a16d68d4e15a637158c19e2541f65a8022.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g77.dg/f77-edit-apostrophe-out.f21
-rw-r--r--gcc/testsuite/g77.dg/f77-edit-colon-out.f9
-rw-r--r--gcc/testsuite/g77.dg/f77-edit-h-out.f14
-rw-r--r--gcc/testsuite/g77.dg/f77-edit-s-out.f20
-rw-r--r--gcc/testsuite/g77.dg/f77-edit-slash-out.f9
-rw-r--r--gcc/testsuite/g77.dg/f77-edit-t-in.f31
-rw-r--r--gcc/testsuite/g77.dg/f77-edit-t-out.f12
-rw-r--r--gcc/testsuite/g77.dg/f77-edit-x-out.f12
8 files changed, 128 insertions, 0 deletions
diff --git a/gcc/testsuite/g77.dg/f77-edit-apostrophe-out.f b/gcc/testsuite/g77.dg/f77-edit-apostrophe-out.f
new file mode 100644
index 0000000..aa51bc0
--- /dev/null
+++ b/gcc/testsuite/g77.dg/f77-edit-apostrophe-out.f
@@ -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
diff --git a/gcc/testsuite/g77.dg/f77-edit-colon-out.f b/gcc/testsuite/g77.dg/f77-edit-colon-out.f
new file mode 100644
index 0000000..4feef75
--- /dev/null
+++ b/gcc/testsuite/g77.dg/f77-edit-colon-out.f
@@ -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
diff --git a/gcc/testsuite/g77.dg/f77-edit-h-out.f b/gcc/testsuite/g77.dg/f77-edit-h-out.f
new file mode 100644
index 0000000..78e6f01
--- /dev/null
+++ b/gcc/testsuite/g77.dg/f77-edit-h-out.f
@@ -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
diff --git a/gcc/testsuite/g77.dg/f77-edit-s-out.f b/gcc/testsuite/g77.dg/f77-edit-s-out.f
new file mode 100644
index 0000000..89a8df2
--- /dev/null
+++ b/gcc/testsuite/g77.dg/f77-edit-s-out.f
@@ -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
diff --git a/gcc/testsuite/g77.dg/f77-edit-slash-out.f b/gcc/testsuite/g77.dg/f77-edit-slash-out.f
new file mode 100644
index 0000000..6cc9a88
--- /dev/null
+++ b/gcc/testsuite/g77.dg/f77-edit-slash-out.f
@@ -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
diff --git a/gcc/testsuite/g77.dg/f77-edit-t-in.f b/gcc/testsuite/g77.dg/f77-edit-t-in.f
new file mode 100644
index 0000000..2314080
--- /dev/null
+++ b/gcc/testsuite/g77.dg/f77-edit-t-in.f
@@ -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
diff --git a/gcc/testsuite/g77.dg/f77-edit-t-out.f b/gcc/testsuite/g77.dg/f77-edit-t-out.f
new file mode 100644
index 0000000..8e41188
--- /dev/null
+++ b/gcc/testsuite/g77.dg/f77-edit-t-out.f
@@ -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
diff --git a/gcc/testsuite/g77.dg/f77-edit-x-out.f b/gcc/testsuite/g77.dg/f77-edit-x-out.f
new file mode 100644
index 0000000..76049fa
--- /dev/null
+++ b/gcc/testsuite/g77.dg/f77-edit-x-out.f
@@ -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