mirror of
https://forge.sourceware.org/marek/gcc.git
synced 2026-02-22 03:47:02 -05:00
This patch improves diagnostics for the linear clause, providing a more accurate and intuitive recommendation for remediation if the deprecated syntax is used. Additionally updates the relevant test to reflect the changed verbiage of the warning. gcc/fortran/ChangeLog: * openmp.cc (gfc_match_omp_clauses): New diagnostic logic. libgomp/ChangeLog: * testsuite/libgomp.fortran/pr84418-1.f90: Fix verbiage of dg-warning to reflect updated warning.
28 lines
791 B
Fortran
28 lines
791 B
Fortran
! PR fortran/84418
|
|
! { dg-do run { target vect_simd_clones } }
|
|
! { dg-options "-fno-inline" }
|
|
! { dg-additional-options "-msse2" { target sse2_runtime } }
|
|
! { dg-additional-options "-mavx" { target avx_runtime } }
|
|
! { dg-warning "Specification of the list items as arguments to the modifiers at \\(1\\) is deprecated; since OpenMP 5.2, use 'linear\\(x, y : ref\\)' \\\[-Wdeprecated-openmp\\\]" "" { target *-*-* } 24 }
|
|
|
|
real :: a(1024), b(1024), c(1024)
|
|
integer :: i
|
|
do i = 1, 1024
|
|
a(i) = 0.5 * i
|
|
b(i) = 1.5 * i
|
|
end do
|
|
!$omp simd
|
|
do i = 1, 1024
|
|
c(i) = foo (a(i), b(i))
|
|
end do
|
|
do i = 1, 1024
|
|
if (c(i).ne.(2 * i)) stop 1
|
|
end do
|
|
contains
|
|
real function foo (x, y)
|
|
real :: x, y
|
|
!$omp declare simd linear (ref (x, y))
|
|
foo = x + y
|
|
end function
|
|
end
|