URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [c_assoc.f90] - Rev 694
Compare with Previous | Blame | View Log
! { dg-do run }! { dg-additional-sources test_c_assoc.c }module c_assocuse, intrinsic :: iso_c_bindingimplicit nonecontainsfunction test_c_assoc_0(my_c_ptr) bind(c)use, intrinsic :: iso_c_binding, only: c_ptr, c_int, c_associatedinteger(c_int) :: test_c_assoc_0type(c_ptr), value :: my_c_ptrif(c_associated(my_c_ptr)) thentest_c_assoc_0 = 1elsetest_c_assoc_0 = 0endifend function test_c_assoc_0function test_c_assoc_1(my_c_ptr_1, my_c_ptr_2) bind(c)use, intrinsic :: iso_c_binding, only: c_ptr, c_int, c_associatedinteger(c_int) :: test_c_assoc_1type(c_ptr), value :: my_c_ptr_1type(c_ptr), value :: my_c_ptr_2if(c_associated(my_c_ptr_1, my_c_ptr_2)) thentest_c_assoc_1 = 1elsetest_c_assoc_1 = 0endifend function test_c_assoc_1function test_c_assoc_2(my_c_ptr_1, my_c_ptr_2, num_ptrs) bind(c)integer(c_int) :: test_c_assoc_2type(c_ptr), value :: my_c_ptr_1type(c_ptr), value :: my_c_ptr_2integer(c_int), value :: num_ptrsif(num_ptrs .eq. 1) thenif(c_associated(my_c_ptr_1)) thentest_c_assoc_2 = 1elsetest_c_assoc_2 = 0endifelseif(c_associated(my_c_ptr_1, my_c_ptr_2)) thentest_c_assoc_2 = 1elsetest_c_assoc_2 = 0endifendifend function test_c_assoc_2subroutine verify_assoc(my_c_ptr_1, my_c_ptr_2) bind(c)type(c_ptr), value :: my_c_ptr_1type(c_ptr), value :: my_c_ptr_2if(.not. c_associated(my_c_ptr_1)) thencall abort()else if(.not. c_associated(my_c_ptr_2)) thencall abort()else if(.not. c_associated(my_c_ptr_1, my_c_ptr_2)) thencall abort()endifend subroutine verify_assocend module c_assoc! { dg-final { cleanup-modules "c_assoc" } }
