summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/associated_5.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/associated_5.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/associated_5.f9019
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/associated_5.f90 b/gcc/testsuite/gfortran.dg/associated_5.f90
new file mode 100644
index 000000000..a2007752f
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/associated_5.f90
@@ -0,0 +1,19 @@
+! { dg-do run }
+! PR 35719 - associated used to fail with zero-sized automatic arrays
+! Test case contributed by Dick Hendrickson
+
+ program try_mf1053
+
+ call mf1053 ( 1, 2, 3, 4)
+ end
+
+ SUBROUTINE MF1053 (nf1, nf2, nf3, nf4)
+ INTEGER, pointer :: ptr(:,:)
+ INTEGER, target :: ILA1(NF2,NF4:NF3)
+
+ ptr => ILA1
+
+ if (ASSOCIATED (ptr, ILA1(NF1:NF2,NF4:NF3) ) ) call abort
+ if ( .not. ASSOCIATED(ptr) ) call abort
+
+ END SUBROUTINE