summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/loop_versioning_6.f90
blob: ffd85798ea27a3390e4f01b659ef7c0ec704bcfd (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
! { dg-options "-O3 -fdump-tree-lversion-details" }

! Check that versioning can handle small groups of accesses.

subroutine f1(x)
  real :: x(:)
  do i = lbound(x, 1), ubound(x, 1) / 2
     x(i * 2) = 100
     x(i * 2 + 1) = 101
  end do
end subroutine f1

subroutine f2(x, n, step)
  integer :: n, step
  real :: x(n * step * 2)
  do i = 1, n
     x(i * step * 2) = 100
     x(i * step * 2 + 1) = 101
  end do
end subroutine f2

subroutine f3(x, limit, step)
  integer :: limit, step
  real :: x(limit * 2)
  do i = 1, limit, step
     x(i * 2) = 100
     x(i * 2 + 1) = 101
  end do
end subroutine f3

subroutine f4(x)
  real :: x(:)
  do i = lbound(x, 1), ubound(x, 1) / 3
     x(i * 3) = 100
     x(i * 3 + 1) = 101
     x(i * 3 + 2) = 102
  end do
end subroutine f4

subroutine f5(x, n, step)
  integer :: n, step
  real :: x(n * step * 3)
  do i = 1, n
     x(i * step * 3) = 100
     x(i * step * 3 + 1) = 101
     x(i * step * 3 + 2) = 102
  end do
end subroutine f5

subroutine f6(x, limit, step)
  integer :: limit, step
  real :: x(limit * 3)
  do i = 1, limit, step
     x(i * 3) = 100
     x(i * 3 + 1) = 101
     x(i * 3 + 2) = 102
  end do
end subroutine f6

subroutine f7(x)
  real :: x(:)
  do i = lbound(x, 1), ubound(x, 1) / 4
     x(i * 4) = 100
     x(i * 4 + 1) = 101
     x(i * 4 + 2) = 102
     x(i * 4 + 3) = 103
  end do
end subroutine f7

subroutine f8(x, n, step)
  integer :: n, step
  real :: x(n * step * 4)
  do i = 1, n
     x(i * step * 4) = 100
     x(i * step * 4 + 1) = 101
     x(i * step * 4 + 2) = 102
     x(i * step * 4 + 3) = 103
  end do
end subroutine f8

subroutine f9(x, limit, step)
  integer :: limit, step
  real :: x(limit * 4)
  do i = 1, limit, step
     x(i * 4) = 100
     x(i * 4 + 1) = 101
     x(i * 4 + 2) = 102
     x(i * 4 + 3) = 103
  end do
end subroutine f9

! { dg-final { scan-tree-dump-times {want to version containing loop} 9 "lversion" { xfail { ! lp64 } } } }
! { dg-final { scan-tree-dump-times {versioned this loop} 9 "lversion" { xfail { ! lp64 } } } }