re PR fortran/28213 (ICE: Hollerith constant)
authorFeng Wang <fengwang@nudt.edu.cn>
Tue, 11 Jul 2006 04:09:40 +0000 (04:09 +0000)
committerFeng Wang <fengwang@gcc.gnu.org>
Tue, 11 Jul 2006 04:09:40 +0000 (04:09 +0000)
2006-07-11  Feng Wang  <fengwang@nudt.edu.cn>

        PR fortran/28213
        * gfortran.dg/hollerith4.f90: Test hollerith constants used in I/O
        list.

2006-07-11  Feng Wang  <fengwang@nudt.edu.cn>

        PR fortran/28213
        * trans-io.c (ransfer_expr): Deal with Hollerith constants used in
        I/O list.

From-SVN: r115326

gcc/fortran/ChangeLog
gcc/fortran/trans-io.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/hollerith4.f90

index a822228cd14ec90e48998ad08e8194ab9445d528..87cfa487f992d9605835013d42580051e79b2c66 100644 (file)
@@ -1,3 +1,9 @@
+2006-07-11  Feng Wang  <fengwang@nudt.edu.cn>
+
+       PR fortran/28213
+       * trans-io.c (ransfer_expr): Deal with Hollerith constants used in
+       I/O list.
+
 2006-07-07  Kazu Hirata  <kazu@codesourcery.com>
 
        * intrinsic.texi: Fix typos.
index 6a0dac03ec4141172c69b604910330a423614252..70b93682d7f48d3a0905298f66ed0d61028a41c5 100644 (file)
@@ -1700,6 +1700,7 @@ transfer_expr (gfc_se * se, gfc_typespec * ts, tree addr_expr)
       break;
 
     case BT_CHARACTER:
+    case BT_HOLLERITH:
       if (se->string_length)
        arg2 = se->string_length;
       else
index 9203c1566daa077fe89ca605a3565d9a210aac32..54af3356681530f42baa5d6daa498b3c3c2c264e 100644 (file)
@@ -1,3 +1,9 @@
+2006-07-11  Feng Wang  <fengwang@nudt.edu.cn>
+
+       PR fortran/28213
+       * gfortran.dg/hollerith4.f90: Test hollerith constants used in I/O
+       list.
+
 2006-07-07  Lee Millward  <lee.millward@gmail.com>
 
        PR c++/27820
index b89018509ee9f7ec1ab7be5525c15ceaced81874..bd2b411f3b1fb0b3f510bb89171221cffb4dc063 100644 (file)
@@ -1,5 +1,6 @@
 ! { dg-do run }
-! Test Hollerith constant assigned to allocatable array
+! Test Hollerith constants assigned to allocatable array
+! and used in I/O list.
 
 integer, allocatable :: c (:,:)
 character (len = 20) ch
@@ -14,16 +15,24 @@ write (ch, c) 'Hello'
 if (ch .ne. "Hell") call abort()
 write (ch, c (1,2)) 'Hello'
 if (ch .ne. "Hello") call abort()
-end
 
-! { dg-warning "Hollerith constant" "const" { target *-*-* } 8 }
-! { dg-warning "Conversion" "conversion" { target *-*-* } 8 }
+write (ch, *) 5Hhello
+if (ch .ne. " hello") call abort()
+write (ch, "(A5)") 5Hhello
+if (ch .ne. "hello") call abort()
+
+end
 
 ! { dg-warning "Hollerith constant" "const" { target *-*-* } 9 }
 ! { dg-warning "Conversion" "conversion" { target *-*-* } 9 }
 
-! { dg-warning "Non-character in FORMAT tag" "" { target *-*-* } 13 }
+! { dg-warning "Hollerith constant" "const" { target *-*-* } 10 }
+! { dg-warning "Conversion" "conversion" { target *-*-* } 10 }
+
+! { dg-warning "Non-character in FORMAT tag" "" { target *-*-* } 14 }
 
-! { dg-warning "Non-character in FORMAT tag" "" { target *-*-* } 15 }
+! { dg-warning "Non-character in FORMAT tag" "" { target *-*-* } 16 }
 
+! { dg-warning "Hollerith constant" "const" { target *-*-* } 19 }
+! { dg-warning "Hollerith constant" "const" { target *-*-* } 21 }