URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [char_pointer_assign.f90] - Rev 694
Compare with Previous | Blame | View Log
! { dg-do run }! { dg-options "-std=legacy" }!program char_pointer_assign! Test character pointer assignments, required! to fix PR18890 and PR21297! Provided by Paul Thomas pault@gcc.gnu.orgimplicit nonecharacter*4, target :: t1character*4, target :: t2(4) =(/"lmno","lmno","lmno","lmno"/)character*4 :: constcharacter*4, pointer :: c1, c3character*4, pointer :: c2(:), c4(:)allocate (c3, c4(4))! Scalars first.c3 = "lmno" ! pointer = constantt1 = c3 ! target = pointerc1 => t1 ! pointer =>targetc1(2:3) = "nm"c3 = c1 ! pointer = pointerc3(1:1) = "o"c3(4:4) = "l"c1 => c3 ! pointer => pointerif (t1 /= "lnmo") call abort ()if (c1 /= "onml") call abort ()! Now arrays.c4 = "lmno" ! pointer = constantt2 = c4 ! target = pointerc2 => t2 ! pointer =>targetconst = c2(1)const(2:3) ="nm" ! c2(:)(2:3) = "nm" is still brokenc2 = constc4 = c2 ! pointer = pointerconst = c4(1)const(1:1) ="o" ! c4(:)(1:1) = "o" is still brokenconst(4:4) ="l" ! c4(:)(4:4) = "l" is still brokenc4 = constc2 => c4 ! pointer => pointerif (any (t2 /= "lnmo")) call abort ()if (any (c2 /= "onml")) call abort ()deallocate (c3, c4)end program char_pointer_assign
