2018-10-06 Paul Thomas <pault@gcc.gnu.org>
[official-gcc.git] / gcc / testsuite / gfortran.dg / elemental_function_4.f90
blobfbd55ac8ea53af6ef5b02576c08d599eac661067
1 ! { dg-do compile }
3 ! Tests the fix for PR83999, where the invalid function 'f' caused an ICE.
5 ! Contributed by Gerhard Steinmetz <gscfq@t-online.de>
7 program p
8 type t
9 integer :: a
10 end type
11 type(t) :: x(3)
12 x = f()
13 print *, x
14 contains
15 elemental function f() result(z) ! { dg-error "must have a scalar result" }
16 type(t), pointer :: z(:)
17 end
18 end