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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gfortran.dg/] [pr32627.f03] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 302 jeremybenn
! { dg-do run }
2
! { dg-additional-sources pr32627_driver.c }
3
! Verify that c_f_pointer exists for string arguments.
4
program main
5
  use iso_c_binding
6
  implicit none
7
  interface
8
     function get_c_string() bind(c)
9
       use, intrinsic :: iso_c_binding, only: c_ptr
10
       type(c_ptr) :: get_c_string
11
     end function get_c_string
12
  end interface
13
 
14
  type, bind( c ) :: A
15
    integer( c_int ) :: xc, yc
16
    type( c_ptr )    :: str
17
  end type
18
  type( c_ptr )               :: x
19
  type( A ), pointer          :: fptr
20
  type( A ), target           :: my_a_type
21
  character( len=9 ), pointer :: strptr
22
 
23
  fptr => my_a_type
24
 
25
  fptr%str = get_c_string()
26
 
27
  call c_f_pointer( fptr%str, strptr )
28
 
29
  print *, 'strptr is: ', strptr
30
end program main
31
 
32
 

powered by: WebSVN 2.1.0

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