| 1 |
! PR fortran/84418 |
| 2 |
! { dg-do run { target vect_simd_clones } } |
| 3 |
! { dg-options "-fno-inline" } |
| 4 |
! { dg-additional-options "-msse2" { target sse2_runtime } } |
| 5 |
! { dg-additional-options "-mavx" { target avx_runtime } } |
| 6 |
|
| 7 |
real :: a(1024), b(1024), c(1024) |
| 8 |
integer :: i |
| 9 |
do i = 1, 1024 |
| 10 |
a(i) = 0.5 * i |
| 11 |
b(i) = 1.5 * i |
| 12 |
end do |
| 13 |
!$omp simd |
| 14 |
do i = 1, 1024 |
| 15 |
c(i) = foo (a(i), b(i)) |
| 16 |
end do |
| 17 |
do i = 1, 1024 |
| 18 |
if (c(i).ne.(2 * i)) stop 1 |
| 19 |
end do |
| 20 |
contains |
| 21 |
real function foo (x, y) |
| 22 |
real :: x, y |
| 23 |
!$omp declare simd linear (ref (x, y)) |
| 24 |
foo = x + y |
| 25 |
end function |
| 26 |
end |