summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/character_comparison_6.f90
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gfortran.dg/character_comparison_6.f90')
-rw-r--r--gcc/testsuite/gfortran.dg/character_comparison_6.f9020
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/character_comparison_6.f90 b/gcc/testsuite/gfortran.dg/character_comparison_6.f90
new file mode 100644
index 000000000..78f647705
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/character_comparison_6.f90
@@ -0,0 +1,20 @@
+! { dg-do run }
+! { dg-options "-O -fdump-tree-original" }
+program main
+ implicit none
+ character(len=4) :: c
+ integer :: n
+ integer :: i
+ common /foo/ i
+
+ n = 0
+ i = 0
+ c = 'abcd'
+ if ('a ' // c == 'a' // c) call abort
+ if ('a' // c == 'a ' // c) call abort
+end program main
+
+! { dg-final { scan-tree-dump-times "gfortran_concat_string" 4 "original" } }
+! { dg-final { scan-tree-dump-times "gfortran_compare_string" 2 "original" } }
+! { dg-final { cleanup-tree-dump "original" } }
+