diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/associate_7.f03')
-rw-r--r-- | gcc/testsuite/gfortran.dg/associate_7.f03 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/associate_7.f03 b/gcc/testsuite/gfortran.dg/associate_7.f03 new file mode 100644 index 000000000..6fd3f343d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/associate_7.f03 @@ -0,0 +1,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 |