summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/class_23.f03
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/class_23.f03')
-rw-r--r--gcc/testsuite/gfortran.dg/class_23.f0324
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/class_23.f03 b/gcc/testsuite/gfortran.dg/class_23.f03
new file mode 100644
index 000000000..e1e351762
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/class_23.f03
@@ -0,0 +1,24 @@
+! { dg-do compile }
+!
+! PR 42051: [OOP] ICE on array-valued function with CLASS formal argument
+!
+! Original test case by Damian Rouson <damian@rouson.net>
+! Modified by Janus Weil <janus@gcc.gnu.org>
+
+ type grid
+ end type
+
+contains
+
+ function return_x(this) result(this_x)
+ class(grid) :: this
+ real ,dimension(1) :: this_x
+ end function
+
+ subroutine output()
+ type(grid) :: mesh
+ real ,dimension(1) :: x
+ x = return_x(mesh)
+ end subroutine
+
+end