diff options
Diffstat (limited to 'gcc/testsuite/gfortran.dg/impure_actual_1.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/impure_actual_1.f90 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/impure_actual_1.f90 b/gcc/testsuite/gfortran.dg/impure_actual_1.f90 new file mode 100644 index 000000000..43711d421 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/impure_actual_1.f90 @@ -0,0 +1,25 @@ +! { dg-do compile } +! Tests the fix for PR25056 in which a non-PURE procedure could be +! passed as the actual argument to a PURE procedure. +! +! Contributed by Joost VandeVondele <jv244@cam.ac.uk> +! +MODULE M1 +CONTAINS + FUNCTION L() + L=1 + END FUNCTION L + PURE FUNCTION J(K) + INTERFACE + PURE FUNCTION K() + END FUNCTION K + END INTERFACE + J=K() + END FUNCTION J +END MODULE M1 +USE M1 + write(6,*) J(L) ! { dg-error "Expected a PURE procedure for argument" } +END + +! { dg-final { cleanup-modules "M1" } } + |