aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2018-06-11 20:44:38 +0200
committerJanus Weil <janus@gcc.gnu.org>2018-06-11 20:44:38 +0200
commitc7927c3bb8f3e21ed77b17bcb62b0125f10c5b29 (patch)
treefb7de4b91b949d323991033e90af91994dd2c484 /gcc/testsuite
parent46e318cff70c1adcb0895092975c72f41f82404c (diff)
downloadgcc-c7927c3bb8f3e21ed77b17bcb62b0125f10c5b29.zip
gcc-c7927c3bb8f3e21ed77b17bcb62b0125f10c5b29.tar.gz
gcc-c7927c3bb8f3e21ed77b17bcb62b0125f10c5b29.tar.bz2
re PR fortran/45521 ([F08] GENERIC resolution with ALLOCATABLE/POINTER and PROCEDURE)
2018-06-11 Janus Weil <janus@gcc.gnu.org> PR fortran/45521 * interface.c (compare_ptr_alloc): New function. (generic_correspondence): Call it. 2018-06-11 Janus Weil <janus@gcc.gnu.org> PR fortran/45521 * gfortran.dg/generic_32.f90: New test. * gfortran.dg/generic_33.f90: New test. From-SVN: r261448
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gfortran.dg/generic_32.f9016
-rw-r--r--gcc/testsuite/gfortran.dg/generic_33.f9027
3 files changed, 49 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 27201df..ae6acb3 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2018-06-11 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/45521
+ * gfortran.dg/generic_32.f90: New test.
+ * gfortran.dg/generic_33.f90: New test.
+
2018-06-11 Carl Love <cel@us.ibm.com>
* gcc.target/powerpc/altivec-7.c (main): Remove tests
vec_unpackh(vecubi[0]) and vec_unpackl(vecubi[0]) returning
diff --git a/gcc/testsuite/gfortran.dg/generic_32.f90 b/gcc/testsuite/gfortran.dg/generic_32.f90
new file mode 100644
index 0000000..61e8a2a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/generic_32.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+!
+! PR 45521: [F08] GENERIC resolution with ALLOCATABLE/POINTER and PROCEDURE
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+
+ INTERFACE gen
+ SUBROUTINE suba(a) ! { dg-error "Ambiguous interfaces" }
+ REAL,ALLOCATABLE :: a(:)
+ END SUBROUTINE
+ SUBROUTINE subp(p) ! { dg-error "Ambiguous interfaces" }
+ REAL,POINTER,INTENT(IN) :: p(:)
+ END SUBROUTINE
+ END INTERFACE
+end
diff --git a/gcc/testsuite/gfortran.dg/generic_33.f90 b/gcc/testsuite/gfortran.dg/generic_33.f90
new file mode 100644
index 0000000..540d73b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/generic_33.f90
@@ -0,0 +1,27 @@
+! { dg-do compile }
+!
+! PR 45521: [F08] GENERIC resolution with ALLOCATABLE/POINTER and PROCEDURE
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+ type :: t
+ end type
+
+ interface test
+ procedure testAlloc
+ procedure testPtr
+ end interface
+
+contains
+
+ logical function testAlloc(obj)
+ class(t), allocatable :: obj
+ testAlloc = .true.
+ end function
+
+ logical function testPtr(obj)
+ class(t), pointer :: obj
+ testPtr = .false.
+ end function
+
+end