Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gfortran.dg/string_compare_4.f90 @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 ! { dg-do compile } | |
2 ! { dg-options "-ffrontend-optimize -fdump-tree-original" } | |
3 ! PR fortran/52537 - optimize comparisons with empty strings | |
4 program main | |
5 implicit none | |
6 character(len=10) :: a | |
7 character(len=30) :: line | |
8 character(len=4,kind=4) :: c4 | |
9 line = 'x' | |
10 read (unit=line,fmt='(A)') a | |
11 c4 = 4_'foo' | |
12 if (c4 == 4_' ') print *,"foobar" | |
13 if (trim(a) == '') print *,"empty" | |
14 call foo(a) | |
15 if (trim(a) == ' ') print *,"empty" | |
16 contains | |
17 subroutine foo(b) | |
18 character(*) :: b | |
19 if (b /= ' ') print *,"full" | |
20 end subroutine foo | |
21 end program main | |
22 ! { dg-final { scan-tree-dump-times "_gfortran_string_len_trim" 4 "original" } } |