summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/result_in_spec_4.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/result_in_spec_4.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/result_in_spec_4.f9027
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/result_in_spec_4.f90 b/gcc/testsuite/gfortran.dg/result_in_spec_4.f90
new file mode 100644
index 000000000..3f0e9a379
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/result_in_spec_4.f90
@@ -0,0 +1,27 @@
+! { dg-do compile }
+!
+! PR fortran/49648
+! ICE for calls to a use-associated function returning an array whose spec
+! depends on a function call.
+
+! Contributed by Tobias Burnus <burnus@net-b.de>
+
+module m2
+ COMPLEX, SAVE, ALLOCATABLE :: P(:)
+contains
+ FUNCTION getPhaseMatrix() RESULT(PM)
+ COMPLEX:: PM(SIZE(P),3)
+ PM=0.0
+ END FUNCTION
+end module m2
+
+module m
+ use m2
+contains
+ SUBROUTINE gf_generateEmbPot()
+ COMPLEX :: sigma2(3,3)
+ sigma2 = MATMUL(getPhaseMatrix(), sigma2)
+ END SUBROUTINE
+end module m
+
+! { dg-final { cleanup-modules "m m2" } }