OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [assumed_charlen_function_3.f90] - Blame information for rev 708

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! Tests the patch for PRs 25084, 20852, 25085 and 25086, all of
3
! which involve assumed character length functions.
4
! This test checks the things that should not emit errors.
5
!
6
! Contributed by Paul Thomas  
7
!
8
function is_OK (ch)                ! { dg-warning "Obsolescent feature" }
9
  character(*) is_OK, ch           ! OK in an external function
10
  is_OK = ch
11
end function is_OK
12
 
13
! The warning occurs twice for the next line; for 'more_OK' and for 'fcn';
14
function more_OK (ch, fcn)         ! { dg-warning "Obsolescent feature" }
15
  character(*) more_OK, ch
16
  character (*), external :: fcn   ! OK as a dummy argument
17
  more_OK = fcn (ch)
18
end function more_OK
19
 
20
  character(4) :: answer
21
  character(4), external :: is_OK, more_OK
22
 
23
  answer = is_OK ("isOK")          ! LEN defined in calling scope
24
  print *, answer
25
 
26
  answer = more_OK ("okay", is_OK) ! Actual arg has defined LEN
27
  print *, answer
28
 
29
  answer = also_OK ("OKOK")
30
  print *, answer
31
 
32
contains
33
  function also_OK (ch)
34
    character(4) also_OK
35
    character(*) ch
36
    also_OK = is_OK (ch)            ! LEN obtained by host association
37
  end function also_OK
38
END
39
 

powered by: WebSVN 2.1.0

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