summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/array_memset_1.f90
blob: cd6cb0d6d5d4e67559851ac2900bc27772876ba8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
! { dg-do compile }
! { dg-options "-O2 -fdump-tree-original" }
subroutine i1(a)
  integer :: a(20)
  a = 0;
end subroutine

subroutine i2(a)
  integer :: a(20)
  a(:) = 0;
end subroutine

subroutine i3(a)
  integer :: a(20)
  a(1:20) = 0;
end subroutine

subroutine r1(a)
  real :: a(20)
  a = 0.0;
end subroutine

subroutine r2(a)
  real :: a(20)
  a(:) = 0.0;
end subroutine

subroutine r3(a)
  real :: a(20)
  a(1:20) = 0.0;
end subroutine

subroutine z1(a)
  complex :: a(20)
  a = 0;
end subroutine

subroutine z2(a)
  complex :: a(20)
  a(:) = 0;
end subroutine

subroutine z3(a)
  complex :: a(20)
  a(1:20) = 0;
end subroutine

subroutine l1(a)
  logical :: a(20)
  a = .false.;
end subroutine

subroutine l2(a)
  logical :: a(20)
  a(:) = .false.;
end subroutine

subroutine l3(a)
  logical :: a(20)
  a(1:20) = .false.;
end subroutine

! { dg-final { scan-tree-dump-times "memset" 12 "original" } }
! { dg-final { cleanup-tree-dump "original" } }