diff options
author | Janus Weil <janus@gcc.gnu.org> | 2018-06-11 20:44:38 +0200 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2018-06-11 20:44:38 +0200 |
commit | c7927c3bb8f3e21ed77b17bcb62b0125f10c5b29 (patch) | |
tree | fb7de4b91b949d323991033e90af91994dd2c484 /gcc/testsuite | |
parent | 46e318cff70c1adcb0895092975c72f41f82404c (diff) | |
download | gcc-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/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/generic_32.f90 | 16 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/generic_33.f90 | 27 |
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 |