From: Jerry DeLisle Date: Sun, 8 Jun 2008 00:09:01 +0000 (+0000) Subject: re PR fortran/36420 (Fortran 2008: g0 edit descriptor) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b16c169167fdd3a18efa80a6845d0e34e0084df0;p=gcc.git re PR fortran/36420 (Fortran 2008: g0 edit descriptor) 2008-06-07 Jerry DeLisle PR fortran/36420 PR fortran/36421 PR fortran/36422 * gfortran.dg/fmt_g0_1.f08: New test. * gfortran.dg/fmt_g0_2.f08: New test. * gfortran.dg/fmt_g0_3.f08: New test. From-SVN: r136547 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a92d16e6f65..cc02b94f1d9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2008-06-07 Jerry DeLisle + + PR fortran/36420 + PR fortran/36421 + PR fortran/36422 + * gfortran.dg/fmt_g0_1.f08: New test. + * gfortran.dg/fmt_g0_2.f08: New test. + * gfortran.dg/fmt_g0_3.f08: New test. + 2008-06-07 Xinliang David Li PR/36440 diff --git a/gcc/testsuite/gfortran.dg/fmt_g0_1.f08 b/gcc/testsuite/gfortran.dg/fmt_g0_1.f08 new file mode 100644 index 00000000000..c85ee2dc781 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/fmt_g0_1.f08 @@ -0,0 +1,20 @@ +! { dg-do run } +! PR36420 Fortran 2008: g0 edit descriptor +! Test case provided by Jerry DeLisle + character(25) :: string = "(g0,g0,g0)" + character(33) :: buffer + write(buffer, '(g0,g0,g0)') ':',12340,':' + if (buffer.ne.":12340:") call abort + write(buffer, string) ':',0,':' + if (buffer.ne.":0:") call abort + write(buffer, string) ':',1.0/3.0,':' + if (buffer.ne.": 0.33333334 :") call abort + write(buffer, '(1x,a,g0,a)') ':',1.0/3.0,':' + if (buffer.ne." : 0.33333334 :") call abort + write(buffer, string) ':',"hello",':' + if (buffer.ne.":hello:") call abort + write(buffer, "(g0,g0,g0,g0)") ':',.true.,.false.,':' + if (buffer.ne.":TF:") call abort + write(buffer, "(g0,g0,',',g0,g0)") '(',( 1.2345, 2.4567 ),')' + if (buffer.ne."( 1.2345001 , 2.4567001 )") call abort +end diff --git a/gcc/testsuite/gfortran.dg/fmt_g0_2.f08 b/gcc/testsuite/gfortran.dg/fmt_g0_2.f08 new file mode 100644 index 00000000000..c19e3f2dca4 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/fmt_g0_2.f08 @@ -0,0 +1,11 @@ +! { dg-do run } +! { dg-options "-std=f95 -pedantic" } +! { dg-shouldfail "Zero width in format descriptor" } +! PR36420 Fortran 2008: g0 edit descriptor +! Test case provided by Jerry DeLisle + character(25) :: string = "(g0,g0,g0)" + character(33) :: buffer + write(buffer, string) ':',0,':' + if (buffer.ne.":0:") call abort +end +! { dg-output "Fortran runtime error: Zero width in format descriptor(\n|\r\n|\r)" } diff --git a/gcc/testsuite/gfortran.dg/fmt_g0_3.f08 b/gcc/testsuite/gfortran.dg/fmt_g0_3.f08 new file mode 100644 index 00000000000..a84b1f10847 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/fmt_g0_3.f08 @@ -0,0 +1,7 @@ +! { dg-do compile } +! { dg-options "-std=f95" }! PR36420 Fortran 2008: g0 edit descriptor +! Test case provided by Jerry DeLisle + character(25) :: string = "(g0,g0,g0)" + character(33) :: buffer + write(buffer, '(g0,g0,g0)') ':',12340,':' ! { dg-error "Fortran F2008:" } +end