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_18.f90] - Blame information for rev 713

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
!
3
! PR fortran/38160
4
!
5
 
6
subroutine foo(x,y,z,a) bind(c) ! { dg-warning "but may not be C interoperable" }
7
  use iso_c_binding
8
  implicit none
9
  integer(4) :: x
10
  integer(c_float) :: y ! { dg-warning "C kind type parameter is for type REAL" }
11
  complex(c_float) :: z ! OK, c_float == c_float_complex
12
  real(c_float_complex) :: a ! OK, c_float == c_float_complex
13
end subroutine foo
14
 
15
use iso_c_binding
16
implicit none
17
integer, parameter :: it = c_int
18
integer, parameter :: dt = c_double
19
complex(c_int), target    :: z1  ! { dg-warning "C kind type parameter is for type INTEGER" }
20
complex(it), target       :: z2  ! { dg-warning "C kind type parameter is for type INTEGER" }
21
complex(c_double), target :: z3  ! OK
22
complex(dt), target       :: z4  ! OK
23
type(c_ptr) :: ptr
24
 
25
ptr = c_loc(z1)
26
ptr = c_loc(z2)
27
ptr = c_loc(z3)
28
ptr = c_loc(z4)
29
end

powered by: WebSVN 2.1.0

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