gcc/testsuite/gfortran.dg/elemental_function_4.f90
raw| 1 | ! { dg-do compile } |
| 2 | ! |
| 3 | ! Tests the fix for PR83999, where the invalid function 'f' caused an ICE. |
| 4 | ! |
| 5 | ! Contributed by Gerhard Steinmetz <[email protected]> |
| 6 | ! |
| 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 |