summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/result_1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/result_1.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/result_1.f9018
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/result_1.f90 b/gcc/testsuite/gfortran.dg/result_1.f90
new file mode 100644
index 00000000000..162ffaf5857
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/result_1.f90
@@ -0,0 +1,18 @@
+! { dg-do compile }
+!
+! PR 36704: Procedure pointer as function result
+!
+! Contributed by Janus Weil <janus@gcc.gnu.org>
+
+function f() result(r)
+real, parameter :: r = 5.0 ! { dg-error "attribute conflicts" }
+end function
+
+function g() result(s)
+real :: a,b,c
+namelist /s/ a,b,c ! { dg-error "attribute conflicts" }
+end function
+
+function h() result(t)
+type t ! { dg-error "attribute conflicts" }
+end function