Daily bump.
[official-gcc.git] / gcc / testsuite / gfortran.dg / c_f_pointer_shape_test.f90
blobc6204bdac7f688870ec99c8f3958b85dde2999ae
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 parameter. the SHAPE parameter
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
15 myArrayPtr => myArray
16 call c_f_pointer(cPtr, myArrayPtr) ! { dg-error "Missing SHAPE parameter" }
17 end subroutine test_0
18 end module c_f_pointer_shape_test