From 19c41621feaa0d990122fdf028ade9c03889677a Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Wed, 3 Sep 2014 08:41:37 +0200 Subject: [PATCH] Missed that file in r213079 of 2014-07-26 2014-09-03 Tobias Burnus PR fortran/61881 PR fortran/61888 PR fortran/57305 * gfortran.dg/sizeof_4.f90: New. From-SVN: r214843 --- gcc/testsuite/ChangeLog | 7 ++ gcc/testsuite/gfortran.dg/sizeof_4.f90 | 95 ++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 gcc/testsuite/gfortran.dg/sizeof_4.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c36316ccbf7..51a8ca324b3 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2014-09-03 Tobias Burnus + + PR fortran/61881 + PR fortran/61888 + PR fortran/57305 + * gfortran.dg/sizeof_4.f90: New. + 2014-09-02 Bill Schmidt * gcc.target/powerpc/builtins-1.c: Add tests for vec_ctf, diff --git a/gcc/testsuite/gfortran.dg/sizeof_4.f90 b/gcc/testsuite/gfortran.dg/sizeof_4.f90 new file mode 100644 index 00000000000..d4d8baa8d04 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/sizeof_4.f90 @@ -0,0 +1,95 @@ +! { dg-do run } +! +! PR fortran/61881 +! PR fortran/61888 +! +! +use iso_c_binding +implicit none + +call dim0(5, 4) + +call dim1([1, 2, 3], 4*3) + +call dimd(5, 4) +call dimd([1, 2, 3], 4*3) +call dimd(reshape([1, 4, 2, 3],[2, 2]), 4*4) + +call tdim1([1, 2, 3], 4*3) +call tdim1([1_8, 2_8, 3_8], 8*3) + +call tdimd(5, 4) +call tdimd([1, 2, 3], 4*3) +call tdimd(reshape([1, 4, 2, 3], [2, 2]), 4*4) +call tdimd(5_8, 8) +call tdimd([1_8, 2_8, 3_8], 8*3) +call tdimd(reshape([1_8, 4_8, 2_8, 3_8],[2,2]), 8*4) + +call cdim0(5, 4) + +call cdim1([1, 2, 3], 4*3) + +call cdimd(5, 4) +call cdimd([1, 2, 3], 4*3) +call cdimd(reshape([1,4,2,3],[2,2]), 4*4) +call cdimd(5_8, 8) +call cdimd([1_8, 2_8, 3_8], 8*3) +call cdimd(reshape([1_8, 4_8, 2_8, 3_8], [2, 2]), 8*4) + +contains + +subroutine dim0(x, expected_size) + integer :: x + integer, value :: expected_size + if (sizeof(x) /= expected_size) call abort() + if (storage_size(x)/8 /= expected_size) call abort() +end + +subroutine dim1(x, expected_size) + integer, dimension(:) :: x + integer, value :: expected_size + if (sizeof(x) /= expected_size) call abort() + if (storage_size(x)/8*size(x) /= expected_size) call abort() +end + +subroutine dimd(x, expected_size) + integer, dimension(..) :: x + integer, value :: expected_size + if (sizeof(x) /= expected_size) call abort() + if (storage_size(x)/8*size(x) /= expected_size) call abort() +end + +subroutine cdim0(x, expected_size) + class(*) :: x + integer, value :: expected_size + if (sizeof(x) /= expected_size) call abort() + if (storage_size(x)/8 /= expected_size) call abort() +end + +subroutine cdim1(x, expected_size) + class(*), dimension(:) :: x + integer, value :: expected_size + if (sizeof(x) /= expected_size) call abort() + if (storage_size(x)/8*size(x) /= expected_size) call abort() +end + +subroutine cdimd(x, expected_size) + class(*), dimension(..) :: x + integer, value :: expected_size + if (sizeof(x) /= expected_size) call abort() + if (storage_size(x)/8*size(x) /= expected_size) call abort() +end + +subroutine tdim1(x, expected_size) + type(*), dimension(:) :: x + integer, value :: expected_size + if (sizeof(x) /= expected_size) call abort() +end + +subroutine tdimd(x, expected_size) + type(*), dimension(..) :: x + integer, value :: expected_size + if (sizeof(x) /= expected_size) call abort() +end + +end -- 2.30.2