[clang] [flang] [llvm] [OpenMP] Split UPDATE clause into two: for ATOMIC and for DEPOBJ (PR #212270)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 28 12:52:07 PDT 2026


================
@@ -0,0 +1,29 @@
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=52 -ast-dump %s | FileCheck %s --check-prefix=DUMP
+// expected-no-diagnostics
+
+// Check that the "update" clause is represented in AST by OMPUpdateClause
+// when used on "atomic" consturct.
+int check_atomic(int x) {
+  #pragma omp atomic update
+  x = x + 1;
+
+  return x;
+}
+
+// DUMP: FunctionDecl {{.*}} check_atomic 'int (int)' external-linkage
+// DUMP: OMPAtomicDirective
+// DUMP: OMPUpdateClause
+
+using omp_depend_t = void *;
+
+// Check that the "update" clause is represented in AST by
+// OMPUpdateDependObjectsClause when used on "depobj" consturct.
----------------
alexey-bataev wrote:

```suggestion
// OMPUpdateDependObjectsClause when used on "depobj" construct.
```

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


More information about the cfe-commits mailing list