summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/associate_7.f03
blob: 6fd3f343d00eb2fbaeadc94070dd0e0e87cf0201 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
! { dg-do run }
! { dg-options "-std=f2003 -fall-intrinsics" }

! PR fortran/38936
! Check association and pointers.

! Contributed by Daniel Kraft, d@domob.eu.

PROGRAM main
  IMPLICIT NONE
  INTEGER, TARGET :: tgt
  INTEGER, POINTER :: ptr

  tgt = 1
  ASSOCIATE (x => tgt)
    ptr => x
    IF (ptr /= 1) CALL abort ()
    ptr = 2
  END ASSOCIATE
  IF (tgt /= 2) CALL abort ()
END PROGRAM main