Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gfortran.dg/deferred_character_6.f90 @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
! { dg-do run } ! ! Tests that PR66408 stays fixed. ! ! Contributed by <werner.blokbuster@gmail.com> ! module mytest implicit none type vary character(:), allocatable :: string end type vary interface assignment(=) module procedure char_eq_vary end interface assignment(=) contains subroutine char_eq_vary(my_char,my_vary) character(:), allocatable, intent(out) :: my_char type(vary), intent(in) :: my_vary my_char = my_vary%string end subroutine char_eq_vary end module mytest program thistest use mytest, only: vary, assignment(=) implicit none character(:), allocatable :: test_char character(14), parameter :: str = 'example string' type(vary) :: test_vary type(vary) :: my_stuff test_vary%string = str if (test_vary%string .ne. str) STOP 1 ! This previously gave a blank string. my_stuff%string = test_vary if (my_stuff%string .ne. str) STOP 2 test_char = test_vary if (test_char .ne. str) STOP 3 my_stuff = test_vary if (my_stuff%string .ne. str) STOP 4 end program thistest