aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_6.f90
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2010-01-24 10:36:49 +0000
committerJan Hubicka <jh@suse.cz>2010-01-24 10:36:49 +0000
commite9fc1a6f86ca7b860854fee0ba9b33dfe5f93c63 (patch)
treedcf236316723541fe267b3437aa3779930381fe0 /gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_6.f90
parent4f5058063ea01ff1d1c475ffe9ed8a30eaa6ef8b (diff)
Merge.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/pretty-ipa@156196 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_6.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_6.f9035
1 files changed, 35 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_6.f90 b/gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_6.f90
new file mode 100644
index 00000000000..8898a597d53
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/proc_ptr_comp_pass_6.f90
@@ -0,0 +1,35 @@
+! { dg-do compile }
+! { dg-options "-fcheck=bounds" }
+!
+! PR 42804: ICE with -fcheck=bounds and type bound procedure call on array element
+!
+! Contributed by Ian Harvey <ian_harvey@bigpond.com>
+
+MODULE ModA
+ IMPLICIT NONE
+ TYPE, PUBLIC :: A
+ PROCEDURE(a_proc),pointer :: Proc
+ END TYPE A
+CONTAINS
+ SUBROUTINE a_proc(this, stat)
+ CLASS(A), INTENT(INOUT) :: this
+ INTEGER, INTENT(OUT) :: stat
+ WRITE (*, *) 'a_proc'
+ stat = 0
+ END SUBROUTINE a_proc
+END MODULE ModA
+
+PROGRAM ProgA
+ USE ModA
+ IMPLICIT NONE
+ INTEGER :: ierr
+ INTEGER :: i
+ TYPE(A), ALLOCATABLE :: arr(:)
+ ALLOCATE(arr(2))
+ DO i = 1, 2
+ arr(i)%proc => a_proc
+ CALL arr(i)%Proc(ierr)
+ END DO
+END PROGRAM ProgA
+
+! { dg-final { cleanup-modules "ModA" } }