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

Sergio Afonso via flang-commits flang-commits at lists.llvm.org
Wed Aug 21 08:45:47 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:

Add a test for `!$omp scan inclusive(x) exclusive(y)` as well, for completeness.

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


More information about the flang-commits mailing list