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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [bind_c_usage_8.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, though there is a warning about the type of len
3
! (return variable of strlen()) for being implicit.
4
! PR fortran/32797
5
!
6
MODULE ISO_C_UTILITIES
7
   USE ISO_C_BINDING
8
   implicit none
9
   CHARACTER(C_CHAR), DIMENSION(1), SAVE, TARGET, PRIVATE :: dummy_string="?"
10
CONTAINS
11
   FUNCTION C_F_STRING(CPTR) RESULT(FPTR)
12
     use, intrinsic :: iso_c_binding
13
      TYPE(C_PTR), INTENT(IN) :: CPTR ! The C address
14
      CHARACTER(KIND=C_CHAR), DIMENSION(:), POINTER :: FPTR
15
      INTERFACE
16
         FUNCTION strlen(string) RESULT(len) BIND(C,NAME="strlen") ! { dg-warning "Implicitly declared" }
17
            USE ISO_C_BINDING
18
            TYPE(C_PTR), VALUE :: string ! A C pointer
19
         END FUNCTION
20
      END INTERFACE
21
      CALL C_F_POINTER(FPTR=FPTR, CPTR=CPTR, SHAPE=[strlen(CPTR)])
22
   END FUNCTION
23
END MODULE ISO_C_UTILITIES
24
! { dg-final { cleanup-modules "iso_c_utilities" } }
25
 

powered by: WebSVN 2.1.0

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