gcc/testsuite/gfortran.dg/deferred_character_31.f90
raw| 1 | ! { dg-do run } |
| 2 | ! |
| 3 | ! Test the fix for PR71880 in which the string length for 'p' |
| 4 | ! was not set for the pointer assignment. |
| 5 | ! |
| 6 | ! Contributed by Valery Weber <[email protected]> |
| 7 | ! |
| 8 | program t |
| 9 | character(:), dimension(:), allocatable, target :: c |
| 10 | character(:), dimension(:), pointer :: p => NULL () |
| 11 | allocate(c, source = ['ABC','DEF','GHI']) |
| 12 | p => c |
| 13 | if (len(p) .ne. len (c)) stop 1 |
| 14 | if (size (p, 1) .ne. size (c, 1)) stop 2 |
| 15 | if (any (p .ne. c)) stop 3 |
| 16 | end program t |