| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-O2 -fdump-tree-original" } |
| 3 |
|
| 4 |
subroutine test1(n) |
| 5 |
implicit none |
| 6 |
integer(8) :: n |
| 7 |
real(4), allocatable :: z(:,:,:) |
| 8 |
|
| 9 |
allocate(z(n, 100, 200)) |
| 10 |
z = 0 |
| 11 |
end subroutine |
| 12 |
|
| 13 |
subroutine test2(n) |
| 14 |
implicit none |
| 15 |
integer(8) :: n |
| 16 |
integer, allocatable :: z(:,:,:) |
| 17 |
|
| 18 |
allocate(z(n, 100, 200)) |
| 19 |
z = 0 |
| 20 |
end subroutine |
| 21 |
|
| 22 |
subroutine test3(n) |
| 23 |
implicit none |
| 24 |
integer(8) :: n |
| 25 |
logical, allocatable :: z(:,:,:) |
| 26 |
|
| 27 |
allocate(z(n, 100, 200)) |
| 28 |
z = .false. |
| 29 |
end subroutine |
| 30 |
|
| 31 |
subroutine test4(n, z) |
| 32 |
implicit none |
| 33 |
integer :: n |
| 34 |
real, pointer :: z(:,:,:) ! need not be contiguous! |
| 35 |
z = 0 |
| 36 |
end subroutine |
| 37 |
|
| 38 |
subroutine test5(n, z) |
| 39 |
implicit none |
| 40 |
integer :: n |
| 41 |
real, contiguous, pointer :: z(:,:,:) |
| 42 |
z = 0 |
| 43 |
end subroutine |
| 44 |
|
| 45 |
subroutine test6 (n, z) |
| 46 |
implicit none |
| 47 |
integer :: n |
| 48 |
real, contiguous, pointer :: z(:,:,:) |
| 49 |
z(:,::1,:) = 0 |
| 50 |
end subroutine |
| 51 |
|
| 52 |
! { dg-final { scan-tree-dump-times "__builtin_memset" 5 "original" } } |