llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-openmp Author: Shraiysh (shraiysh) <details> <summary>Changes</summary> `if` clause is valid with openmp >= 5.2. It is not supported yet. --- Full diff: https://github.com/llvm/llvm-project/pull/65686.diff 2 Files Affected: - (modified) clang/test/OpenMP/teams_default_messages.cpp (+8-2) - (modified) llvm/include/llvm/Frontend/OpenMP/OMP.td (+1-1) ``````````diff diff --git a/clang/test/OpenMP/teams_default_messages.cpp b/clang/test/OpenMP/teams_default_messages.cpp index 6afc5576d8341..9131a088adb4a 100644 --- a/clang/test/OpenMP/teams_default_messages.cpp +++ b/clang/test/OpenMP/teams_default_messages.cpp @@ -1,6 +1,6 @@ -// RUN: %clang_cc1 -verify -fopenmp -DOMP51 -o - %s -Wuninitialized +// RUN: %clang_cc1 -verify -fopenmp-version=51 -fopenmp -DOMP51 -o - %s -Wuninitialized -// RUN: %clang_cc1 -verify -fopenmp-simd -DOMP51 -o - %s -Wuninitialized +// RUN: %clang_cc1 -verify -fopenmp-version=51 -fopenmp-simd -DOMP51 -o - %s -Wuninitialized // RUN: %clang_cc1 -verify -fopenmp-version=50 -fopenmp -o - %s -Wuninitialized @@ -42,6 +42,9 @@ int main(int argc, char **argv) { #pragma omp parallel default(shared) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} + #pragma omp teams if(x) // expected-error {{unexpected OpenMP clause 'if' in directive '#pragma omp teams'}} + foo(); + #ifdef OMP51 #pragma omp target #pragma omp teams default(firstprivate) // expected-note 2 {{explicit data sharing attribute requested here}} @@ -55,6 +58,9 @@ int main(int argc, char **argv) { ++x; // expected-error {{variable 'x' must have explicitly specified data sharing attributes}} ++y; // expected-error {{variable 'y' must have explicitly specified data sharing attributes}} } +#pragma omp teams if(x) // expected-error {{unexpected OpenMP clause 'if' in directive '#pragma omp teams'}} + foo(); + #endif return 0; } diff --git a/llvm/include/llvm/Frontend/OpenMP/OMP.td b/llvm/include/llvm/Frontend/OpenMP/OMP.td index b6639b67a5c52..1aaddcaf3969d 100644 --- a/llvm/include/llvm/Frontend/OpenMP/OMP.td +++ b/llvm/include/llvm/Frontend/OpenMP/OMP.td @@ -672,7 +672,7 @@ def OMP_Teams : Directive<"teams"> { ]; let allowedOnceClauses = [ VersionedClause<OMPC_Default>, - VersionedClause<OMPC_If>, + VersionedClause<OMPC_If, 52>, VersionedClause<OMPC_NumTeams>, VersionedClause<OMPC_ThreadLimit> ]; `````````` </details> https://github.com/llvm/llvm-project/pull/65686 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits