Retro68/gcc/gcc/testsuite/gfortran.dg/character_comparison_4.f90

39 lines
843 B
Fortran
Raw Normal View History

2012-03-27 23:13:14 +00:00
! { dg-do run }
! { dg-options "-O -fdump-tree-original" }
program main
implicit none
character(len=4) :: c, d
integer :: n
integer :: i
common /foo/ i
n = 0
i = 0
c = 'abcd'
d = 'efgh'
n = n + 1 ; if ('a' // c == 'a' // c) call yes
n = n + 1 ; if (c // 'a' == c // 'a') call yes
n = n + 1; if ('b' // c > 'a' // d) call yes
n = n + 1; if (c // 'b' > c // 'a') call yes
2018-12-28 15:30:48 +00:00
if ('a' // c /= 'a' // c) STOP 1
if ('a' // c // 'b' == 'a' // c // 'a') STOP 2
if ('b' // c == 'a' // c) STOP 3
if (c // 'a' == c // 'b') STOP 4
if (c // 'a ' /= c // 'a') STOP 5
if (c // 'b' /= c // 'b ') STOP 6
2012-03-27 23:13:14 +00:00
2018-12-28 15:30:48 +00:00
if (n /= i) STOP 7
2012-03-27 23:13:14 +00:00
end program main
subroutine yes
implicit none
common /foo/ i
integer :: i
i = i + 1
end subroutine yes
! { dg-final { scan-tree-dump-times "gfortran_compare_string" 0 "original" } }