summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.fortran-torture/execute/intrinsic_index.f90
blob: 76f0aae532a22b0ec7b8729c27d4eeacb32ecb0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
! Program to test the INDEX intrinsic
program test
  character(len=10) a
  integer w
  if (index("FORTRAN", "R") .ne. 3) call abort
  if (index("FORTRAN", "R", .TRUE.) .ne. 5) call abort
  if (w ("FORTRAN") .ne. 3) call abort
end

function w(str)
  character(len=7) str
  integer w
  w = index(str, "R")
end