[clang] [llvm] [OpenMP 60] Update parsing and semantic support for `nowait` clause to accept optional argument (PR #159628)
Fazlay Rabbi via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 8 09:00:04 PDT 2025
https://github.com/mdfazlay updated https://github.com/llvm/llvm-project/pull/159628
>From e149407b9cd238d92ac4e19906bc79bbd2a21e31 Mon Sep 17 00:00:00 2001
From: Fazlay Rabbi <fazlay.rabbi at intel.com>
Date: Thu, 18 Sep 2025 11:53:59 -0700
Subject: [PATCH 1/6] [OpenMP 60] Update parsing and semantic support for
`nowait` clause to accept optional argument
This PR enhances the OpenMP `nowait` clause implementation by adding support
for optional argument in both parsing and semantic analysis phases.
Reference:
1. OpenMP 6.0 Specification, page 481
---
clang/include/clang/AST/OpenMPClause.h | 58 ++++++++++++++++---
clang/include/clang/AST/RecursiveASTVisitor.h | 3 +-
clang/include/clang/Sema/SemaOpenMP.h | 6 +-
clang/lib/AST/OpenMPClause.cpp | 14 ++++-
clang/lib/AST/StmtProfile.cpp | 5 +-
clang/lib/Parse/ParseOpenMP.cpp | 5 +-
clang/lib/Sema/SemaOpenMP.cpp | 25 +++++++-
clang/lib/Sema/TreeTransform.h | 21 ++++++-
clang/lib/Serialization/ASTReader.cpp | 5 +-
clang/lib/Serialization/ASTWriter.cpp | 5 +-
clang/test/OpenMP/nowait_ast_print.cpp | 56 ++++++++++++++++++
.../target_enter_data_nowait_messages.cpp | 14 ++++-
.../target_exit_data_nowait_messages.cpp | 10 +++-
clang/test/OpenMP/target_nowait_messages.cpp | 13 ++++-
.../target_parallel_for_nowait_messages.cpp | 14 ++++-
...rget_parallel_for_simd_nowait_messages.cpp | 14 ++++-
.../target_parallel_nowait_messages.cpp | 15 ++++-
.../OpenMP/target_simd_nowait_messages.cpp | 14 ++++-
...arget_teams_distribute_nowait_messages.cpp | 7 +--
...istribute_parallel_for_nowait_messages.cpp | 14 ++++-
...bute_parallel_for_simd_nowait_messages.cpp | 14 ++++-
..._teams_distribute_simd_nowait_messages.cpp | 14 ++++-
.../OpenMP/target_teams_nowait_messages.cpp | 15 +++--
.../OpenMP/target_update_nowait_messages.cpp | 12 ++--
clang/tools/libclang/CIndex.cpp | 4 +-
llvm/include/llvm/Frontend/OpenMP/OMP.td | 2 +
26 files changed, 316 insertions(+), 63 deletions(-)
create mode 100644 clang/test/OpenMP/nowait_ast_print.cpp
diff --git a/clang/include/clang/AST/OpenMPClause.h b/clang/include/clang/AST/OpenMPClause.h
index 68d220a77b18c..93c5d61de58ad 100644
--- a/clang/include/clang/AST/OpenMPClause.h
+++ b/clang/include/clang/AST/OpenMPClause.h
@@ -2291,18 +2291,62 @@ class OMPOrderedClause final
/// This represents 'nowait' clause in the '#pragma omp ...' directive.
///
/// \code
-/// #pragma omp for nowait
+/// #pragma omp for nowait (cond)
/// \endcode
-/// In this example directive '#pragma omp for' has 'nowait' clause.
-class OMPNowaitClause final : public OMPNoChildClause<llvm::omp::OMPC_nowait> {
+/// In this example directive '#pragma omp for' has simple 'nowait' clause with
+/// condition 'cond'.
+class OMPNowaitClause final : public OMPClause {
+ friend class OMPClauseReader;
+
+ /// Location of '('.
+ SourceLocation LParenLoc;
+
+ /// Condition of the 'nowait' clause.
+ Stmt *Condition = nullptr;
+
+ /// Set condition.
+ void setCondition(Expr *Cond) { Condition = Cond; }
+
public:
- /// Build 'nowait' clause.
+ /// Build 'nowait' clause with condition \a Cond.
///
+ /// \param Cond Condition of the clause.
/// \param StartLoc Starting location of the clause.
+ /// \param LParenLoc Location of '('.
/// \param EndLoc Ending location of the clause.
- OMPNowaitClause(SourceLocation StartLoc = SourceLocation(),
- SourceLocation EndLoc = SourceLocation())
- : OMPNoChildClause(StartLoc, EndLoc) {}
+ OMPNowaitClause(Expr *Cond, SourceLocation StartLoc, SourceLocation LParenLoc,
+ SourceLocation EndLoc)
+ : OMPClause(llvm::omp::OMPC_nowait, StartLoc, EndLoc),
+ LParenLoc(LParenLoc), Condition(Cond) {}
+
+ /// Build an empty clause.
+ OMPNowaitClause()
+ : OMPClause(llvm::omp::OMPC_nowait, SourceLocation(), SourceLocation()) {}
+
+ /// Sets the location of '('.
+ void setLParenLoc(SourceLocation Loc) { LParenLoc = Loc; }
+
+ /// Returns the location of '('.
+ SourceLocation getLParenLoc() const { return LParenLoc; }
+
+ /// Returns condition.
+ Expr *getCondition() const { return cast_or_null<Expr>(Condition); }
+
+ child_range children() { return child_range(&Condition, &Condition + 1); }
+
+ const_child_range children() const {
+ return const_child_range(&Condition, &Condition + 1);
+ }
+
+ child_range used_children();
+ const_child_range used_children() const {
+ auto Children = const_cast<OMPNowaitClause *>(this)->used_children();
+ return const_child_range(Children.begin(), Children.end());
+ }
+
+ static bool classof(const OMPClause *T) {
+ return T->getClauseKind() == llvm::omp::OMPC_nowait;
+ }
};
/// This represents 'untied' clause in the '#pragma omp ...' directive.
diff --git a/clang/include/clang/AST/RecursiveASTVisitor.h b/clang/include/clang/AST/RecursiveASTVisitor.h
index 7a2881f6124f3..c246c4ab458ba 100644
--- a/clang/include/clang/AST/RecursiveASTVisitor.h
+++ b/clang/include/clang/AST/RecursiveASTVisitor.h
@@ -3594,7 +3594,8 @@ bool RecursiveASTVisitor<Derived>::VisitOMPOrderedClause(OMPOrderedClause *C) {
}
template <typename Derived>
-bool RecursiveASTVisitor<Derived>::VisitOMPNowaitClause(OMPNowaitClause *) {
+bool RecursiveASTVisitor<Derived>::VisitOMPNowaitClause(OMPNowaitClause *C) {
+ TRY_TO(TraverseStmt(C->getCondition()));
return true;
}
diff --git a/clang/include/clang/Sema/SemaOpenMP.h b/clang/include/clang/Sema/SemaOpenMP.h
index daf58b18a03cb..0aa639b5fca0f 100644
--- a/clang/include/clang/Sema/SemaOpenMP.h
+++ b/clang/include/clang/Sema/SemaOpenMP.h
@@ -1021,8 +1021,10 @@ class SemaOpenMP : public SemaBase {
OMPClause *ActOnOpenMPClause(OpenMPClauseKind Kind, SourceLocation StartLoc,
SourceLocation EndLoc);
/// Called on well-formed 'nowait' clause.
- OMPClause *ActOnOpenMPNowaitClause(SourceLocation StartLoc,
- SourceLocation EndLoc);
+ OMPClause *
+ ActOnOpenMPNowaitClause(SourceLocation StartLoc, SourceLocation EndLoc,
+ SourceLocation LParenLoc = SourceLocation(),
+ Expr *Condition = nullptr);
/// Called on well-formed 'untied' clause.
OMPClause *ActOnOpenMPUntiedClause(SourceLocation StartLoc,
SourceLocation EndLoc);
diff --git a/clang/lib/AST/OpenMPClause.cpp b/clang/lib/AST/OpenMPClause.cpp
index 2ce4419940e52..b12afee848df8 100644
--- a/clang/lib/AST/OpenMPClause.cpp
+++ b/clang/lib/AST/OpenMPClause.cpp
@@ -309,6 +309,13 @@ OMPClause::child_range OMPIfClause::used_children() {
return child_range(&Condition, &Condition + 1);
}
+OMPClause::child_range OMPNowaitClause::used_children() {
+ if (Condition)
+ return child_range(&Condition, &Condition + 1);
+ Stmt *Null = nullptr;
+ return child_range(&Null, &Null);
+}
+
OMPClause::child_range OMPGrainsizeClause::used_children() {
if (Stmt **C = getAddrOfExprAsWritten(getPreInitStmt()))
return child_range(C, C + 1);
@@ -2113,8 +2120,13 @@ void OMPClausePrinter::VisitOMPOrderedClause(OMPOrderedClause *Node) {
}
}
-void OMPClausePrinter::VisitOMPNowaitClause(OMPNowaitClause *) {
+void OMPClausePrinter::VisitOMPNowaitClause(OMPNowaitClause *Node) {
OS << "nowait";
+ if (auto *Cond = Node->getCondition()) {
+ OS << "(";
+ Cond->printPretty(OS, nullptr, Policy, 0);
+ OS << ")";
+ }
}
void OMPClausePrinter::VisitOMPUntiedClause(OMPUntiedClause *) {
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index f3b5478222488..4c9a94a8da24e 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -585,7 +585,10 @@ void OMPClauseProfiler::VisitOMPOrderedClause(const OMPOrderedClause *C) {
Profiler->VisitStmt(Num);
}
-void OMPClauseProfiler::VisitOMPNowaitClause(const OMPNowaitClause *) {}
+void OMPClauseProfiler::VisitOMPNowaitClause(const OMPNowaitClause *C) {
+ if (C->getCondition())
+ Profiler->VisitStmt(C->getCondition());
+}
void OMPClauseProfiler::VisitOMPUntiedClause(const OMPUntiedClause *) {}
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 04f29c83dd457..205d6d0778ac0 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -3164,6 +3164,7 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
case OMPC_simdlen:
case OMPC_collapse:
case OMPC_ordered:
+ case OMPC_nowait:
case OMPC_priority:
case OMPC_grainsize:
case OMPC_num_tasks:
@@ -3212,7 +3213,8 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
ErrorFound = true;
}
- if ((CKind == OMPC_ordered || CKind == OMPC_partial) &&
+ if ((CKind == OMPC_ordered || CKind == OMPC_nowait ||
+ CKind == OMPC_partial) &&
PP.LookAhead(/*N=*/0).isNot(tok::l_paren))
Clause = ParseOpenMPClause(CKind, WrongDirective);
else if (CKind == OMPC_grainsize || CKind == OMPC_num_tasks ||
@@ -3277,7 +3279,6 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
case OMPC_holds:
Clause = ParseOpenMPSingleExprClause(CKind, WrongDirective);
break;
- case OMPC_nowait:
case OMPC_untied:
case OMPC_mergeable:
case OMPC_read:
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 0fa21e89b1236..b3c652a734f66 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -16491,6 +16491,9 @@ OMPClause *SemaOpenMP::ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind,
case OMPC_ordered:
Res = ActOnOpenMPOrderedClause(StartLoc, EndLoc, LParenLoc, Expr);
break;
+ case OMPC_nowait:
+ Res = ActOnOpenMPNowaitClause(StartLoc, EndLoc, LParenLoc, Expr);
+ break;
case OMPC_priority:
Res = ActOnOpenMPPriorityClause(Expr, StartLoc, LParenLoc, EndLoc);
break;
@@ -16546,7 +16549,6 @@ OMPClause *SemaOpenMP::ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind,
case OMPC_aligned:
case OMPC_copyin:
case OMPC_copyprivate:
- case OMPC_nowait:
case OMPC_untied:
case OMPC_mergeable:
case OMPC_threadprivate:
@@ -18107,9 +18109,26 @@ OMPClause *SemaOpenMP::ActOnOpenMPClause(OpenMPClauseKind Kind,
}
OMPClause *SemaOpenMP::ActOnOpenMPNowaitClause(SourceLocation StartLoc,
- SourceLocation EndLoc) {
+ SourceLocation EndLoc,
+ SourceLocation LParenLoc,
+ Expr *Condition) {
+ Expr *ValExpr = Condition;
+ if (Condition && LParenLoc.isValid()) {
+ if (!Condition->isValueDependent() && !Condition->isTypeDependent() &&
+ !Condition->isInstantiationDependent() &&
+ !Condition->containsUnexpandedParameterPack()) {
+ ExprResult Val = SemaRef.CheckBooleanCondition(StartLoc, Condition);
+ if (Val.isInvalid())
+ return nullptr;
+
+ ValExpr = Val.get();
+ }
+ } else {
+ ValExpr = nullptr;
+ }
DSAStack->setNowaitRegion();
- return new (getASTContext()) OMPNowaitClause(StartLoc, EndLoc);
+ return new (getASTContext())
+ OMPNowaitClause(ValExpr, StartLoc, LParenLoc, EndLoc);
}
OMPClause *SemaOpenMP::ActOnOpenMPUntiedClause(SourceLocation StartLoc,
diff --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 51b55b82f4208..7b45a1d5a1a2c 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -1865,6 +1865,17 @@ class TreeTransform {
LParenLoc, Num);
}
+ /// Build a new OpenMP 'nowait' clause.
+ ///
+ /// By default, performs semantic analysis to build the new OpenMP clause.
+ /// Subclasses may override this routine to provide different behavior.
+ OMPClause *RebuildOMPNowaitClause(Expr *Condition, SourceLocation StartLoc,
+ SourceLocation LParenLoc,
+ SourceLocation EndLoc) {
+ return getSema().OpenMP().ActOnOpenMPNowaitClause(StartLoc, EndLoc,
+ LParenLoc, Condition);
+ }
+
/// Build a new OpenMP 'private' clause.
///
/// By default, performs semantic analysis to build the new OpenMP clause.
@@ -10612,8 +10623,14 @@ TreeTransform<Derived>::TransformOMPDetachClause(OMPDetachClause *C) {
template <typename Derived>
OMPClause *
TreeTransform<Derived>::TransformOMPNowaitClause(OMPNowaitClause *C) {
- // No need to rebuild this clause, no template-dependent parameters.
- return C;
+ ExprResult Cond;
+ if (auto *Condition = C->getCondition()) {
+ Cond = getDerived().TransformExpr(Condition);
+ if (Cond.isInvalid())
+ return nullptr;
+ }
+ return getDerived().RebuildOMPNowaitClause(Cond.get(), C->getBeginLoc(),
+ C->getLParenLoc(), C->getEndLoc());
}
template <typename Derived>
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 6acf79acea111..e7876427610ea 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -11684,7 +11684,10 @@ void OMPClauseReader::VisitOMPDetachClause(OMPDetachClause *C) {
C->setLParenLoc(Record.readSourceLocation());
}
-void OMPClauseReader::VisitOMPNowaitClause(OMPNowaitClause *) {}
+void OMPClauseReader::VisitOMPNowaitClause(OMPNowaitClause *C) {
+ C->setCondition(Record.readSubExpr());
+ C->setLParenLoc(Record.readSourceLocation());
+}
void OMPClauseReader::VisitOMPUntiedClause(OMPUntiedClause *) {}
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 09b1e58ef220c..a082c4c9e2f76 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -7942,7 +7942,10 @@ void OMPClauseWriter::VisitOMPOrderedClause(OMPOrderedClause *C) {
Record.AddSourceLocation(C->getLParenLoc());
}
-void OMPClauseWriter::VisitOMPNowaitClause(OMPNowaitClause *) {}
+void OMPClauseWriter::VisitOMPNowaitClause(OMPNowaitClause *C) {
+ Record.AddStmt(C->getCondition());
+ Record.AddSourceLocation(C->getLParenLoc());
+}
void OMPClauseWriter::VisitOMPUntiedClause(OMPUntiedClause *) {}
diff --git a/clang/test/OpenMP/nowait_ast_print.cpp b/clang/test/OpenMP/nowait_ast_print.cpp
new file mode 100644
index 0000000000000..4151a397beb9c
--- /dev/null
+++ b/clang/test/OpenMP/nowait_ast_print.cpp
@@ -0,0 +1,56 @@
+// Check no warnings/errors
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -fsyntax-only -verify %s
+// expected-no-diagnostics
+
+// Check AST and unparsing
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -ast-dump %s | FileCheck %s --check-prefix=DUMP
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -ast-print %s | FileCheck %s --check-prefix=PRINT
+
+// Check same results after serialization round-trip
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -emit-pch -o %t %s
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -include-pch %t -ast-dump-all %s | FileCheck %s --check-prefix=DUMP
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fopenmp -fopenmp-version=60 -include-pch %t -ast-print %s | FileCheck %s --check-prefix=PRINT
+
+#ifndef HEADER
+#define HEADER
+
+void nowait() {
+ int A=1;
+
+ // DUMP: OMPTargetDirective
+ // DUMP-NEXT: OMPNowaitClause
+ // DUMP-NEXT: <<<NULL>>>
+ // PRINT: #pragma omp target nowait
+ #pragma omp target nowait
+ {
+ }
+
+ // DUMP: OMPTargetDirective
+ // DUMP-NEXT: OMPNowaitClause
+ // DUMP-NEXT: XXBoolLiteralExpr {{.*}} 'bool' false
+ // PRINT: #pragma omp target nowait(false)
+ #pragma omp target nowait(false)
+ {
+ }
+
+ // DUMP: OMPTargetDirective
+ // DUMP-NEXT: OMPNowaitClause
+ // DUMP-NEXT: XXBoolLiteralExpr {{.*}} 'bool' true
+ // PRINT: #pragma omp target nowait(true)
+ #pragma omp target nowait(true)
+ {
+ }
+
+ // DUMP: OMPTargetDirective
+ // DUMP-NEXT: OMPNowaitClause
+ // DUMP-NEXT: BinaryOperator {{.*}} 'bool' '>'
+ // DUMP-NEXT: ImplicitCastExpr {{.*}} 'int' <LValueToRValue>
+ // DUMP-NEXT: DeclRefExpr {{.*}} 'int' lvalue Var {{.*}} 'A' 'int'
+ // DUMP-NEXT: IntegerLiteral {{.*}} 'int' 5
+ // PRINT: #pragma omp target nowait(A > 5)
+ #pragma omp target nowait(A>5)
+ {
+ }
+
+}
+#endif
\ No newline at end of file
diff --git a/clang/test/OpenMP/target_enter_data_nowait_messages.cpp b/clang/test/OpenMP/target_enter_data_nowait_messages.cpp
index ba5eaf1d2214a..0b892325a1c69 100644
--- a/clang/test/OpenMP/target_enter_data_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_enter_data_nowait_messages.cpp
@@ -13,15 +13,23 @@ int main(int argc, char **argv) {
{}
#pragma omp target enter nowait data map(to: i) // expected-error {{expected an OpenMP directive}}
{}
- #pragma omp target enter data nowait() map(to: i) // expected-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}} expected-error {{expected at least one 'map' clause for '#pragma omp target enter data'}}
+ #pragma omp target enter data nowait() map(to: i) // expected-error {{expected expression}}
{}
- #pragma omp target enter data map(to: i) nowait( // expected-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}}
+ #pragma omp target enter data map(to: i) nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
{}
#pragma omp target enter data map(to: i) nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}}
{}
#pragma omp target enter data map(to: i) nowait device (-10u)
{}
- #pragma omp target enter data map(to: i) nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}}
+ #pragma omp target enter data map(to: i) nowait (3.14) device (-10u)
+ {}
+ #pragma omp target enter data map(to: i) nowait (argc>> i)
+ {}
+ #pragma omp target enter data map(to: i) nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ {}
+ #pragma omp target enter data map(to: i) nowait (argc > 0 ? argv[1] : argv[2])
+ {}
+ #pragma omp target enter data map(to: i) nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
{}
#pragma omp target enter data map(to: i) nowait nowait // expected-error {{directive '#pragma omp target enter data' cannot contain more than one 'nowait' clause}}
{}
diff --git a/clang/test/OpenMP/target_exit_data_nowait_messages.cpp b/clang/test/OpenMP/target_exit_data_nowait_messages.cpp
index 307e2c34b27fb..a248704a49e9e 100644
--- a/clang/test/OpenMP/target_exit_data_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_exit_data_nowait_messages.cpp
@@ -8,11 +8,15 @@ int main(int argc, char **argv) {
#pragma omp nowait target exit data map(from: i) // expected-error {{expected an OpenMP directive}}
#pragma omp target nowait exit data map(from: i) // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
#pragma omp target exit nowait data map(from: i) // expected-error {{expected an OpenMP directive}}
- #pragma omp target exit data nowait() map(from: i) // expected-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}} expected-error {{expected at least one 'map' clause for '#pragma omp target exit data'}}
- #pragma omp target exit data map(from: i) nowait( // expected-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}}
+ #pragma omp target exit data nowait() map(from: i) // expected-error {{expected expression}}
+ #pragma omp target exit data map(from: i) nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
#pragma omp target exit data map(from: i) nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}}
#pragma omp target exit data map(from: i) nowait device (-10u)
- #pragma omp target exit data map(from: i) nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}}
+ #pragma omp target exit data map(from: i) nowait (3.14) device (-10u)
+ #pragma omp target exit data map(from: i) nowait (argc>> i)
+ #pragma omp target exit data map(from: i) nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target exit data map(from: i) nowait (argc > 0 ? argv[1] : argv[2])
+ #pragma omp target exit data map(from: i) nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
#pragma omp target exit data map(from: i) nowait nowait // expected-error {{directive '#pragma omp target exit data' cannot contain more than one 'nowait' clause}}
#pragma omp target exit data nowait map(from: i) nowait // expected-error {{directive '#pragma omp target exit data' cannot contain more than one 'nowait' clause}}
return 0;
diff --git a/clang/test/OpenMP/target_nowait_messages.cpp b/clang/test/OpenMP/target_nowait_messages.cpp
index 6b8a1f4d0ac47..6c2d85529eb71 100644
--- a/clang/test/OpenMP/target_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_nowait_messages.cpp
@@ -6,13 +6,22 @@ void foo() {
}
int main(int argc, char **argv) {
- #pragma omp target nowait( // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
+ int i;
+ #pragma omp target nowait(// expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
foo();
#pragma omp target nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
foo();
#pragma omp target nowait device (-10u)
foo();
- #pragma omp target nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
+ #pragma omp target nowait (3.14) device (-10u)
+ foo();
+ #pragma omp target nowait (argc>> i)
+ foo();
+ #pragma omp target nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ foo();
+ #pragma omp target nowait (argc > 0 ? argv[1] : argv[2])
+ foo();
+ #pragma omp target nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
foo();
return 0;
diff --git a/clang/test/OpenMP/target_parallel_for_nowait_messages.cpp b/clang/test/OpenMP/target_parallel_for_nowait_messages.cpp
index 2f88c6581d4f2..6059c6433da4f 100644
--- a/clang/test/OpenMP/target_parallel_for_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_parallel_for_nowait_messages.cpp
@@ -6,14 +6,22 @@ void foo() {
}
int main(int argc, char **argv) {
- int i;
- #pragma omp target parallel for nowait( // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
+ int i, z;
+ #pragma omp target parallel for nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
+ #pragma omp target parallel for nowait (3.14) device (-10u)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp target parallel for nowait (argc>> z)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp target parallel for nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp target parallel for nowait (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp target parallel for nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_parallel_for_simd_nowait_messages.cpp b/clang/test/OpenMP/target_parallel_for_simd_nowait_messages.cpp
index 4220bfea3ee3f..ee72b750d5307 100644
--- a/clang/test/OpenMP/target_parallel_for_simd_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_parallel_for_simd_nowait_messages.cpp
@@ -6,14 +6,22 @@ void foo() {
}
int main(int argc, char **argv) {
- int i;
- #pragma omp target parallel for simd nowait( // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
+ int i, z;
+ #pragma omp target parallel for simd nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
+ #pragma omp target parallel for simd nowait (3.14) device (-10u)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp target parallel for simd nowait (argc>> z)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp target parallel for simd nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp target parallel for simd nowait (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp target parallel for simd nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_parallel_nowait_messages.cpp b/clang/test/OpenMP/target_parallel_nowait_messages.cpp
index 3e285fca3aee1..0d7a823dd7a38 100644
--- a/clang/test/OpenMP/target_parallel_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_parallel_nowait_messages.cpp
@@ -6,13 +6,22 @@ void foo() {
}
int main(int argc, char **argv) {
- #pragma omp target parallel nowait( // expected-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}}
- foo();
+ int z;
+ #pragma omp target parallel nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
+ foo();
#pragma omp target parallel nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}}
foo();
#pragma omp target parallel nowait device (-10u)
foo();
- #pragma omp target parallel nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}}
+ #pragma omp target parallel nowait (3.14) device (-10u)
+ foo();
+ #pragma omp target parallel nowait (argc>> z)
+ foo();
+ #pragma omp target parallel nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ foo();
+ #pragma omp target parallel nowait (argc > 0 ? argv[1] : argv[2])
+ foo();
+ #pragma omp target parallel nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
foo();
return 0;
diff --git a/clang/test/OpenMP/target_simd_nowait_messages.cpp b/clang/test/OpenMP/target_simd_nowait_messages.cpp
index 1aee110969489..2c874d9e92e88 100644
--- a/clang/test/OpenMP/target_simd_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_simd_nowait_messages.cpp
@@ -6,14 +6,22 @@ void foo() {
}
int main(int argc, char **argv) {
- int i;
- #pragma omp target simd nowait( // expected-warning {{extra tokens at the end of '#pragma omp target simd' are ignored}}
+ int i, z;
+ #pragma omp target simd nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target simd' are ignored}}
+ #pragma omp target simd nowait (3.14) device (-10u)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp target simd nowait (argc>> z)
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp target simd nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp target simd nowait (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+ #pragma omp target simd nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_teams_distribute_nowait_messages.cpp b/clang/test/OpenMP/target_teams_distribute_nowait_messages.cpp
index 75bab8001bfb7..5bc1ed359ed58 100644
--- a/clang/test/OpenMP/target_teams_distribute_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_teams_distribute_nowait_messages.cpp
@@ -7,13 +7,12 @@ void foo() {
int main(int argc, char **argv) {
int i;
-#pragma omp target teams distribute nowait( // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
- for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
+#pragma omp target teams distribute nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
+#pragma omp target teams distribute nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}} //expected-error {{region cannot be nested inside 'target teams distribute' region}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
+#pragma omp target teams distribute nowait (3.14) device (-10u) // expected-error {{arguments of OpenMP clause 'nowait' with bitwise operators cannot be of floating type}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_nowait_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_nowait_messages.cpp
index f6b6061dd42b7..afb49e7101d1d 100644
--- a/clang/test/OpenMP/target_teams_distribute_parallel_for_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_nowait_messages.cpp
@@ -6,14 +6,22 @@ void foo() {
}
int main(int argc, char **argv) {
- int i;
-#pragma omp target teams distribute parallel for nowait( // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
+ int i, z;
+#pragma omp target teams distribute parallel for nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
+#pragma omp target teams distribute parallel for nowait (3.14) device (-10u)
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute parallel for nowait (argc>> z)
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute parallel for nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute parallel for nowait (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute parallel for nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_nowait_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_nowait_messages.cpp
index 0f13d35c06717..0fb7dc6304d0e 100644
--- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_nowait_messages.cpp
@@ -6,14 +6,22 @@ void foo() {
}
int main(int argc, char **argv) {
- int i;
-#pragma omp target teams distribute parallel for simd nowait( // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
+ int i, z;
+#pragma omp target teams distribute parallel for simd nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
+#pragma omp target teams distribute parallel for simd nowait (3.14) device (-10u)
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute parallel for simd nowait (argc>> z)
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute parallel for simd nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute parallel for simd nowait (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute parallel for simd nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_teams_distribute_simd_nowait_messages.cpp b/clang/test/OpenMP/target_teams_distribute_simd_nowait_messages.cpp
index 1a9d0b5a51625..3108c7ebc621a 100644
--- a/clang/test/OpenMP/target_teams_distribute_simd_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_teams_distribute_simd_nowait_messages.cpp
@@ -6,14 +6,22 @@ void foo() {
}
int main(int argc, char **argv) {
- int i;
-#pragma omp target teams distribute simd nowait( // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
+ int i, z;
+#pragma omp target teams distribute simd nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
+#pragma omp target teams distribute simd nowait (3.14) device (-10u)
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute simd nowait (argc>> z)
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute simd nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute simd nowait (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute simd nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_teams_nowait_messages.cpp b/clang/test/OpenMP/target_teams_nowait_messages.cpp
index bed2f979891e9..1d5d065423ad8 100644
--- a/clang/test/OpenMP/target_teams_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_teams_nowait_messages.cpp
@@ -6,13 +6,20 @@ void foo() {
}
int main(int argc, char **argv) {
-#pragma omp target teams nowait( // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
- foo();
-#pragma omp target teams nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
+ int z;
+#pragma omp target teams nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} //expected-note {{to match this '('}}
foo();
#pragma omp target teams nowait device (-10u)
foo();
-#pragma omp target teams nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
+#pragma omp target teams nowait (3.14) device (-10u)
+ foo();
+#pragma omp target teams nowait (argc>> z)
+ foo();
+#pragma omp target teams nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ foo();
+#pragma omp target teams nowait (argc > 0 ? argv[1] : argv[2])
+ foo();
+#pragma omp target teams nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
foo();
return 0;
diff --git a/clang/test/OpenMP/target_update_nowait_messages.cpp b/clang/test/OpenMP/target_update_nowait_messages.cpp
index fc0314a31874f..a53dab7bb7fd8 100644
--- a/clang/test/OpenMP/target_update_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_update_nowait_messages.cpp
@@ -3,17 +3,21 @@
// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp nowait target update to(i) // expected-error {{expected an OpenMP directive}}
#pragma omp target nowait update to(i) // expected-error {{unexpected OpenMP clause 'update' in directive '#pragma omp target'}} expected-error {{unexpected OpenMP clause 'to' in directive '#pragma omp target'}}
{}
- #pragma omp target update nowait() to(i) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
- #pragma omp target update to(i) nowait( // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
+ #pragma omp target update nowait() to(i) // expected-error {{expected expression}}
+ #pragma omp target update to(i) nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
#pragma omp target update to(i) nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
#pragma omp target update to(i) nowait device (-10u)
- #pragma omp target update to(i) nowait (3.14) device (-10u) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
+ #pragma omp target update to(i) nowait (3.14) device (-10u)
#pragma omp target update to(i) nowait nowait // expected-error {{directive '#pragma omp target update' cannot contain more than one 'nowait' clause}}
#pragma omp target update nowait to(i) nowait // expected-error {{directive '#pragma omp target update' cannot contain more than one 'nowait' clause}}
+ #pragma omp target update to(i) nowait (argc>> z)
+ #pragma omp target update to(i) nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target update to(i) nowait (argc > 0 ? argv[1] : argv[2])
+ #pragma omp target update to(i) nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
return 0;
}
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index c39f337665a40..d18c45e8c4d43 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -2386,7 +2386,9 @@ void OMPClauseEnqueue::VisitOMPDetachClause(const OMPDetachClause *C) {
Visitor->AddStmt(C->getEventHandler());
}
-void OMPClauseEnqueue::VisitOMPNowaitClause(const OMPNowaitClause *) {}
+void OMPClauseEnqueue::VisitOMPNowaitClause(const OMPNowaitClause *C) {
+ Visitor->AddStmt(C->getCondition());
+}
void OMPClauseEnqueue::VisitOMPUntiedClause(const OMPUntiedClause *) {}
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMP.td b/llvm/include/llvm/Frontend/OpenMP/OMP.td
index bba0d6ebdb791..0a963cbfa8339 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMP.td
+++ b/llvm/include/llvm/Frontend/OpenMP/OMP.td
@@ -353,6 +353,7 @@ def OMPC_Novariants : Clause<[Spelling<"novariants">]> {
}
def OMPC_NoWait : Clause<[Spelling<"nowait">]> {
let clangClass = "OMPNowaitClause";
+ let isValueOptional = true;
}
def OMP_NUMTASKS_Strict : EnumVal<"strict", 1, 1> {}
def OMP_NUMTASKS_Unknown : EnumVal<"unknown", 2, 0> { let isDefault = 1; }
@@ -711,6 +712,7 @@ def OMP_Cancel : Directive<[Spelling<"cancel">]> {
let allowedOnceClauses = [
VersionedClause<OMPC_CancellationConstructType>,
VersionedClause<OMPC_If>,
+ VersionedClause<OMPC_NoWait, 60>,
];
let association = AS_None;
let category = CA_Executable;
>From 0326b0d7d3f100fbab3ae062d856ce6d6437138e Mon Sep 17 00:00:00 2001
From: Fazlay Rabbi <fazlay.rabbi at intel.com>
Date: Thu, 18 Sep 2025 12:15:49 -0700
Subject: [PATCH 2/6] Minor LIT test fix
---
clang/test/OpenMP/nowait_ast_print.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/test/OpenMP/nowait_ast_print.cpp b/clang/test/OpenMP/nowait_ast_print.cpp
index 4151a397beb9c..b728029543e1c 100644
--- a/clang/test/OpenMP/nowait_ast_print.cpp
+++ b/clang/test/OpenMP/nowait_ast_print.cpp
@@ -53,4 +53,4 @@ void nowait() {
}
}
-#endif
\ No newline at end of file
+#endif
>From 0baf20da1666f892ec9d73415b199d2c1c6432bd Mon Sep 17 00:00:00 2001
From: Fazlay Rabbi <fazlay.rabbi at intel.com>
Date: Thu, 18 Sep 2025 12:28:55 -0700
Subject: [PATCH 3/6] Updated one more LIT test
---
.../target_teams_distribute_nowait_messages.cpp | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/clang/test/OpenMP/target_teams_distribute_nowait_messages.cpp b/clang/test/OpenMP/target_teams_distribute_nowait_messages.cpp
index 5bc1ed359ed58..7c944186ff30e 100644
--- a/clang/test/OpenMP/target_teams_distribute_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_teams_distribute_nowait_messages.cpp
@@ -6,13 +6,21 @@ void foo() {
}
int main(int argc, char **argv) {
- int i;
+ int i, z;
#pragma omp target teams distribute nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
#pragma omp target teams distribute nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}} //expected-error {{region cannot be nested inside 'target teams distribute' region}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute nowait (3.14) device (-10u) // expected-error {{arguments of OpenMP clause 'nowait' with bitwise operators cannot be of floating type}}
+#pragma omp target teams distribute nowait (3.14) device (-10u)
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute nowait (argc>> z)
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute nowait (argc > 0 ? argv[1] : argv[2])
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
>From 5d45b0892fcefcac23aecee5492c5863031d5551 Mon Sep 17 00:00:00 2001
From: Fazlay Rabbi <fazlay.rabbi at intel.com>
Date: Wed, 24 Sep 2025 13:29:55 -0700
Subject: [PATCH 4/6] Retained original behaviour for OMP < 60 and updated LIT
tests
---
clang/lib/Parse/ParseOpenMP.cpp | 11 ++++---
.../target_enter_data_nowait_messages.cpp | 30 +++++++++++--------
.../target_exit_data_nowait_messages.cpp | 28 +++++++++--------
clang/test/OpenMP/target_nowait_messages.cpp | 22 +++++++++-----
.../target_parallel_for_nowait_messages.cpp | 20 ++++++++-----
...rget_parallel_for_simd_nowait_messages.cpp | 20 ++++++++-----
.../target_parallel_nowait_messages.cpp | 20 ++++++++-----
.../OpenMP/target_simd_nowait_messages.cpp | 22 +++++++++-----
...arget_teams_distribute_nowait_messages.cpp | 25 ++++++++++------
...istribute_parallel_for_nowait_messages.cpp | 22 +++++++++-----
...bute_parallel_for_simd_nowait_messages.cpp | 22 +++++++++-----
..._teams_distribute_simd_nowait_messages.cpp | 22 +++++++++-----
.../OpenMP/target_teams_nowait_messages.cpp | 22 +++++++++-----
.../OpenMP/target_update_nowait_messages.cpp | 30 +++++++++++--------
llvm/include/llvm/Frontend/OpenMP/OMP.td | 1 -
15 files changed, 195 insertions(+), 122 deletions(-)
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 205d6d0778ac0..7edc367719757 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -3164,7 +3164,6 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
case OMPC_simdlen:
case OMPC_collapse:
case OMPC_ordered:
- case OMPC_nowait:
case OMPC_priority:
case OMPC_grainsize:
case OMPC_num_tasks:
@@ -3213,8 +3212,7 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
ErrorFound = true;
}
- if ((CKind == OMPC_ordered || CKind == OMPC_nowait ||
- CKind == OMPC_partial) &&
+ if ((CKind == OMPC_ordered || CKind == OMPC_partial) &&
PP.LookAhead(/*N=*/0).isNot(tok::l_paren))
Clause = ParseOpenMPClause(CKind, WrongDirective);
else if (CKind == OMPC_grainsize || CKind == OMPC_num_tasks ||
@@ -3279,6 +3277,7 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
case OMPC_holds:
Clause = ParseOpenMPSingleExprClause(CKind, WrongDirective);
break;
+ case OMPC_nowait:
case OMPC_untied:
case OMPC_mergeable:
case OMPC_read:
@@ -3312,7 +3311,11 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
ErrorFound = true;
}
- Clause = ParseOpenMPClause(CKind, WrongDirective);
+ if (CKind == OMPC_nowait &&
+ PP.LookAhead(/*N=*/0).is(tok::l_paren) && getLangOpts().OpenMP >= 60)
+ Clause = ParseOpenMPSingleExprClause(CKind, WrongDirective);
+ else
+ Clause = ParseOpenMPClause(CKind, WrongDirective);
break;
case OMPC_self_maps:
// OpenMP [6.0, self_maps clause]
diff --git a/clang/test/OpenMP/target_enter_data_nowait_messages.cpp b/clang/test/OpenMP/target_enter_data_nowait_messages.cpp
index 0b892325a1c69..8c7d23606e606 100644
--- a/clang/test/OpenMP/target_enter_data_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_enter_data_nowait_messages.cpp
@@ -1,6 +1,12 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
int main(int argc, char **argv) {
int i;
@@ -13,27 +19,27 @@ int main(int argc, char **argv) {
{}
#pragma omp target enter nowait data map(to: i) // expected-error {{expected an OpenMP directive}}
{}
- #pragma omp target enter data nowait() map(to: i) // expected-error {{expected expression}}
+ #pragma omp target enter data map(to: i) nowait() // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}} omp-60-and-later-error {{expected expression}}
{}
- #pragma omp target enter data map(to: i) nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
+ #pragma omp target enter data map(to: i) nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
{}
- #pragma omp target enter data map(to: i) nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}}
+ #pragma omp target enter data map(to: i) nowait (argc)) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}} omp-60-and-later-warning {{extra tokens at the end of '#pragma omp target_enter_data' are ignored}}
{}
#pragma omp target enter data map(to: i) nowait device (-10u)
{}
- #pragma omp target enter data map(to: i) nowait (3.14) device (-10u)
+ #pragma omp target enter data map(to: i) nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}}
{}
- #pragma omp target enter data map(to: i) nowait (argc>> i)
+ #pragma omp target enter data map(to: i) nowait (argc>> i) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}}
{}
- #pragma omp target enter data map(to: i) nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target enter data map(to: i) nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
{}
- #pragma omp target enter data map(to: i) nowait (argc > 0 ? argv[1] : argv[2])
+ #pragma omp target enter data map(to: i) nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}}
{}
- #pragma omp target enter data map(to: i) nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
+ #pragma omp target enter data map(to: i) nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target enter data' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
{}
- #pragma omp target enter data map(to: i) nowait nowait // expected-error {{directive '#pragma omp target enter data' cannot contain more than one 'nowait' clause}}
+ #pragma omp target enter data map(to: i) nowait nowait // omp-52-and-earlier-error {{directive '#pragma omp target enter data' cannot contain more than one 'nowait' clause}} omp-60-and-later-error {{directive '#pragma omp target_enter_data' cannot contain more than one 'nowait' clause}}
{}
- #pragma omp target enter data nowait map(to: i) nowait // expected-error {{directive '#pragma omp target enter data' cannot contain more than one 'nowait' clause}}
+ #pragma omp target enter data nowait map(to: i) nowait // omp-52-and-earlier-error {{directive '#pragma omp target enter data' cannot contain more than one 'nowait' clause}} omp-60-and-later-error {{directive '#pragma omp target_enter_data' cannot contain more than one 'nowait' clause}}
{}
return 0;
}
diff --git a/clang/test/OpenMP/target_exit_data_nowait_messages.cpp b/clang/test/OpenMP/target_exit_data_nowait_messages.cpp
index a248704a49e9e..a8e7925cc23e1 100644
--- a/clang/test/OpenMP/target_exit_data_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_exit_data_nowait_messages.cpp
@@ -1,6 +1,10 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
int main(int argc, char **argv) {
int i;
@@ -8,16 +12,16 @@ int main(int argc, char **argv) {
#pragma omp nowait target exit data map(from: i) // expected-error {{expected an OpenMP directive}}
#pragma omp target nowait exit data map(from: i) // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
#pragma omp target exit nowait data map(from: i) // expected-error {{expected an OpenMP directive}}
- #pragma omp target exit data nowait() map(from: i) // expected-error {{expected expression}}
- #pragma omp target exit data map(from: i) nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
- #pragma omp target exit data map(from: i) nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}}
+ #pragma omp target exit data map(from: i) nowait() // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}} omp-60-and-later-error {{expected expression}}
+ #pragma omp target exit data map(from: i) nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
+ #pragma omp target exit data map(from: i) nowait (argc)) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}} omp-60-and-later-warning {{extra tokens at the end of '#pragma omp target_exit_data' are ignored}}
#pragma omp target exit data map(from: i) nowait device (-10u)
- #pragma omp target exit data map(from: i) nowait (3.14) device (-10u)
- #pragma omp target exit data map(from: i) nowait (argc>> i)
- #pragma omp target exit data map(from: i) nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
- #pragma omp target exit data map(from: i) nowait (argc > 0 ? argv[1] : argv[2])
- #pragma omp target exit data map(from: i) nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
- #pragma omp target exit data map(from: i) nowait nowait // expected-error {{directive '#pragma omp target exit data' cannot contain more than one 'nowait' clause}}
- #pragma omp target exit data nowait map(from: i) nowait // expected-error {{directive '#pragma omp target exit data' cannot contain more than one 'nowait' clause}}
+ #pragma omp target exit data map(from: i) nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}}
+ #pragma omp target exit data map(from: i) nowait (argc>> i) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}}
+ #pragma omp target exit data map(from: i) nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
+ #pragma omp target exit data map(from: i) nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}}
+ #pragma omp target exit data map(from: i) nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target exit data' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
+ #pragma omp target exit data map(from: i) nowait nowait // omp-52-and-earlier-error {{directive '#pragma omp target exit data' cannot contain more than one 'nowait' clause}} omp-60-and-later-error {{directive '#pragma omp target_exit_data' cannot contain more than one 'nowait' clause}}
+ #pragma omp target exit data nowait map(from: i) nowait // omp-52-and-earlier-error {{directive '#pragma omp target exit data' cannot contain more than one 'nowait' clause}} omp-60-and-later-error {{directive '#pragma omp target_exit_data' cannot contain more than one 'nowait' clause}}
return 0;
}
diff --git a/clang/test/OpenMP/target_nowait_messages.cpp b/clang/test/OpenMP/target_nowait_messages.cpp
index 6c2d85529eb71..d3690f33f21b0 100644
--- a/clang/test/OpenMP/target_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_nowait_messages.cpp
@@ -1,27 +1,33 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
int main(int argc, char **argv) {
int i;
- #pragma omp target nowait(// expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
+ #pragma omp target nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
foo();
#pragma omp target nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
foo();
#pragma omp target nowait device (-10u)
foo();
- #pragma omp target nowait (3.14) device (-10u)
+ #pragma omp target nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
foo();
- #pragma omp target nowait (argc>> i)
+ #pragma omp target nowait (argc>> i) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
foo();
- #pragma omp target nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
foo();
- #pragma omp target nowait (argc > 0 ? argv[1] : argv[2])
+ #pragma omp target nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target' are ignored}}
foo();
- #pragma omp target nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
+ #pragma omp target nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
foo();
return 0;
diff --git a/clang/test/OpenMP/target_parallel_for_nowait_messages.cpp b/clang/test/OpenMP/target_parallel_for_nowait_messages.cpp
index 6059c6433da4f..6a0cdd733e562 100644
--- a/clang/test/OpenMP/target_parallel_for_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_parallel_for_nowait_messages.cpp
@@ -1,27 +1,31 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
int main(int argc, char **argv) {
int i, z;
- #pragma omp target parallel for nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
+ #pragma omp target parallel for nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for nowait (3.14) device (-10u)
+ #pragma omp target parallel for nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for nowait (argc>> z)
+ #pragma omp target parallel for nowait (argc>> z) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for nowait (argc > 0 ? argv[1] : argv[2])
+ #pragma omp target parallel for nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
+ #pragma omp target parallel for nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel for' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_parallel_for_simd_nowait_messages.cpp b/clang/test/OpenMP/target_parallel_for_simd_nowait_messages.cpp
index ee72b750d5307..4df04a0fef828 100644
--- a/clang/test/OpenMP/target_parallel_for_simd_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_parallel_for_simd_nowait_messages.cpp
@@ -1,27 +1,31 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
int main(int argc, char **argv) {
int i, z;
- #pragma omp target parallel for simd nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
+ #pragma omp target parallel for simd nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target parallel for simd nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd nowait (3.14) device (-10u)
+ #pragma omp target parallel for simd nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd nowait (argc>> z)
+ #pragma omp target parallel for simd nowait (argc>> z) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target parallel for simd nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd nowait (argc > 0 ? argv[1] : argv[2])
+ #pragma omp target parallel for simd nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target parallel for simd nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
+ #pragma omp target parallel for simd nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel for simd' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_parallel_nowait_messages.cpp b/clang/test/OpenMP/target_parallel_nowait_messages.cpp
index 0d7a823dd7a38..f8f43cc048e71 100644
--- a/clang/test/OpenMP/target_parallel_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_parallel_nowait_messages.cpp
@@ -1,27 +1,31 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -verify -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
int main(int argc, char **argv) {
int z;
- #pragma omp target parallel nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
+ #pragma omp target parallel nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
foo();
#pragma omp target parallel nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}}
foo();
#pragma omp target parallel nowait device (-10u)
foo();
- #pragma omp target parallel nowait (3.14) device (-10u)
+ #pragma omp target parallel nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}}
foo();
- #pragma omp target parallel nowait (argc>> z)
+ #pragma omp target parallel nowait (argc>> z) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}}
foo();
- #pragma omp target parallel nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target parallel nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
foo();
- #pragma omp target parallel nowait (argc > 0 ? argv[1] : argv[2])
+ #pragma omp target parallel nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}}
foo();
- #pragma omp target parallel nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
+ #pragma omp target parallel nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target parallel' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
foo();
return 0;
diff --git a/clang/test/OpenMP/target_simd_nowait_messages.cpp b/clang/test/OpenMP/target_simd_nowait_messages.cpp
index 2c874d9e92e88..4920168ef487e 100644
--- a/clang/test/OpenMP/target_simd_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_simd_nowait_messages.cpp
@@ -1,27 +1,33 @@
-// RUN: %clang_cc1 -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
int main(int argc, char **argv) {
int i, z;
- #pragma omp target simd nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
+ #pragma omp target simd nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target simd' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target simd nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd nowait (3.14) device (-10u)
+ #pragma omp target simd nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd nowait (argc>> z)
+ #pragma omp target simd nowait (argc>> z) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+ #pragma omp target simd nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target simd' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd nowait (argc > 0 ? argv[1] : argv[2])
+ #pragma omp target simd nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
- #pragma omp target simd nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
+ #pragma omp target simd nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target simd' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_teams_distribute_nowait_messages.cpp b/clang/test/OpenMP/target_teams_distribute_nowait_messages.cpp
index 7c944186ff30e..6517631d542f0 100644
--- a/clang/test/OpenMP/target_teams_distribute_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_teams_distribute_nowait_messages.cpp
@@ -1,26 +1,33 @@
-// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
int main(int argc, char **argv) {
int i, z;
-#pragma omp target teams distribute nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
-#pragma omp target teams distribute nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}} //expected-error {{region cannot be nested inside 'target teams distribute' region}}
+#pragma omp target teams distribute nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
+ for (i = 0; i < argc; ++i) foo();
+#pragma omp target teams distribute nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute nowait (3.14) device (-10u)
+#pragma omp target teams distribute nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute nowait (argc>> z)
+#pragma omp target teams distribute nowait (argc>> z) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute nowait (argc > 0 ? argv[1] : argv[2])
+#pragma omp target teams distribute nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
+#pragma omp target teams distribute nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_nowait_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_nowait_messages.cpp
index afb49e7101d1d..0e72618ae2b3a 100644
--- a/clang/test/OpenMP/target_teams_distribute_parallel_for_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_nowait_messages.cpp
@@ -1,27 +1,33 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
int main(int argc, char **argv) {
int i, z;
-#pragma omp target teams distribute parallel for nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for nowait (3.14) device (-10u)
+#pragma omp target teams distribute parallel for nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for nowait (argc>> z)
+#pragma omp target teams distribute parallel for nowait (argc>> z) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for nowait (argc > 0 ? argv[1] : argv[2])
+#pragma omp target teams distribute parallel for nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
+#pragma omp target teams distribute parallel for nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_nowait_messages.cpp b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_nowait_messages.cpp
index 0fb7dc6304d0e..f1f6c42fa5d23 100644
--- a/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_teams_distribute_parallel_for_simd_nowait_messages.cpp
@@ -1,27 +1,33 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
int main(int argc, char **argv) {
int i, z;
-#pragma omp target teams distribute parallel for simd nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for simd nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute parallel for simd nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd nowait (3.14) device (-10u)
+#pragma omp target teams distribute parallel for simd nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd nowait (argc>> z)
+#pragma omp target teams distribute parallel for simd nowait (argc>> z) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute parallel for simd nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd nowait (argc > 0 ? argv[1] : argv[2])
+#pragma omp target teams distribute parallel for simd nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute parallel for simd nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
+#pragma omp target teams distribute parallel for simd nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for simd' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_teams_distribute_simd_nowait_messages.cpp b/clang/test/OpenMP/target_teams_distribute_simd_nowait_messages.cpp
index 3108c7ebc621a..7f60427d8d223 100644
--- a/clang/test/OpenMP/target_teams_distribute_simd_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_teams_distribute_simd_nowait_messages.cpp
@@ -1,27 +1,33 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -fsyntax-only -verify -fopenmp-simd %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
int main(int argc, char **argv) {
int i, z;
-#pragma omp target teams distribute simd nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
+#pragma omp target teams distribute simd nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
#pragma omp target teams distribute simd nowait device (-10u)
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd nowait (3.14) device (-10u)
+#pragma omp target teams distribute simd nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd nowait (argc>> z)
+#pragma omp target teams distribute simd nowait (argc>> z) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams distribute simd nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd nowait (argc > 0 ? argv[1] : argv[2])
+#pragma omp target teams distribute simd nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
for (i = 0; i < argc; ++i) foo();
-#pragma omp target teams distribute simd nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
+#pragma omp target teams distribute simd nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
for (i = 0; i < argc; ++i) foo();
return 0;
diff --git a/clang/test/OpenMP/target_teams_nowait_messages.cpp b/clang/test/OpenMP/target_teams_nowait_messages.cpp
index 1d5d065423ad8..1298d3eddd09b 100644
--- a/clang/test/OpenMP/target_teams_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_teams_nowait_messages.cpp
@@ -1,25 +1,31 @@
-// RUN: %clang_cc1 -verify -fopenmp -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
void foo() {
}
int main(int argc, char **argv) {
int z;
-#pragma omp target teams nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} //expected-note {{to match this '('}}
+#pragma omp target teams nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
foo();
#pragma omp target teams nowait device (-10u)
foo();
-#pragma omp target teams nowait (3.14) device (-10u)
+#pragma omp target teams nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
foo();
-#pragma omp target teams nowait (argc>> z)
+#pragma omp target teams nowait (argc>> z) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
foo();
-#pragma omp target teams nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target teams nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
foo();
-#pragma omp target teams nowait (argc > 0 ? argv[1] : argv[2])
+#pragma omp target teams nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}}
foo();
-#pragma omp target teams nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
+#pragma omp target teams nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target teams' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
foo();
return 0;
diff --git a/clang/test/OpenMP/target_update_nowait_messages.cpp b/clang/test/OpenMP/target_update_nowait_messages.cpp
index a53dab7bb7fd8..1eb576421ee26 100644
--- a/clang/test/OpenMP/target_update_nowait_messages.cpp
+++ b/clang/test/OpenMP/target_update_nowait_messages.cpp
@@ -1,6 +1,12 @@
-// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
-// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=45 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=51 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=52 -verify=expected,omp-52-and-earlier -ferror-limit 100 -o - %s -Wuninitialized
+// RUN: %clang_cc1 -triple x86_64-apple-macos10.7.0 -fopenmp-simd -fopenmp-version=60 -verify=expected,omp-60-and-later -ferror-limit 100 -o - %s -Wuninitialized
int main(int argc, char **argv) {
int i, z;
@@ -8,16 +14,16 @@ int main(int argc, char **argv) {
#pragma omp nowait target update to(i) // expected-error {{expected an OpenMP directive}}
#pragma omp target nowait update to(i) // expected-error {{unexpected OpenMP clause 'update' in directive '#pragma omp target'}} expected-error {{unexpected OpenMP clause 'to' in directive '#pragma omp target'}}
{}
- #pragma omp target update nowait() to(i) // expected-error {{expected expression}}
- #pragma omp target update to(i) nowait( // expected-error {{expected expression}} // expected-error {{expected ')'}} // expected-note {{to match this '('}}
- #pragma omp target update to(i) nowait (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
+ #pragma omp target update to(i) nowait() // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} omp-60-and-later-error {{expected expression}}
+ #pragma omp target update to(i) nowait( // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} omp-60-and-later-error {{expected expression}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
+ #pragma omp target update to(i) nowait (argc)) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} omp-60-and-later-warning {{extra tokens at the end of '#pragma omp target_update' are ignored}}
#pragma omp target update to(i) nowait device (-10u)
- #pragma omp target update to(i) nowait (3.14) device (-10u)
- #pragma omp target update to(i) nowait nowait // expected-error {{directive '#pragma omp target update' cannot contain more than one 'nowait' clause}}
- #pragma omp target update nowait to(i) nowait // expected-error {{directive '#pragma omp target update' cannot contain more than one 'nowait' clause}}
- #pragma omp target update to(i) nowait (argc>> z)
- #pragma omp target update to(i) nowait (argv[1] = 2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
- #pragma omp target update to(i) nowait (argc > 0 ? argv[1] : argv[2])
- #pragma omp target update to(i) nowait (S1) // expected-error {{use of undeclared identifier 'S1'}}
+ #pragma omp target update to(i) nowait (3.14) device (-10u) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
+ #pragma omp target update to(i) nowait nowait // omp-52-and-earlier-error {{directive '#pragma omp target update' cannot contain more than one 'nowait' clause}} omp-60-and-later-error {{directive '#pragma omp target_update' cannot contain more than one 'nowait' clause}}
+ #pragma omp target update nowait to(i) nowait // omp-52-and-earlier-error {{directive '#pragma omp target update' cannot contain more than one 'nowait' clause}} omp-60-and-later-error {{directive '#pragma omp target_update' cannot contain more than one 'nowait' clause}}
+ #pragma omp target update to(i) nowait (argc>> z) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
+ #pragma omp target update to(i) nowait (argv[1] = 2) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} omp-60-and-later-error {{expected ')'}} omp-60-and-later-note {{to match this '('}}
+ #pragma omp target update to(i) nowait (argc > 0 ? argv[1] : argv[2]) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target update' are ignored}}
+ #pragma omp target update to(i) nowait (S1) // omp-52-and-earlier-warning {{extra tokens at the end of '#pragma omp target update' are ignored}} omp-60-and-later-error {{use of undeclared identifier 'S1'}}
return 0;
}
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMP.td b/llvm/include/llvm/Frontend/OpenMP/OMP.td
index 0a963cbfa8339..86a9e249054a0 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMP.td
+++ b/llvm/include/llvm/Frontend/OpenMP/OMP.td
@@ -712,7 +712,6 @@ def OMP_Cancel : Directive<[Spelling<"cancel">]> {
let allowedOnceClauses = [
VersionedClause<OMPC_CancellationConstructType>,
VersionedClause<OMPC_If>,
- VersionedClause<OMPC_NoWait, 60>,
];
let association = AS_None;
let category = CA_Executable;
>From 1dbb2f3c3d88806a27917cb5a80be6159d1359a5 Mon Sep 17 00:00:00 2001
From: Fazlay Rabbi <fazlay.rabbi at intel.com>
Date: Wed, 24 Sep 2025 14:59:03 -0700
Subject: [PATCH 5/6] Applied clang-format
---
clang/lib/Parse/ParseOpenMP.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 7edc367719757..25199c739ace9 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -3311,8 +3311,8 @@ OMPClause *Parser::ParseOpenMPClause(OpenMPDirectiveKind DKind,
ErrorFound = true;
}
- if (CKind == OMPC_nowait &&
- PP.LookAhead(/*N=*/0).is(tok::l_paren) && getLangOpts().OpenMP >= 60)
+ if (CKind == OMPC_nowait && PP.LookAhead(/*N=*/0).is(tok::l_paren) &&
+ getLangOpts().OpenMP >= 60)
Clause = ParseOpenMPSingleExprClause(CKind, WrongDirective);
else
Clause = ParseOpenMPClause(CKind, WrongDirective);
>From 333f924306bfa91644016e73bb8d5aa5afb8802f Mon Sep 17 00:00:00 2001
From: Fazlay Rabbi <fazlay.rabbi at intel.com>
Date: Wed, 24 Sep 2025 15:52:17 -0700
Subject: [PATCH 6/6] Updated release note and openmp support doc
---
clang/docs/OpenMPSupport.rst | 2 +-
clang/docs/ReleaseNotes.rst | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/clang/docs/OpenMPSupport.rst b/clang/docs/OpenMPSupport.rst
index cdb3b331a25e7..5c73e2486030e 100644
--- a/clang/docs/OpenMPSupport.rst
+++ b/clang/docs/OpenMPSupport.rst
@@ -505,7 +505,7 @@ implementation.
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| pure directives in DO CONCURRENT | | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
-| Optional argument for all clauses | :none:`unclaimed` | :none:`unclaimed` | |
+| Optional argument for all clauses | :none:`partial` | :none:`In Progress` | Parse/Sema (nowait): https://github.com/llvm/llvm-project/pull/159628 |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
| Function references for locator list items | :none:`unclaimed` | :none:`unclaimed` | |
+-------------------------------------------------------------+---------------------------+---------------------------+--------------------------------------------------------------------------+
diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst
index 5e9a71e1e74d6..4f481bb6a7df3 100644
--- a/clang/docs/ReleaseNotes.rst
+++ b/clang/docs/ReleaseNotes.rst
@@ -620,6 +620,8 @@ OpenMP Support
- Added support for ``defaultmap`` directive implicit-behavior ``private``.
- Added parsing and semantic analysis support for ``groupprivate`` directive.
- Added support for 'omp fuse' directive.
+- Updated parsing and semantic analysis support for ``nowait`` clause to accept
+ optional argument in OpenMP >= 60.
Improvements
^^^^^^^^^^^^
More information about the llvm-commits
mailing list