aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pr55086_2_tfat.f90
blob: 8ea268209039058a3c32a7d7ae7c37cf40641ab1 (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
33
! { dg-do run }
! { dg-options "-ftest-forall-temp" }
!
  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