diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/elemental_result_1.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/elemental_result_1.f90 | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/elemental_result_1.f90 b/gcc/testsuite/gfortran.dg/elemental_result_1.f90 new file mode 100644 index 000000000..2a6dee00c --- /dev/null +++ b/gcc/testsuite/gfortran.dg/elemental_result_1.f90 @@ -0,0 +1,21 @@ +! { dg-do compile } +! Tests the fix for PR20874 in which array valued elemental +! functions were permitted. +! +! Contributed by Joost VandeVondele <jv244@cam.ac.uk> +! +MODULE Test +CONTAINS + ELEMENTAL FUNCTION LL(I) ! { dg-error "must have a scalar result" } + INTEGER, INTENT(IN) :: I + INTEGER :: LL(2) + END FUNCTION LL +! +! This was already OK. +! + ELEMENTAL FUNCTION MM(I) + INTEGER, INTENT(IN) :: I + INTEGER, pointer :: MM ! { dg-error "conflicts with ELEMENTAL" } + END FUNCTION MM +END MODULE Test +! { dg-final { cleanup-modules "Test" } } |