summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2018-03-07 00:25:30 +0000
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>2018-03-07 00:25:30 +0000
commit335a9627dee3a614587e8e2a8fdbcd55314eead6 (patch)
tree1f8380869822850a60e204eec23ea0bcd2233d94
parent94fc4b64ad2aa13b9aa9dc8c43fefcc9fc133eab (diff)
downloadgcc-335a9627dee3a614587e8e2a8fdbcd55314eead6.tar.gz
2018-03-06 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/64107 * gfortran.dg/pr64107.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@258311 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/pr64107.f9030
2 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0a41eaa7585..0440f02a696 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2018-03-06 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/64107
+ * gfortran.dg/pr64107.f90: New test.
+
2017-03-06 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/84697
diff --git a/gcc/testsuite/gfortran.dg/pr64107.f90 b/gcc/testsuite/gfortran.dg/pr64107.f90
new file mode 100644
index 00000000000..7261594abb1
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr64107.f90
@@ -0,0 +1,30 @@
+! { dg-do compile }
+! PR fortran/64107
+! Code contribute by fxcoudert at gcc dot gnu dot org
+! Appears to be fixed by patch for PR fortran/83633
+module m1
+
+contains
+ pure integer function foo()
+ foo = 2
+ end function
+end module
+
+subroutine test
+ use m1
+ integer :: x1(foo())
+end subroutine
+
+module m
+ use m1
+ integer :: x2(foo()) ! { dg-error "array with nonconstant bounds" }
+contains
+ subroutine sub
+ integer :: x3(foo())
+ end subroutine
+end module
+
+program p
+ use m1
+ integer :: x4(foo()) ! { dg-error "array with nonconstant bounds" }
+end program