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/] [proc_ptr_25.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
! PR 41139: [4.5 Regression] a procedure pointer call as actual argument
4
!
5
! Original test case by Barron Bichon 
6
! Modified by Janus Weil 
7
 
8
PROGRAM test
9
 
10
 PROCEDURE(add), POINTER :: f
11
 logical :: g
12
 
13
 ! Passing the function works
14
 g=greater(4.,add(1.,2.))
15
 if (.not. g) call abort()
16
 
17
 ! Passing the procedure pointer fails
18
 f => add
19
 g=greater(4.,f(1.,2.))
20
 if (.not. g) call abort()
21
 
22
CONTAINS
23
 
24
 REAL FUNCTION add(x,y)
25
   REAL, INTENT(in) :: x,y
26
   print *,"add:",x,y
27
   add = x+y
28
 END FUNCTION add
29
 
30
 LOGICAL FUNCTION greater(x,y)
31
   REAL, INTENT(in) :: x, y
32
   greater = (x > y)
33
 END FUNCTION greater
34
 
35
END PROGRAM test
36
 

powered by: WebSVN 2.1.0

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