[flang-commits] [flang] [llvm] [Flang] [OpenMP] Add semantic checks for detach clause in task (PR #119172)

Thirumalai Shaktivel via flang-commits flang-commits at lists.llvm.org
Thu Dec 26 01:22:12 PST 2024


================
@@ -0,0 +1,22 @@
+! REQUIRES: openmp_runtime
+! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=50
+! RUN: %python %S/../test_errors.py %s %flang_fc1 %openmp_flags -fopenmp-version=51
+
+! OpenMP Version 5.0: 2.10.1
+! Various checks for DETACH Clause
+
+program detach02
+    use omp_lib, only: omp_event_handle_kind
+    integer(omp_event_handle_kind)          :: event_01, event_02
+
+    !TODO: Throw following error for the versions 5.0 and 5.1
+    !ERR: At most one DETACH clause can appear on the TASK directive
----------------
Thirumalai-Shaktivel wrote:

This check is required for both OpenMP 5.0 and 5.1

So, for that, I can only add a check for this in OMP.td (by moving the clause to `allowedOnceClauses`) 
 and call `CheckAllowedClause`. but, this leads to throwing an error for OpenMP version >= 52. If I enclose `CheckAllowedClause` within an if block (checking the version to be 50 and 51). The clause context wouldn't be set as `SetContextClauseInfo` is called by this function, this caused a problem for version >= 52.
 
 @kparzysz, do you have any suggestions here?

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


More information about the flang-commits mailing list