modula2: Simplify REAL/LONGREAL/SHORTREAL node creation.
[official-gcc.git] / gcc / testsuite / gfortran.dg / bind_c_usage_18.f90
blobede9f60e83fb72cbd1e903c120ff97ef669bc4ea
1 ! { dg-do compile }
2 ! { dg-options "-Wc-binding-type" }
4 ! PR fortran/38160
7 subroutine foo(x,y,z,a) bind(c) ! { dg-warning "but may not be C interoperable" }
8 use iso_c_binding
9 implicit none
10 integer(4) :: x
11 integer(c_float) :: y ! { dg-warning "C kind type parameter is for type REAL" }
12 complex(c_float) :: z ! OK, c_float == c_float_complex
13 real(c_float_complex) :: a ! OK, c_float == c_float_complex
14 end subroutine foo
16 use iso_c_binding
17 implicit none
18 integer, parameter :: it = c_int
19 integer, parameter :: dt = c_double
20 complex(c_int), target :: z1 ! { dg-warning "C kind type parameter is for type INTEGER" }
21 complex(it), target :: z2 ! { dg-warning "C kind type parameter is for type INTEGER" }
22 complex(c_double), target :: z3 ! OK
23 complex(dt), target :: z4 ! OK
24 type(c_ptr) :: ptr
26 ptr = c_loc(z1)
27 ptr = c_loc(z2)
28 ptr = c_loc(z3)
29 ptr = c_loc(z4)
30 end