1! { dg-do run }
2! { dg-options "-O -fdump-tree-original" }
3! Test that expressions in subroutine calls are also optimized
4program main
5  implicit none
6  character(len=4) :: c
7  c = 'abcd'
8  call yes(c == c)
9  call no(c /= c)
10end program main
11
12subroutine yes(a)
13  implicit none
14  logical, intent(in) :: a
15  if (.not. a) call abort
16end subroutine yes
17
18subroutine no(a)
19  implicit none
20  logical, intent(in) :: a
21  if (a) call abort
22end subroutine no
23
24! { dg-final { scan-tree-dump-times "gfortran_compare_string" 0 "original" } }
25
26