summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/overload_2.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/overload_2.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/overload_2.f9027
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/overload_2.f90 b/gcc/testsuite/gfortran.dg/overload_2.f90
new file mode 100644
index 000000000..feefb4607
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/overload_2.f90
@@ -0,0 +1,27 @@
+! { dg-do compile }
+! Test the fix for PR32157, in which overloading 'LEN', as
+! in 'test' below would cause a compile error.
+!
+! Contributed by Michael Richmond <michael.a.richmond@nasa.gov>
+!
+subroutine len(c)
+ implicit none
+ character :: c
+ c = "X"
+end subroutine len
+
+subroutine test()
+ implicit none
+ character :: str
+ external len
+ call len(str)
+ if(str /= "X") call abort()
+end subroutine test
+
+PROGRAM VAL
+ implicit none
+ external test
+ intrinsic len
+ call test()
+ if(len(" ") /= 1) call abort()
+END