aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gfortran.dg/iso_c_binding_rename_2.f03
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gfortran.dg/iso_c_binding_rename_2.f03')
-rw-r--r--gcc-4.9/gcc/testsuite/gfortran.dg/iso_c_binding_rename_2.f0340
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gfortran.dg/iso_c_binding_rename_2.f03 b/gcc-4.9/gcc/testsuite/gfortran.dg/iso_c_binding_rename_2.f03
new file mode 100644
index 000000000..75797e78f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gfortran.dg/iso_c_binding_rename_2.f03
@@ -0,0 +1,40 @@
+! { dg-do run }
+! { dg-additional-sources iso_c_binding_rename_2_driver.c }
+module mod0
+ use, intrinsic :: iso_c_binding, only: c_ptr, c_associated
+end module mod0
+
+module mod1
+ use mod0, my_c_ptr => c_ptr, my_c_associated => c_associated
+end module mod1
+
+module mod2
+contains
+ subroutine sub2(my_ptr1) bind(c)
+ use mod1, my_c_ptr_2 => my_c_ptr, my_c_associated_2 => my_c_associated
+ implicit none
+ type(my_c_ptr_2) :: my_ptr1
+ if( .not. my_c_associated_2(my_ptr1)) then
+ call abort()
+ end if
+ end subroutine sub2
+
+ subroutine sub3(my_ptr1) bind(c)
+ use mod1, my_c_ptr_2 => my_c_ptr
+ implicit none
+ type(my_c_ptr_2) :: my_ptr1
+ if( .not. my_c_associated(my_ptr1)) then
+ call abort()
+ end if
+ end subroutine sub3
+
+ subroutine sub4(my_ptr1) bind(c)
+ use mod1, my_c_associated_3 => my_c_associated
+ implicit none
+ type(my_c_ptr) :: my_ptr1
+ if( .not. my_c_associated_3(my_ptr1)) then
+ call abort()
+ end if
+ end subroutine sub4
+
+end module mod2