OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [c_f_pointer_shape_test.f90] - Blame information for rev 694

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { 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
14
 
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
19
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.