[Bug fortran/55618] [4.6/4.7/4.8 Regression] Failures with ISO_Varying_String test suite
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Dec 10 09:46:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55618
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-12-10 09:45:45 UTC ---
Reduced test case:
module m
implicit none
type t
character :: str(11)
end type t
interface char
module procedure char_auto
end interface char
contains
pure function char_auto (string) result (char_string)
type(t), intent(in) :: string
character(LEN=size(string%str)) :: char_string
integer :: i_char
forall(i_char = 1:size(string%str))
char_string(i_char:i_char) = string%str(i_char)
end forall
end function char_auto
elemental subroutine split_CH (string, set)
type(t), intent(inout) :: string
character(LEN=*), intent(in) :: set
integer :: i
do i = 1, min(len(set),size(string%str))
string%str(i) = set(i:i)
end do
end subroutine split_CH
end module m
use m
type(t) :: mdt, mdt2(2),setdt
mdt%str = ['H', 'e', 'l', 'l', 'o', ' ', 'W','o', 'r', 'l', 'd']
mdt2 = [ mdt, mdt ]
setdt%str = ['F', 'o', 'r', 't', 'r', 'a', 'n','R', 'u', 'l', 'z']
call split_CH(mdt2, char(setdt))
print '(11a)', mdt2(1)%str
print '(11a)', mdt2(2)%str
if (any (mdt2(1)%str /= setdt%str)) call abort ()
if (any (mdt2(2)%str /= setdt%str)) call abort ()
end
More information about the Gcc-bugs
mailing list