2011-02-15 Tobias Burnus <burnus@net-b.de>
[official-gcc.git] / gcc / testsuite / gfortran.dg / bind_c_usage_18.f90
blob2bce215af1946d7772ab4a11b49caccb18bcfc1c
1 ! { dg-do compile }
3 ! PR fortran/38160
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
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
25 ptr = c_loc(z1)
26 ptr = c_loc(z2)
27 ptr = c_loc(z3)
28 ptr = c_loc(z4)
29 end