aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/nesting_1.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/nesting_1.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/nesting_1.f9018
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/nesting_1.f90 b/gcc/testsuite/gfortran.dg/nesting_1.f90
new file mode 100644
index 00000000000..51ebfd999a8
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/nesting_1.f90
@@ -0,0 +1,18 @@
+! PR 18525
+! we used to incorrectly refer to n from a when resolving the call to
+! c from b
+! { dg-do run }
+subroutine a(n)
+call b(n+1)
+contains
+ subroutine b(n)
+ call c(n)
+ end subroutine b
+
+ subroutine c(m)
+ if (m/=1) call abort
+ end subroutine c
+end subroutine a
+
+call a(0)
+end