| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! Test the fix for PR70149 in which the string length for |
| 4 |
! 'number_string' was not initialized. |
| 5 |
! |
| 6 |
! Contributed by Walter Spector <[email protected]> |
| 7 |
! |
| 8 |
module myptr_mod |
| 9 |
implicit none |
| 10 |
|
| 11 |
integer, target, save :: int_data = 42 |
| 12 |
character(16), target, save :: char_data = 'forty two' |
| 13 |
|
| 14 |
integer, pointer :: number => int_data |
| 15 |
character(:), pointer :: number_string => char_data |
| 16 |
|
| 17 |
end module |
| 18 |
|
| 19 |
use myptr_mod |
| 20 |
if (LEN (number_string) .ne. 16) stop 1 |
| 21 |
if (trim (number_string) .ne. 'forty two') stop 2 |
| 22 |
end |
| 23 |
|