summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/class_32.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/class_32.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/class_32.f9041
1 files changed, 41 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/class_32.f90 b/gcc/testsuite/gfortran.dg/class_32.f90
new file mode 100644
index 000000000..b5857c1f6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_32.f90
@@ -0,0 +1,41 @@
+! { dg-do compile }
+!
+! PR 45827: [4.6 Regression] [OOP] mio_component_ref(): Component not found
+!
+! Contributed by Daniel Franke <dfranke@gcc.gnu.org>
+
+MODULE m
+
+ TYPE, ABSTRACT :: t
+ PRIVATE
+ INTEGER :: n
+ CONTAINS
+ PROCEDURE :: get
+ END TYPE
+
+ ABSTRACT INTERFACE
+ SUBROUTINE create(this)
+ IMPORT t
+ CLASS(t) :: this
+ END SUBROUTINE
+ END INTERFACE
+
+CONTAINS
+
+ FUNCTION get(this)
+ CLASS(t) :: this
+ REAL, DIMENSION(this%n) :: get
+ END FUNCTION
+
+ SUBROUTINE destroy(this)
+ CLASS(t) :: this
+ END SUBROUTINE
+
+END MODULE
+
+
+PROGRAM p
+ USE m
+END
+
+! { dg-final { cleanup-modules "m" } }