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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [gfortran.dg/] [c_f_pointer_shape_test.f90] - Rev 551

Go to most recent revision | Compare with Previous | Blame | View Log

! { dg-do compile }
! verify that the compiler catches the error in the call to c_f_pointer 
! because it is missing the required SHAPE parameter.  the SHAPE parameter 
! is optional, in general, but must exist if given a fortran pointer 
! to a non-zero rank object.  --Rickett, 09.26.06
module c_f_pointer_shape_test
contains
  subroutine test_0(myAssumedArray, cPtr)
    use, intrinsic :: iso_c_binding
    integer, dimension(*) :: myAssumedArray
    integer, dimension(:), pointer :: myArrayPtr
    integer, dimension(1:2), target :: myArray
    type(c_ptr), value :: cPtr
    
    myArrayPtr => myArray
    call c_f_pointer(cPtr, myArrayPtr) ! { dg-error "Missing SHAPE parameter" }
  end subroutine test_0
end module c_f_pointer_shape_test

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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