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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [c_f_pointer_tests_2.f03] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
! This should compile.  There was a bug in resolving c_f_pointer that was
3
! caused by not sorting the actual args to match the order of the formal args.
4
! PR fortran/32800
5
!
6
FUNCTION C_F_STRING(CPTR) RESULT(FPTR)
7
  USE ISO_C_BINDING
8
  implicit none
9
  TYPE(C_PTR), INTENT(IN) :: CPTR ! The C address
10
  CHARACTER(KIND=C_CHAR), DIMENSION(:), POINTER :: FPTR
11
  INTERFACE
12
     FUNCTION strlen(string) RESULT(len) BIND(C,NAME="strlen")
13
       import
14
       TYPE(C_PTR), VALUE :: string ! A C pointer
15
       integer(c_int) :: len
16
     END FUNCTION strlen
17
  END INTERFACE
18
  CALL C_F_POINTER(FPTR=FPTR, CPTR=CPTR,SHAPE=[strlen(cptr)])
19
END FUNCTION C_F_STRING
20
 

powered by: WebSVN 2.1.0

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