diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2009-08-20 20:16:15 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2009-08-20 20:16:15 +0000 |
commit | 41e5ee68bc52fc14920c096242e1bec6086d5848 (patch) | |
tree | 5e2a23a434d417969e7331bff3bf8a35314f62e9 /gcc | |
parent | 3110415b773bb07dc6a09bdb5f934f4a643a2ff2 (diff) | |
download | gcc-41e5ee68bc52fc14920c096242e1bec6086d5848.zip gcc-41e5ee68bc52fc14920c096242e1bec6086d5848.tar.gz gcc-41e5ee68bc52fc14920c096242e1bec6086d5848.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/c_f_pointer_tests_4.f90 | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c341ae8..b3d1357 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. diff --git a/gcc/testsuite/gfortran.dg/c_f_pointer_tests_4.f90 b/gcc/testsuite/gfortran.dg/c_f_pointer_tests_4.f90 new file mode 100644 index 0000000..4f5338d --- /dev/null +++ b/gcc/testsuite/gfortran.dg/c_f_pointer_tests_4.f90 @@ -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 |