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