[flang-commits] [flang] [llvm] [Flang][OpenMP][Sema] Adding parsing and semantic support for scan directive. (PR #102792)

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Thu Aug 29 03:38:42 PDT 2024


================
@@ -0,0 +1,19 @@
+! RUN: %python %S/../test_errors.py %s %flang_fc1 -fopenmp
+
+subroutine test_scan()
+ integer x, k
+ 
+ !ERROR: Orphaned `omp scan` directives are prohibited; perhaps you forgot to enclose the directive in to a worksharing loop, a worksharing loop simd or a simd directive.
+ !$omp scan inclusive(x)
+ !$omp parallel do simd reduction(inscan,+: x)
+ do k = 1, n
+ !ERROR: UNTIED clause is not allowed on the SCAN directive
+   !$omp scan untied
+ end do
+ 
+ !$omp parallel do simd reduction(inscan,+: x)
+ do k = 1, n
+ !ERROR: Exactly one of `exclusive` or `inclusive` clause is expected
----------------
skatrak wrote:

Nit: Add `y` to the list of reduction variables, so that this test doesn't potentially break after adding that check.

https://github.com/llvm/llvm-project/pull/102792


More information about the flang-commits mailing list