Debian Codegraph @

gcc/testsuite/gfortran.dg/iso_c_binding_rename_2.f03

raw
1 ! { dg-do run }
2 ! { dg-additional-sources iso_c_binding_rename_2_driver.c }
3 module mod0
4 use, intrinsic :: iso_c_binding, only: c_ptr, c_associated
5 end module mod0
6
7 module mod1
8 use mod0, my_c_ptr => c_ptr, my_c_associated => c_associated
9 end module mod1
10
11 module mod2
12 contains
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 STOP 1
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 STOP 2
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 STOP 3
37 end if
38 end subroutine sub4
39
40 end module mod2