summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/generic_25.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/generic_25.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/generic_25.f9030
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/generic_25.f90 b/gcc/testsuite/gfortran.dg/generic_25.f90
new file mode 100644
index 0000000000..39b7e23eb0
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/generic_25.f90
@@ -0,0 +1,30 @@
+! { dg-do run }
+!
+! PR 45521: [F08] GENERIC resolution with ALLOCATABLE/POINTER and PROCEDURE
+!
+! Contributed by <wangmianzhi1@linuxmail.org>
+
+ interface test
+ procedure testAlloc
+ procedure testPtr
+ end interface
+
+ integer, allocatable :: a1
+ integer, pointer :: a2
+
+ if (.not.test(a1)) call abort()
+ if (test(a2)) call abort()
+
+contains
+
+ logical function testAlloc(obj)
+ integer, allocatable :: obj
+ testAlloc = .true.
+ end function
+
+ logical function testPtr(obj)
+ integer, pointer :: obj
+ testPtr = .false.
+ end function
+
+end