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_tests_4.f90] - Blame information for rev 774

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

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
program main
3
   use iso_c_binding, only: c_ptr, c_loc, c_f_pointer
4
   implicit none
5
   integer, dimension(2,1,2), target :: table
6
   table = reshape ( (/ 1,2,-1,-2/), (/2,1,2/))
7
   call set_table (c_loc (table))
8
contains
9
   subroutine set_table (cptr)
10
     type(c_ptr), intent(in) :: cptr
11
     integer, dimension(:,:,:), pointer :: table_tmp
12
     call c_f_pointer (cptr, table_tmp, (/2,1,2/))
13
     if (any(table_tmp /= table)) call abort
14
   end subroutine set_table
15
end program main

powered by: WebSVN 2.1.0

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