diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-25 13:36:19 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-03-25 13:36:19 +0000 |
commit | e0f97db9eb84d304602eb35815ba9d188cd69e46 (patch) | |
tree | 84bddb2ec09b31241a95c5b1ded74d60cdff6239 /gcc/testsuite/gfortran.dg/intrinsic_unpack_2.f90 | |
parent | f80df6b2af919960ad08a6f1901ddebb654f981b (diff) | |
download | gcc-e0f97db9eb84d304602eb35815ba9d188cd69e46.tar.gz |
2008-03-24 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r133512
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@133515 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg/intrinsic_unpack_2.f90')
-rw-r--r-- | gcc/testsuite/gfortran.dg/intrinsic_unpack_2.f90 | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_unpack_2.f90 b/gcc/testsuite/gfortran.dg/intrinsic_unpack_2.f90 new file mode 100644 index 00000000000..613f70a1f07 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/intrinsic_unpack_2.f90 @@ -0,0 +1,31 @@ +! { dg-do run } +! { dg-require-effective-target fortran_large_real } +! Program to test the UNPACK intrinsic for large real type +program intrinsic_unpack + implicit none + integer,parameter :: k = selected_real_kind (precision (0.0_8) + 1) + + real(kind=k), dimension(3,3) :: ark, brk + logical, dimension(3, 3) :: mask + character(len=100) line1, line2 + integer i + + mask = reshape ((/.false.,.true.,.false.,.true.,.false.,.false.,& + &.false.,.false.,.true./), (/3, 3/)); + + ark = reshape ((/1._k, 0._k, 0._k, 0._k, 1._k, 0._k, 0._k, 0._k, 1._k/), & + (/3, 3/)); + brk = unpack ((/2._k, 3._k, 4._k/), mask, ark) + if (any (brk .ne. reshape ((/1._k, 2._k, 0._k, 3._k, 1._k, 0._k, & + 0._k, 0._k, 4._k/), (/3, 3/)))) & + call abort + write (line1,'(9F9.5)') brk + write (line2,'(9F9.5)') unpack((/2._k, 3._k, 4._k/), mask, ark) + if (line1 .ne. line2) call abort + brk = -1._k + brk = unpack ((/2._k, 3._k, 4._k/), mask, 0._k) + if (any (brk .ne. reshape ((/0._k, 2._k, 0._k, 3._k, 0._k, 0._k, & + 0._k, 0._k, 4._k/), (/3, 3/)))) & + call abort + +end program |