| 1 |
! { dg-do run } |
| 2 |
! |
| 3 |
implicit none |
| 4 |
|
| 5 |
character(len=7), pointer :: u |
| 6 |
character(len=7), pointer :: v |
| 7 |
|
| 8 |
character(len=7), target :: a |
| 9 |
character(len=7), target :: b |
| 10 |
|
| 11 |
integer :: j |
| 12 |
|
| 13 |
b = "1234567" |
| 14 |
a = "abcdefg" |
| 15 |
|
| 16 |
u => a |
| 17 |
v => b |
| 18 |
|
| 19 |
forall (j = 1:2) a(j:j) = b(j:j) |
| 20 |
|
| 21 |
if (a /= "12cdefg") STOP 1 |
| 22 |
|
| 23 |
forall (j = 2:3) a(j:j) = v(j:j) |
| 24 |
if (a /= "123defg") STOP 2 |
| 25 |
|
| 26 |
forall (j = 3:4) u(j:j) = b(j:j) |
| 27 |
if (a /= "1234efg") STOP 3 |
| 28 |
|
| 29 |
forall (j = 4:5) u(j:j) = v(j:j) |
| 30 |
if (a /= "12345fg") STOP 4 |
| 31 |
|
| 32 |
end |