1! { dg-do run }
2! { dg-additional-sources iso_c_binding_rename_2_driver.c }
3module mod0
4  use, intrinsic :: iso_c_binding, only: c_ptr, c_associated
5end module mod0
6
7module mod1
8  use mod0, my_c_ptr => c_ptr, my_c_associated => c_associated
9end module mod1
10
11module mod2
12contains
13  subroutine sub2(my_ptr1) bind(c)
14    use mod1, my_c_ptr_2 => my_c_ptr, my_c_associated_2 => my_c_associated
15    implicit none
16    type(my_c_ptr_2) :: my_ptr1
17    if( .not. my_c_associated_2(my_ptr1)) then
18       call abort()
19    end if
20  end subroutine sub2
21
22  subroutine sub3(my_ptr1) bind(c)
23    use mod1, my_c_ptr_2 => my_c_ptr
24    implicit none
25    type(my_c_ptr_2) :: my_ptr1
26    if( .not. my_c_associated(my_ptr1)) then
27       call abort()
28    end if
29  end subroutine sub3
30
31  subroutine sub4(my_ptr1) bind(c)
32    use mod1, my_c_associated_3 => my_c_associated
33    implicit none
34    type(my_c_ptr) :: my_ptr1
35    if( .not. my_c_associated_3(my_ptr1)) then
36       call abort()
37    end if
38  end subroutine sub4
39
40end module mod2
41