re PR fortran/28213 (ICE: Hollerith constant)

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
This commit is contained in:
Feng Wang 2006-07-11 04:09:40 +00:00 committed by Feng Wang
parent fb49f596ba
commit 7b95e2a837
4 changed files with 28 additions and 6 deletions

View 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.

View 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

View 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

View 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 *-*-* } 15 }
! { dg-warning "Non-character in FORMAT tag" "" { target *-*-* } 14 }
! { dg-warning "Non-character in FORMAT tag" "" { target *-*-* } 16 }
! { dg-warning "Hollerith constant" "const" { target *-*-* } 19 }
! { dg-warning "Hollerith constant" "const" { target *-*-* } 21 }