diff options
author | Ben Cheng <bccheng@google.com> | 2013-03-28 11:14:20 -0700 |
---|---|---|
committer | Ben Cheng <bccheng@google.com> | 2013-03-28 12:40:33 -0700 |
commit | af0c51ac87ab2a87caa03fa108f0d164987a2764 (patch) | |
tree | 4b8b470f7c5b69642fdab8d0aa1fbc148d02196b /gcc-4.8/gcc/testsuite/gfortran.dg/array_memset_2.f90 | |
parent | d87cae247d39ebf4f5a6bf25c932a14d2fdb9384 (diff) | |
download | toolchain_gcc-af0c51ac87ab2a87caa03fa108f0d164987a2764.tar.gz toolchain_gcc-af0c51ac87ab2a87caa03fa108f0d164987a2764.tar.bz2 toolchain_gcc-af0c51ac87ab2a87caa03fa108f0d164987a2764.zip |
[GCC 4.8] Initial check-in of GCC 4.8.0
Change-Id: I0719d8a6d0f69b367a6ab6f10eb75622dbf12771
Diffstat (limited to 'gcc-4.8/gcc/testsuite/gfortran.dg/array_memset_2.f90')
-rw-r--r-- | gcc-4.8/gcc/testsuite/gfortran.dg/array_memset_2.f90 | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/testsuite/gfortran.dg/array_memset_2.f90 b/gcc-4.8/gcc/testsuite/gfortran.dg/array_memset_2.f90 new file mode 100644 index 000000000..28c15ae59 --- /dev/null +++ b/gcc-4.8/gcc/testsuite/gfortran.dg/array_memset_2.f90 @@ -0,0 +1,37 @@ +! { dg-do run } +! { dg-options "-O2 -fdump-tree-original" } + +module foo +contains + subroutine bar(a) + real, dimension(:,:) :: a + a(1,:) = 0. + end subroutine bar +end module foo + +program test + use foo + implicit none + real, dimension (2,2) :: a, d, e + real, dimension (1,2) :: b + real, dimension (2) :: c + data a, d, e /12*1.0/ + data b /2*1.0/ + data c /2*1.0/ + + a(1,:) = 0. ! This can't be optimized to a memset. + b(1,:) = 0. ! This is optimized to = {}. + c = 0. ! This is optimized to = {}. + d(:,1) = 0. ! This can't be otimized to a memset. + call bar(e) + + if (any(a /= reshape((/ 0.0, 1.0, 0.0, 1.0/), shape(a)))) call abort + if (any(b /= 0.)) call abort + if (any(c /= 0.)) call abort + if (any(d /= reshape((/ 0.0, 0.0, 1.0, 1.0/), shape(d)))) call abort + if (any(e /= reshape((/ 0.0, 1.0, 0.0, 1.0/), shape(e)))) call abort + +end program + +! { dg-final { scan-tree-dump-times "= {}" 2 "original" } } +! { dg-final { cleanup-tree-dump "original" } } |