summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/pointer_check_7.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/pointer_check_7.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/pointer_check_7.f9036
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pointer_check_7.f90 b/gcc/testsuite/gfortran.dg/pointer_check_7.f90
new file mode 100644
index 000000000..0f6dcdc87
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pointer_check_7.f90
@@ -0,0 +1,36 @@
+! { dg-do compile }
+! { dg-options "-fcheck=pointer" }
+!
+! PR 45438: [4.6 Regression] [OOP] ICE with -fcheck=pointer
+!
+! Contributed by Salvatore Filippone <sfilippone@uniroma2.it>
+
+module base_mat_mod
+
+ implicit none
+
+ type :: base_sparse_mat
+ contains
+ procedure :: get_fmt
+ end type
+
+contains
+
+ function get_fmt(a) result(res)
+ class(base_sparse_mat), intent(in) :: a
+ character(len=5) :: res
+ res = 'NULL'
+ end function
+
+ subroutine errlog(name)
+ character(len=*) :: name
+ end subroutine
+
+ subroutine test (a)
+ class(base_sparse_mat), intent(in) :: a
+ call errlog(a%get_fmt())
+ end subroutine
+
+end module
+
+! { dg-final { cleanup-modules "base_mat_mod" } }