summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/dependency_47.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/dependency_47.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/dependency_47.f9014
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/dependency_47.f90 b/gcc/testsuite/gfortran.dg/dependency_47.f90
new file mode 100644
index 00000000000..4888771c183
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/dependency_47.f90
@@ -0,0 +1,14 @@
+! { dg-do compile }
+! Make sure there is only one instance of a temporary variable here.
+! { dg-options "-fdump-tree-original" }
+
+SUBROUTINE prtdata(ilen)
+ INTEGER :: ilen
+ character(len=ilen), allocatable :: cline(:)
+ allocate(cline(2))
+ cline(1) = 'a'
+ cline(1)(2:3) = cline(1)(1:2)
+ cline(2) = cline(1)
+ print *,c
+END SUBROUTINE prtdata
+! { dg-final { scan-tree-dump-not "__var_" "original" } }