OSDN Git Service

2009-08-20 Thomas Koenig <tkoenig@gcc.gnu.org>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gfortran.dg / bind_c_usage_18.f90
1 ! { 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