| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
! Tests the fixes for PR82719 and PR82720. |
| 4 |
! |
| 5 |
! Contributed by Gerhard Steinmetz <[email protected]> |
| 6 |
! |
| 7 |
program p |
| 8 |
character(120) :: buffer |
| 9 |
character(3) :: chr |
| 10 |
integer :: i |
| 11 |
type t(a) |
| 12 |
integer, len :: a |
| 13 |
character(len=a) :: c |
| 14 |
end type |
| 15 |
type(t(:)), allocatable :: x |
| 16 |
allocate (t(2) :: x) |
| 17 |
|
| 18 |
x = t(2,'ab') |
| 19 |
write (buffer, *) x%c ! Tests the fix for PR82720 |
| 20 |
read (buffer, *) chr |
| 21 |
if (trim (chr) .ne. 'ab') STOP 1 |
| 22 |
|
| 23 |
x = t(3,'xyz') |
| 24 |
if (len (x%c) .ne. 3) STOP 2 |
| 25 |
write (buffer, *) x ! Tests the fix for PR82719 |
| 26 |
read (buffer, *) i, chr |
| 27 |
if (i .ne. 3) STOP 3 |
| 28 |
if (chr .ne. 'xyz') STOP 4 |
| 29 |
|
| 30 |
buffer = " 3 lmn" |
| 31 |
read (buffer, *) x ! Some thought will be needed for PDT reads. |
| 32 |
if (x%c .ne. 'lmn') STOP 5 |
| 33 |
end |