OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [substr_5.f90] - Blame information for rev 399

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do run }
2
!
3
  character(*), parameter  :: chrs = '-+.0123456789eEdD'
4
  character(*), parameter  :: expr = '-+.0123456789eEdD'
5
  integer :: i
6
 
7
  if (index(chrs(:), expr) /= 1) call abort
8
  if (index(chrs(14:), expr) /= 0) call abort
9
  if (index(chrs(:12), expr) /= 0) call abort
10
  if (index(chrs, expr(:)) /= 1) call abort
11
  if (index(chrs, expr(1:)) /= 1) call abort
12
  if (index(chrs, expr(:1)) /= 1) call abort
13
 
14
  if (foo(expr) /= 1) call abort
15
  if (foo(expr) /= 1) call abort
16
  if (foo(expr) /= 1) call abort
17
  if (foo(expr(:)) /= 1) call abort
18
  if (foo(expr(1:)) /= 1) call abort
19
  if (foo(expr(:1)) /= 1) call abort
20
 
21
  call bar(expr)
22
 
23
contains
24
  subroutine bar(expr)
25
    character(*), intent(in) :: expr
26
    character(*), parameter  :: chrs = '-+.0123456789eEdD'
27
    integer :: foo
28
 
29
    if (index(chrs(:), expr) /= 1) call abort
30
    if (index(chrs(14:), expr) /= 0) call abort
31
    if (index(chrs(:12), expr) /= 0) call abort
32
    if (index(chrs, expr(:)) /= 1) call abort
33
    if (index(chrs, expr(1:)) /= 1) call abort
34
    if (index(chrs, expr(:1)) /= 1) call abort
35
  end subroutine bar
36
 
37
  integer function foo(expr)
38
    character(*), intent(in) :: expr
39
    character(*), parameter  :: chrs = '-+.0123456789eEdD'
40
 
41
    foo = index(chrs, expr)
42
  end function foo
43
 
44
end

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.