mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-25 00:16:15 +08:00
re PR fortran/40962 (Conversion problem for f-allocatable -> cptr -> fptr -> f-allocatable)
2009-08-20 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/40962 * iso_c_binding.c (c_f_pointer_u0): Multiply stride by previous stride. 2009-08-20 Thomas Koenig <tkoenig@gcc.gnu.org> PR libfortran/40962 * c_f_pointer_tests_4.f90: New test. From-SVN: r150974
This commit is contained in:
parent
3110415b77
commit
41e5ee68bc
@ -1,3 +1,8 @@
|
||||
2009-08-20 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR libfortran/40962
|
||||
* c_f_pointer_tests_4.f90: New test.
|
||||
|
||||
2009-08-20 Eric Botcazou <ebotcazou@adacore.com>
|
||||
|
||||
* gnat.dg/slice6.adb: New test.
|
||||
|
15
gcc/testsuite/gfortran.dg/c_f_pointer_tests_4.f90
Normal file
15
gcc/testsuite/gfortran.dg/c_f_pointer_tests_4.f90
Normal file
@ -0,0 +1,15 @@
|
||||
! { dg-do run }
|
||||
program main
|
||||
use iso_c_binding, only: c_ptr, c_loc, c_f_pointer
|
||||
implicit none
|
||||
integer, dimension(2,1,2), target :: table
|
||||
table = reshape ( (/ 1,2,-1,-2/), (/2,1,2/))
|
||||
call set_table (c_loc (table))
|
||||
contains
|
||||
subroutine set_table (cptr)
|
||||
type(c_ptr), intent(in) :: cptr
|
||||
integer, dimension(:,:,:), pointer :: table_tmp
|
||||
call c_f_pointer (cptr, table_tmp, (/2,1,2/))
|
||||
if (any(table_tmp /= table)) call abort
|
||||
end subroutine set_table
|
||||
end program main
|
@ -1,3 +1,9 @@
|
||||
2009-08-20 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR libfortran/40962
|
||||
* iso_c_binding.c (c_f_pointer_u0): Multiply stride by
|
||||
previous stride.
|
||||
|
||||
2009-08-20 Dave Korn <dave.korn.cygwin@gmail.com>
|
||||
|
||||
* Makefile.am (LTLDFLAGS): Add -bindir flag.
|
||||
|
@ -152,7 +152,7 @@ ISO_C_BINDING_PREFIX (c_f_pointer_u0) (void *c_ptr_in,
|
||||
}
|
||||
else
|
||||
{
|
||||
str = GFC_DESCRIPTOR_EXTENT(f_ptr_out,i-1);
|
||||
str = str * GFC_DESCRIPTOR_EXTENT(f_ptr_out,i-1);
|
||||
f_ptr_out->offset += str;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user