| 1 |
! { dg-do compile } |
| 2 |
! Verify that the compiler catches the error in the call to c_f_pointer |
| 3 |
! because it is missing the required SHAPE argument. The SHAPE argument |
| 4 |
! is optional, in general, but must exist if given a Fortran pointer |
| 5 |
! to a non-zero rank object. --Rickett, 09.26.06 |
| 6 |
module c_f_pointer_shape_test |
| 7 |
contains |
| 8 |
subroutine test_0(myAssumedArray, cPtr) |
| 9 |
use, intrinsic :: iso_c_binding |
| 10 |
integer, dimension(*) :: myAssumedArray |
| 11 |
integer, dimension(:), pointer :: myArrayPtr |
| 12 |
integer, dimension(1:2), target :: myArray |
| 13 |
type(c_ptr), value :: cPtr |
| 14 |
|
| 15 |
myArrayPtr => myArray |
| 16 |
call c_f_pointer(cPtr, myArrayPtr) ! { dg-error "Expected SHAPE argument to C_F_POINTER with array FPTR" } |
| 17 |
end subroutine test_0 |
| 18 |
end module c_f_pointer_shape_test |