| 1 |
! { dg-do compile } |
| 2 |
! { dg-options "-fopenmp" } |
| 3 |
|
| 4 |
module m |
| 5 |
implicit none |
| 6 |
|
| 7 |
integer :: i |
| 8 |
|
| 9 |
interface |
| 10 |
integer function bar (x, y, z) |
| 11 |
integer :: x, y |
| 12 |
integer, value :: z |
| 13 |
!$omp declare simd linear (x : ref, step (1)) linear (y : step (2), uval) |
| 14 |
end |
| 15 |
|
| 16 |
integer function baz (x, y, z) |
| 17 |
integer :: x |
| 18 |
integer, value :: y, z |
| 19 |
!$omp declare simd linear (x : step (1), uval) |
| 20 |
end |
| 21 |
|
| 22 |
integer function qux (x, ref) |
| 23 |
integer :: x |
| 24 |
integer, value :: ref |
| 25 |
!$omp declare simd linear (ref (x) : ref) uniform (ref) |
| 26 |
end |
| 27 |
|
| 28 |
integer function corge (x, ref) |
| 29 |
integer :: x |
| 30 |
integer, value :: ref |
| 31 |
!$omp declare simd linear (x : ref, step (ref)) uniform (ref) |
| 32 |
end |
| 33 |
|
| 34 |
integer function grault (x) |
| 35 |
integer :: x |
| 36 |
!$omp declare simd linear (x : ref) |
| 37 |
end |
| 38 |
|
| 39 |
integer function waldo (x) |
| 40 |
integer :: x |
| 41 |
!$omp declare simd linear (x : uval) |
| 42 |
end |
| 43 |
end interface |
| 44 |
|
| 45 |
contains |
| 46 |
|
| 47 |
integer function step (x) |
| 48 |
integer, value :: x |
| 49 |
step = x |
| 50 |
end |
| 51 |
|
| 52 |
subroutine foo (x, y) |
| 53 |
integer :: x, y |
| 54 |
!$omp simd linear (x: step (y + 1)) |
| 55 |
do i = 0, 9 |
| 56 |
x = x + y + 1 |
| 57 |
end do |
| 58 |
|
| 59 |
!$omp simd linear (x: val, step (y + 1)) |
| 60 |
do i = 0, 9 |
| 61 |
x = x + y + 1 |
| 62 |
end do |
| 63 |
|
| 64 |
!$omp parallel do linear (x: step (y + 1)) |
| 65 |
do i = 0, 9 |
| 66 |
x = x + y + 1 |
| 67 |
end do |
| 68 |
|
| 69 |
!$omp parallel do linear (x: step (y + 1), val) |
| 70 |
do i = 0, 9 |
| 71 |
x = x + y + 1 |
| 72 |
end do |
| 73 |
|
| 74 |
!$omp parallel do simd linear (x: step (y + 1)) |
| 75 |
do i = 0, 9 |
| 76 |
x = x + y + 1 |
| 77 |
end do |
| 78 |
|
| 79 |
!$omp parallel do simd linear (x: val, step (y + 1)) |
| 80 |
do i = 0, 9 |
| 81 |
x = x + y + 1 |
| 82 |
end do |
| 83 |
|
| 84 |
!$omp parallel do simd linear (x: step (1) + 0) |
| 85 |
do i = 0, 9 |
| 86 |
x = x + step (1) + 0 |
| 87 |
end do |
| 88 |
|
| 89 |
block |
| 90 |
integer, parameter :: ref = 1, uval = 2 |
| 91 |
!$omp parallel do simd linear (x: ref + 0) |
| 92 |
do i = 0, 9 |
| 93 |
x = x + ref + 0 |
| 94 |
end do |
| 95 |
|
| 96 |
!$omp parallel do simd linear (x: uval * 1) |
| 97 |
do i = 0, 9 |
| 98 |
x = x + uval |
| 99 |
end do |
| 100 |
end block |
| 101 |
end |
| 102 |
end |