1! { dg-do compile }
2!
3! PR 42051: [OOP] ICE on array-valued function with CLASS formal argument
4!
5! Original test case by Damian Rouson <damian@rouson.net>
6! Modified by Janus Weil <janus@gcc.gnu.org>
7
8  type grid
9  end type 
10
11contains
12
13  function return_x(this) result(this_x)
14    class(grid) :: this
15    real  ,dimension(1) :: this_x
16  end function
17
18  subroutine output()
19    type(grid) :: mesh
20    real ,dimension(1) :: x
21    x = return_x(mesh)
22  end subroutine
23
24end
25