summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/constant_substring.f
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/constant_substring.f')
-rw-r--r--gcc/testsuite/gfortran.dg/constant_substring.f13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/constant_substring.f b/gcc/testsuite/gfortran.dg/constant_substring.f
new file mode 100644
index 000000000..4ca11bc16
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/constant_substring.f
@@ -0,0 +1,13 @@
+! Simplify constant substring
+! { dg-do run }
+! { dg-options "-std=legacy" }
+!
+ character*2 a
+ character*4 b
+ character*6 c
+ parameter (a="12")
+ parameter (b = a(1:2))
+ write (c,'("#",A,"#")') b
+ if (c .ne. '#12 #') call abort
+ end
+