PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / gfortran.dg / c_loc_tests_5.f03
blob48597cb6bd8d1dfda214cb544f8b0d00e34df997
1 ! { dg-do compile }
2 module c_loc_tests_5
3   use, intrinsic :: iso_c_binding, only: c_char, c_ptr, c_loc, c_int
5 contains
6   subroutine sub0() bind(c)
7     type(c_ptr) :: f_ptr, my_c_ptr
8     character(kind=c_char, len=20), target :: format
9     integer(c_int), dimension(:), pointer :: int_ptr
10     integer(c_int), dimension(10), target :: int_array
12     f_ptr = c_loc(format(1:1))
14     int_ptr => int_array
15     my_c_ptr = c_loc(int_ptr(0))
17   end subroutine sub0
18 end module c_loc_tests_5