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

Subversion Repositories openrisc_me

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do compile }
2
! { dg-options "-fwhole-file" }
3
!
4
! Tests the fix for PR25087, in which the following invalid code
5
! was not detected.
6
!
7
! Contributed by Joost VandeVondele  
8
!
9
! Modified by Tobias Burnus to fix PR fortran/41235.
10
!
11
FUNCTION a()
12
  CHARACTER(len=10) :: a
13
  a = ''
14
END FUNCTION a
15
 
16
SUBROUTINE s(n)
17
  CHARACTER(LEN=n), EXTERNAL :: a ! { dg-error "must have an explicit interface" }
18
  CHARACTER(LEN=n), EXTERNAL :: d ! { dg-error "must have an explicit interface" }
19
  interface
20
    function b (m)                ! This is OK
21
      CHARACTER(LEN=m) :: b
22
      integer :: m
23
    end function b
24
  end interface
25
  write(6,*) a()
26
  write(6,*) b(n)
27
  write(6,*) c()
28
  write(6,*) d()
29
contains
30
    function c ()                ! This is OK
31
      CHARACTER(LEN=n):: c
32
      c = ""
33
    end function c
34
END SUBROUTINE s
35
 
36
FUNCTION d()
37
  CHARACTER(len=99) :: d
38
  d = ''
39
END FUNCTION d

powered by: WebSVN 2.1.0

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