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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc3/] [gcc/] [testsuite/] [gfortran.dg/] [pure_formal_proc_2.f90] - Blame information for rev 581

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

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do compile }
2
! Tests the fix for PR36526, in which the call to getStrLen would
3
! generate an error due to the use of a wrong symbol in interface.c
4
!
5
! Contributed by Bálint Aradi 
6
!
7
module TestPure
8
  implicit none
9
 
10
  type T1
11
    character(10) :: str
12
  end type T1
13
 
14
contains
15
 
16
  pure function getT1Len(self) result(t1len)
17
    type(T1), pointer :: self
18
    integer :: t1len
19
 
20
    t1len = getStrLen(self%str)
21
 
22
  end function getT1Len
23
 
24
 
25
  pure function getStrLen(str) result(length)
26
    character(*), intent(in) :: str
27
    integer :: length
28
 
29
    length = len_trim(str)
30
 
31
  end function getStrLen
32
 
33
end module TestPure
34
 
35
 
36
program Test
37
  use TestPure
38
  implicit none
39
 
40
  type(T1), pointer :: pT1
41
 
42
  allocate(pT1)
43
  pT1%str = "test"
44
  write (*,*) getT1Len(pT1)
45
  deallocate(pT1)
46
 
47
end program Test
48
! { dg-final { cleanup-modules "TestPure" } }

powered by: WebSVN 2.1.0

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