]> granicus.if.org Git - clang/commitdiff
[OPENMP]Add support for analysis of if clauses.
authorAlexey Bataev <a.bataev@hotmail.com>
Tue, 16 Jul 2019 14:51:46 +0000 (14:51 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Tue, 16 Jul 2019 14:51:46 +0000 (14:51 +0000)
Summary:
Added support for analysis of if clauses in the OpenMP directives to be
able to check for the use of uninitialized variables.

Reviewers: NoQ

Subscribers: guansong, jfb, jdoerfert, caomhin, kkwli0, cfe-commits

Tags: clang

Differential Revision: https://reviews.llvm.org/D64646

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@366211 91177308-0d34-0410-b5e6-96231b3b80d8

28 files changed:
include/clang/AST/OpenMPClause.h
lib/AST/OpenMPClause.cpp
lib/Analysis/CFG.cpp
test/Analysis/cfg-openmp.cpp
test/OpenMP/cancel_if_messages.cpp
test/OpenMP/distribute_parallel_for_if_messages.cpp
test/OpenMP/distribute_parallel_for_simd_if_messages.cpp
test/OpenMP/parallel_for_if_messages.cpp
test/OpenMP/parallel_for_simd_if_messages.cpp
test/OpenMP/parallel_if_messages.cpp
test/OpenMP/parallel_sections_if_messages.cpp
test/OpenMP/target_data_if_messages.cpp
test/OpenMP/target_enter_data_if_messages.cpp
test/OpenMP/target_exit_data_if_messages.cpp
test/OpenMP/target_if_messages.cpp
test/OpenMP/target_parallel_for_if_messages.cpp
test/OpenMP/target_parallel_for_simd_if_messages.cpp
test/OpenMP/target_parallel_if_messages.cpp
test/OpenMP/target_simd_if_messages.cpp
test/OpenMP/target_teams_distribute_if_messages.cpp
test/OpenMP/target_teams_distribute_parallel_for_if_messages.cpp
test/OpenMP/target_teams_distribute_parallel_for_simd_if_messages.cpp
test/OpenMP/target_teams_distribute_simd_if_messages.cpp
test/OpenMP/target_teams_if_messages.cpp
test/OpenMP/target_update_if_messages.cpp
test/OpenMP/task_if_messages.cpp
test/OpenMP/teams_distribute_parallel_for_if_messages.cpp
test/OpenMP/teams_distribute_parallel_for_simd_if_messages.cpp

index c6daf73a623bd0b3c4785dd100e6a23dddd2425c..eadcc62a34575d01ecb54ea4a67ebb762dfa3096 100644 (file)
@@ -501,11 +501,10 @@ public:
     return const_child_range(&Condition, &Condition + 1);
   }
 
-  child_range used_children() {
-    return child_range(child_iterator(), child_iterator());
-  }
+  child_range used_children();
   const_child_range used_children() const {
-    return const_child_range(const_child_iterator(), const_child_iterator());
+    auto Children = const_cast<OMPIfClause *>(this)->used_children();
+    return const_child_range(Children.begin(), Children.end());
   }
 
   static bool classof(const OMPClause *T) {
index 41520b380276c615d97b2b1b93acc3946360910d..9d8a7ebc3023ed708a801ecb5d424920204b0243 100644 (file)
@@ -209,6 +209,25 @@ const OMPClauseWithPostUpdate *OMPClauseWithPostUpdate::get(const OMPClause *C)
   return nullptr;
 }
 
+/// Gets the address of the original, non-captured, expression used in the
+/// clause as the preinitializer.
+static Stmt **getAddrOfExprAsWritten(Stmt *S) {
+  if (!S)
+    return nullptr;
+  if (auto *DS = dyn_cast<DeclStmt>(S)) {
+    assert(DS->isSingleDecl() && "Only single expression must be captured.");
+    if (auto *OED = dyn_cast<OMPCapturedExprDecl>(DS->getSingleDecl()))
+      return OED->getInitAddress();
+  }
+  return nullptr;
+}
+
+OMPClause::child_range OMPIfClause::used_children() {
+  if (Stmt **C = getAddrOfExprAsWritten(getPreInitStmt()))
+    return child_range(C, C + 1);
+  return child_range(&Condition, &Condition + 1);
+}
+
 OMPOrderedClause *OMPOrderedClause::Create(const ASTContext &C, Expr *Num,
                                            unsigned NumLoops,
                                            SourceLocation StartLoc,
index de89105a292577f11145b3d26438a218bb091645..0ed1e988a196ae7793a333b8ce80aab579890349 100644 (file)
@@ -4746,8 +4746,9 @@ CFGBlock *CFGBuilder::VisitOMPExecutableDirective(OMPExecutableDirective *D,
 
   // Reverse the elements to process them in natural order. Iterators are not
   // bidirectional, so we need to create temp vector.
-  for (Stmt *S : llvm::reverse(llvm::to_vector<8>(
-           OMPExecutableDirective::used_clauses_children(D->clauses())))) {
+  SmallVector<Stmt *, 8> Used(
+      OMPExecutableDirective::used_clauses_children(D->clauses()));
+  for (Stmt *S : llvm::reverse(Used)) {
     assert(S && "Expected non-null used-in-clause child.");
     if (CFGBlock *R = Visit(S))
       B = R;
index 2f734d14b0216ee4a693c6b5bb6195e4957608a9..dd417bf408c8f124c4462bd1054d0d7ddb6a3dc6 100644 (file)
-// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG %s 2>&1 -fopenmp | FileCheck %s
+// RUN: %clang_analyze_cc1 -analyzer-checker=debug.DumpCFG %s 2>&1 -fopenmp -fopenmp-version=45 | FileCheck %s
 
 // CHECK-LABEL:  void xxx(int argc)
 void xxx(int argc) {
 // CHECK:        [B1]
 // CHECK-NEXT:   1: int x;
-  int x;
-// CHECK-NEXT:   2: x
-// CHECK-NEXT:   3: [B1.2] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:   4: argc
-// CHECK-NEXT:   5: [B1.4] = [B1.3]
-// CHECK-NEXT:   6: #pragma omp atomic read
-// CHECK-NEXT:    [B1.5];
+// CHECK-NEXT:   2: int cond;
+  int x, cond;
+// CHECK-NEXT:   [[#ATOM:]]: x
+// CHECK-NEXT:   [[#ATOM+1]]: [B1.[[#ATOM]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:   [[#ATOM+2]]: argc
+// CHECK-NEXT:   [[#ATOM+3]]: [B1.[[#ATOM+2]]] = [B1.[[#ATOM+1]]]
+// CHECK-NEXT:   [[#ATOM+4]]: #pragma omp atomic read
+// CHECK-NEXT:   [B1.[[#ATOM+3]]];
 #pragma omp atomic read
   argc = x;
-// CHECK-NEXT:   7: x
-// CHECK-NEXT:   8: [B1.7] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:   9: argc
-// CHECK-NEXT:  10: [B1.9] = [B1.8]
-// CHECK-NEXT:  11: #pragma omp critical
-// CHECK-NEXT:    [B1.10];
+// CHECK-NEXT:   [[#CRIT:]]: x
+// CHECK-NEXT:   [[#CRIT+1]]: [B1.[[#CRIT]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:   [[#CRIT+2]]: argc
+// CHECK-NEXT:   [[#CRIT+3]]: [B1.[[#CRIT+2]]] = [B1.[[#CRIT+1]]]
+// CHECK-NEXT:   [[#CRIT+4]]: #pragma omp critical
+// CHECK-NEXT:   [B1.[[#CRIT+3]]];
 #pragma omp critical
   argc = x;
-// CHECK-NEXT:  12: x
-// CHECK-NEXT:  13: [B1.12] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  14: argc
-// CHECK-NEXT:  15: [B1.14] = [B1.13]
-// CHECK-NEXT:  16: #pragma omp distribute parallel for
+// CHECK-NEXT:  [[#DPF:]]: x
+// CHECK-NEXT:  [[#DPF+1]]: [B1.[[#DPF]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#DPF+2]]: argc
+// CHECK-NEXT:  [[#DPF+3]]: [B1.[[#DPF+2]]] = [B1.[[#DPF+1]]]
+// CHECK-NEXT:  [[#DPF+4]]: cond
+// CHECK-NEXT:  [[#DPF+5]]: [B1.[[#DPF+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#DPF+6]]: [B1.[[#DPF+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#DPF+7]]: #pragma omp distribute parallel for if(parallel: cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.15];
-#pragma omp distribute parallel for
+// CHECK-NEXT:        [B1.[[#DPF+3]]];
+#pragma omp distribute parallel for if(parallel:cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:  17: x
-// CHECK-NEXT:  18: [B1.17] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  19: argc
-// CHECK-NEXT:  20: [B1.19] = [B1.18]
-// CHECK-NEXT:  21: #pragma omp distribute parallel for simd
+// CHECK-NEXT:  [[#DPFS:]]: x
+// CHECK-NEXT:  [[#DPFS+1]]: [B1.[[#DPFS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#DPFS+2]]: argc
+// CHECK-NEXT:  [[#DPFS+3]]: [B1.[[#DPFS+2]]] = [B1.[[#DPFS+1]]]
+// CHECK-NEXT:  [[#DPFS+4]]: cond
+// CHECK-NEXT:  [[#DPFS+5]]: [B1.[[#DPFS+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#DPFS+6]]: [B1.[[#DPFS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#DPFS+7]]: #pragma omp distribute parallel for simd if(cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.20];
-#pragma omp distribute parallel for simd
+// CHECK-NEXT:        [B1.[[#DPFS+3]]];
+#pragma omp distribute parallel for simd if(cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:  22: x
-// CHECK-NEXT:  23: [B1.22] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  24: argc
-// CHECK-NEXT:  25: [B1.24] = [B1.23]
-// CHECK-NEXT:  26: #pragma omp distribute simd
+// CHECK-NEXT:  [[#DS:]]: x
+// CHECK-NEXT:  [[#DS+1]]: [B1.[[#DS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#DS+2]]: argc
+// CHECK-NEXT:  [[#DS+3]]: [B1.[[#DS+2]]] = [B1.[[#DS+1]]]
+// CHECK-NEXT:  [[#DS+4]]: #pragma omp distribute simd
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.25];
+// CHECK-NEXT:        [B1.[[#DS+3]]];
 #pragma omp distribute simd
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:  27: x
-// CHECK-NEXT:  28: [B1.27] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  29: argc
-// CHECK-NEXT:  30: [B1.29] = [B1.28]
-// CHECK-NEXT:  31: #pragma omp for
+// CHECK-NEXT:  [[#FOR:]]: x
+// CHECK-NEXT:  [[#FOR+1]]: [B1.[[#FOR]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#FOR+2]]: argc
+// CHECK-NEXT:  [[#FOR+3]]: [B1.[[#FOR+2]]] = [B1.[[#FOR+1]]]
+// CHECK-NEXT:  [[#FOR+4]]: #pragma omp for
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.30];
+// CHECK-NEXT:        [B1.[[#FOR+3]]];
 #pragma omp for
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:  32: x
-// CHECK-NEXT:  33: [B1.32] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  34: argc
-// CHECK-NEXT:  35: [B1.34] = [B1.33]
-// CHECK-NEXT:  36: #pragma omp for simd
+// CHECK-NEXT:  [[#FS:]]: x
+// CHECK-NEXT:  [[#FS+1]]: [B1.[[#FS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#FS+2]]: argc
+// CHECK-NEXT:  [[#FS+3]]: [B1.[[#FS+2]]] = [B1.[[#FS+1]]]
+// CHECK-NEXT:  [[#FS+4]]: #pragma omp for simd
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.35];
+// CHECK-NEXT:        [B1.[[#FS+3]]];
 #pragma omp for simd
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:  37: x
-// CHECK-NEXT:  38: [B1.37] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  39: argc
-// CHECK-NEXT:  40: [B1.39] = [B1.38]
-// CHECK-NEXT:  41: #pragma omp master
-// CHECK-NEXT:    [B1.40];
+// CHECK-NEXT:  [[#MASTER:]]: x
+// CHECK-NEXT:  [[#MASTER+1]]: [B1.[[#MASTER]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#MASTER+2]]: argc
+// CHECK-NEXT:  [[#MASTER+3]]: [B1.[[#MASTER+2]]] = [B1.[[#MASTER+1]]]
+// CHECK-NEXT:  [[#MASTER+4]]: #pragma omp master
+// CHECK-NEXT:    [B1.[[#MASTER+3]]];
 #pragma omp master
   argc = x;
-// CHECK-NEXT:  42: x
-// CHECK-NEXT:  43: [B1.42] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  44: argc
-// CHECK-NEXT:  45: [B1.44] = [B1.43]
-// CHECK-NEXT:  46: #pragma omp ordered
-// CHECK-NEXT:    [B1.45];
-// CHECK-NEXT:  47: #pragma omp for ordered
+// CHECK-NEXT:  [[#ORD:]]: x
+// CHECK-NEXT:  [[#ORD+1]]: [B1.[[#ORD]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#ORD+2]]: argc
+// CHECK-NEXT:  [[#ORD+3]]: [B1.[[#ORD+2]]] = [B1.[[#ORD+1]]]
+// CHECK-NEXT:  [[#ORD+4]]: #pragma omp ordered
+// CHECK-NEXT:    [B1.[[#ORD+3]]];
+// CHECK-NEXT:  [[#ORD+5]]: #pragma omp for ordered
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i) {
-// CHECK-NEXT:[B1.46]    }
+// CHECK-NEXT:[B1.[[#ORD+4]]]    }
 #pragma omp for ordered
   for (int i = 0; i < 10; ++i) {
 #pragma omp ordered
     argc = x;
   }
-// CHECK-NEXT:  48: x
-// CHECK-NEXT:  49: [B1.48] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  50: argc
-// CHECK-NEXT:  51: [B1.50] = [B1.49]
-// CHECK-NEXT:  52: #pragma omp parallel for
+// CHECK-NEXT:  [[#PF:]]: x
+// CHECK-NEXT:  [[#PF+1]]: [B1.[[#PF]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#PF+2]]: argc
+// CHECK-NEXT:  [[#PF+3]]: [B1.[[#PF+2]]] = [B1.[[#PF+1]]]
+// CHECK-NEXT:  [[#PF+4]]: cond
+// CHECK-NEXT:  [[#PF+5]]: [B1.[[#PF+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#PF+6]]: [B1.[[#PF+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#PF+7]]: #pragma omp parallel for if(cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.51];
-#pragma omp parallel for
+// CHECK-NEXT:        [B1.[[#PF+3]]];
+#pragma omp parallel for if(cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:  53: x
-// CHECK-NEXT:  54: [B1.53] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  55: argc
-// CHECK-NEXT:  56: [B1.55] = [B1.54]
-// CHECK-NEXT:  57: #pragma omp parallel for simd
+// CHECK-NEXT:  [[#PFS:]]: x
+// CHECK-NEXT:  [[#PFS+1]]: [B1.[[#PFS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#PFS+2]]: argc
+// CHECK-NEXT:  [[#PFS+3]]: [B1.[[#PFS+2]]] = [B1.[[#PFS+1]]]
+// CHECK-NEXT:  [[#PFS+4]]: cond
+// CHECK-NEXT:  [[#PFS+5]]: [B1.[[#PFS+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#PFS+6]]: [B1.[[#PFS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#PFS+7]]: #pragma omp parallel for simd if(cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.56];
-#pragma omp parallel for simd
+// CHECK-NEXT:        [B1.[[#PFS+3]]];
+#pragma omp parallel for simd if(cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:  58: x
-// CHECK-NEXT:  59: [B1.58] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  60: argc
-// CHECK-NEXT:  61: [B1.60] = [B1.59]
-// CHECK-NEXT:  62: #pragma omp parallel
-// CHECK-NEXT:    [B1.61];
-#pragma omp parallel
+// CHECK-NEXT:  [[#PAR:]]: x
+// CHECK-NEXT:  [[#PAR+1]]: [B1.[[#PAR]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#PAR+2]]: argc
+// CHECK-NEXT:  [[#PAR+3]]: [B1.[[#PAR+2]]] = [B1.[[#PAR+1]]]
+// CHECK-NEXT:  [[#PAR+4]]: cond
+// CHECK-NEXT:  [[#PAR+5]]: [B1.[[#PAR+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#PAR+6]]: [B1.[[#PAR+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#PAR+7]]: #pragma omp parallel if(cond)
+// CHECK-NEXT:    [B1.[[#PAR+3]]];
+#pragma omp parallel if(cond)
   argc = x;
-// CHECK-NEXT:  63: x
-// CHECK-NEXT:  64: [B1.63] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  65: argc
-// CHECK-NEXT:  66: [B1.65] = [B1.64]
-// CHECK-NEXT:  67: #pragma omp parallel sections
+// CHECK-NEXT:  [[#PSECT:]]: x
+// CHECK-NEXT:  [[#PSECT+1]]: [B1.[[#PSECT]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#PSECT+2]]: argc
+// CHECK-NEXT:  [[#PSECT+3]]: [B1.[[#PSECT+2]]] = [B1.[[#PSECT+1]]]
+// CHECK-NEXT:  [[#PSECT+4]]: cond
+// CHECK-NEXT:  [[#PSECT+5]]: [B1.[[#PSECT+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#PSECT+6]]: [B1.[[#PSECT+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#PSECT+7]]: #pragma omp parallel sections if(cond)
 // CHECK-NEXT:    {
-// CHECK-NEXT:        [B1.66];
+// CHECK-NEXT:        [B1.[[#PSECT+3]]];
 // CHECK-NEXT:    }
-#pragma omp parallel sections
+#pragma omp parallel sections if(cond)
   {
     argc = x;
   }
-// CHECK-NEXT:  68: x
-// CHECK-NEXT:  69: [B1.68] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  70: argc
-// CHECK-NEXT:  71: [B1.70] = [B1.69]
-// CHECK-NEXT:  72: #pragma omp simd
+// CHECK-NEXT:  [[#SIMD:]]: x
+// CHECK-NEXT:  [[#SIMD+1]]: [B1.[[#SIMD]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#SIMD+2]]: argc
+// CHECK-NEXT:  [[#SIMD+3]]: [B1.[[#SIMD+2]]] = [B1.[[#SIMD+1]]]
+// CHECK-NEXT:  [[#SIMD+4]]: #pragma omp simd
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.71];
+// CHECK-NEXT:        [B1.[[#SIMD+3]]];
 #pragma omp simd
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:  73: x
-// CHECK-NEXT:  74: [B1.73] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  75: argc
-// CHECK-NEXT:  76: [B1.75] = [B1.74]
-// CHECK-NEXT:  77: #pragma omp single
-// CHECK-NEXT:    [B1.76];
+// CHECK-NEXT:  [[#SINGLE:]]: x
+// CHECK-NEXT:  [[#SINGLE+1]]: [B1.[[#SINGLE]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#SINGLE+2]]: argc
+// CHECK-NEXT:  [[#SINGLE+3]]: [B1.[[#SINGLE+2]]] = [B1.[[#SINGLE+1]]]
+// CHECK-NEXT:  [[#SINGLE+4]]: #pragma omp single
+// CHECK-NEXT:    [B1.[[#SINGLE+3]]];
 #pragma omp single
   argc = x;
-// CHECK-NEXT:  78: x
-// CHECK-NEXT:  79: [B1.78] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  80: argc
-// CHECK-NEXT:  81: [B1.80] = [B1.79]
-// CHECK-NEXT:  82: #pragma omp target depend(in : argc)
-// CHECK-NEXT:    [B1.81];
+// CHECK-NEXT:  [[#TARGET:]]: x
+// CHECK-NEXT:  [[#TARGET+1]]: [B1.[[#TARGET]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TARGET+2]]: argc
+// CHECK-NEXT:  [[#TARGET+3]]: [B1.[[#TARGET+2]]] = [B1.[[#TARGET+1]]]
+// CHECK-NEXT:  [[#TARGET+4]]: cond
+// CHECK-NEXT:  [[#TARGET+5]]: [B1.[[#TARGET+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TARGET+6]]: [B1.[[#TARGET+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TARGET+7]]: #pragma omp target depend(in : argc) if(cond)
+// CHECK-NEXT:    [B1.[[#TARGET+3]]];
 #pragma omp target depend(in \
-                          : argc)
+                          : argc) if(cond)
   argc = x;
-// CHECK-NEXT:  83: x
-// CHECK-NEXT:  84: [B1.83] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  85: argc
-// CHECK-NEXT:  86: [B1.85] = [B1.84]
-// CHECK-NEXT:  87: #pragma omp target parallel for
+// CHECK-NEXT:  [[#TPF:]]: x
+// CHECK-NEXT:  [[#TPF+1]]: [B1.[[#TPF]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TPF+2]]: argc
+// CHECK-NEXT:  [[#TPF+3]]: [B1.[[#TPF+2]]] = [B1.[[#TPF+1]]]
+// CHECK-NEXT:  [[#TPF+4]]: cond
+// CHECK-NEXT:  [[#TPF+5]]: [B1.[[#TPF+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TPF+6]]: [B1.[[#TPF+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TPF+7]]: #pragma omp target parallel for if(parallel: cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.86];
-#pragma omp target parallel for
+// CHECK-NEXT:        [B1.[[#TPF+3]]];
+#pragma omp target parallel for if(parallel:cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:  88: x
-// CHECK-NEXT:  89: [B1.88] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  90: argc
-// CHECK-NEXT:  91: [B1.90] = [B1.89]
-// CHECK-NEXT:  92: #pragma omp target parallel for simd
+// CHECK-NEXT:  [[#TPFS:]]: x
+// CHECK-NEXT:  [[#TPFS+1]]: [B1.[[#TPFS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TPFS+2]]: argc
+// CHECK-NEXT:  [[#TPFS+3]]: [B1.[[#TPFS+2]]] = [B1.[[#TPFS+1]]]
+// CHECK-NEXT:  [[#TPFS+4]]: cond
+// CHECK-NEXT:  [[#TPFS+5]]: [B1.[[#TPFS+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TPFS+6]]: [B1.[[#TPFS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TPFS+7]]: #pragma omp target parallel for simd if(target: cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.91];
-#pragma omp target parallel for simd
+// CHECK-NEXT:        [B1.[[#TPFS+3]]];
+#pragma omp target parallel for simd if(target:cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:  93: x
-// CHECK-NEXT:  94: [B1.93] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT:  95: argc
-// CHECK-NEXT:  96: [B1.95] = [B1.94]
-// CHECK-NEXT:  97: #pragma omp target parallel
-// CHECK-NEXT:    [B1.96];
-#pragma omp target parallel
+// CHECK-NEXT:  [[#TP:]]: x
+// CHECK-NEXT:  [[#TP+1]]: [B1.[[#TP]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TP+2]]: argc
+// CHECK-NEXT:  [[#TP+3]]: [B1.[[#TP+2]]] = [B1.[[#TP+1]]]
+// CHECK-NEXT:  [[#TP+4]]: cond
+// CHECK-NEXT:  [[#TP+5]]: [B1.[[#TP+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TP+6]]: [B1.[[#TP+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TP+7]]: #pragma omp target parallel if(cond)
+// CHECK-NEXT:    [B1.[[#TP+3]]];
+#pragma omp target parallel if(cond)
   argc = x;
-// CHECK-NEXT:  98: x
-// CHECK-NEXT:  99: [B1.98] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 100: argc
-// CHECK-NEXT: 101: [B1.100] = [B1.99]
-// CHECK-NEXT: 102: #pragma omp target simd
+// CHECK-NEXT:  [[#TSIMD:]]: x
+// CHECK-NEXT:  [[#TSIMD+1]]: [B1.[[#TSIMD]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TSIMD+2]]: argc
+// CHECK-NEXT:  [[#TSIMD+3]]: [B1.[[#TSIMD+2]]] = [B1.[[#TSIMD+1]]]
+// CHECK-NEXT:  [[#TSIMD+4]]: cond
+// CHECK-NEXT:  [[#TSIMD+5]]: [B1.[[#TSIMD+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TSIMD+6]]: [B1.[[#TSIMD+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TSIMD+7]]: #pragma omp target simd if(cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.101];
-#pragma omp target simd
+// CHECK-NEXT:        [B1.[[#TSIMD+3]]];
+#pragma omp target simd if(cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT: 103: x
-// CHECK-NEXT: 104: [B1.103] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 105: argc
-// CHECK-NEXT: 106: [B1.105] = [B1.104]
-// CHECK-NEXT: 107: #pragma omp target teams distribute
+// CHECK-NEXT:  [[#TTD:]]: x
+// CHECK-NEXT:  [[#TTD+1]]: [B1.[[#TTD]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TTD+2]]: argc
+// CHECK-NEXT:  [[#TTD+3]]: [B1.[[#TTD+2]]] = [B1.[[#TTD+1]]]
+// CHECK-NEXT:  [[#TTD+4]]: cond
+// CHECK-NEXT:  [[#TTD+5]]: [B1.[[#TTD+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TTD+6]]: [B1.[[#TTD+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TTD+7]]: #pragma omp target teams distribute if(cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.106];
-#pragma omp target teams distribute
+// CHECK-NEXT:        [B1.[[#TTD+3]]];
+#pragma omp target teams distribute if(cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT: 108: x
-// CHECK-NEXT: 109: [B1.108] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 110: argc
-// CHECK-NEXT: 111: [B1.110] = [B1.109]
-// CHECK-NEXT: 112: #pragma omp target teams distribute parallel for
+// CHECK-NEXT:  [[#TTDPF:]]: x
+// CHECK-NEXT:  [[#TTDPF+1]]: [B1.[[#TTDPF]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TTDPF+2]]: argc
+// CHECK-NEXT:  [[#TTDPF+3]]: [B1.[[#TTDPF+2]]] = [B1.[[#TTDPF+1]]]
+// CHECK-NEXT:  [[#TTDPF+4]]: cond
+// CHECK-NEXT:  [[#TTDPF+5]]: [B1.[[#TTDPF+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TTDPF+6]]: [B1.[[#TTDPF+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TTDPF+7]]: #pragma omp target teams distribute parallel for if(cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.111];
-#pragma omp target teams distribute parallel for
+// CHECK-NEXT:        [B1.[[#TTDPF+3]]];
+#pragma omp target teams distribute parallel for if(cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT: 113: x
-// CHECK-NEXT: 114: [B1.113] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 115: argc
-// CHECK-NEXT: 116: [B1.115] = [B1.114]
-// CHECK-NEXT: 117: #pragma omp target teams distribute parallel for simd
+// CHECK-NEXT:  [[#TTDPFS:]]: x
+// CHECK-NEXT:  [[#TTDPFS+1]]: [B1.[[#TTDPFS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TTDPFS+2]]: argc
+// CHECK-NEXT:  [[#TTDPFS+3]]: [B1.[[#TTDPFS+2]]] = [B1.[[#TTDPFS+1]]]
+// CHECK-NEXT:  [[#TTDPFS+4]]: cond
+// CHECK-NEXT:  [[#TTDPFS+5]]: [B1.[[#TTDPFS+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TTDPFS+6]]: [B1.[[#TTDPFS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TTDPFS+7]]: #pragma omp target teams distribute parallel for simd if(parallel: cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.116];
-#pragma omp target teams distribute parallel for simd
+// CHECK-NEXT:        [B1.[[#TTDPFS+3]]];
+#pragma omp target teams distribute parallel for simd if(parallel:cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT: 118: x
-// CHECK-NEXT: 119: [B1.118] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 120: argc
-// CHECK-NEXT: 121: [B1.120] = [B1.119]
-// CHECK-NEXT: 122: #pragma omp target teams distribute simd
+// CHECK-NEXT:  [[#TTDS:]]: x
+// CHECK-NEXT:  [[#TTDS+1]]: [B1.[[#TTDS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TTDS+2]]: argc
+// CHECK-NEXT:  [[#TTDS+3]]: [B1.[[#TTDS+2]]] = [B1.[[#TTDS+1]]]
+// CHECK-NEXT:  [[#TTDS+4]]: cond
+// CHECK-NEXT:  [[#TTDS+5]]: [B1.[[#TTDS+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TTDS+6]]: [B1.[[#TTDS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TTDS+7]]: #pragma omp target teams distribute simd if(cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.121];
-#pragma omp target teams distribute simd
+// CHECK-NEXT:        [B1.[[#TTDS+3]]];
+#pragma omp target teams distribute simd if(cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT: 123: x
-// CHECK-NEXT: 124: [B1.123] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 125: argc
-// CHECK-NEXT: 126: [B1.125] = [B1.124]
-// CHECK-NEXT: 127: #pragma omp target teams
-// CHECK-NEXT:    [B1.126];
-#pragma omp target teams
+// CHECK-NEXT:  [[#TT:]]: x
+// CHECK-NEXT:  [[#TT+1]]: [B1.[[#TT]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TT+2]]: argc
+// CHECK-NEXT:  [[#TT+3]]: [B1.[[#TT+2]]] = [B1.[[#TT+1]]]
+// CHECK-NEXT:  [[#TT+4]]: cond
+// CHECK-NEXT:  [[#TT+5]]: [B1.[[#TT+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TT+6]]: [B1.[[#TT+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TT+7]]: #pragma omp target teams if(cond)
+// CHECK-NEXT:    [B1.[[#TT+3]]];
+#pragma omp target teams if(cond)
   argc = x;
-// CHECK-NEXT: 128: #pragma omp target update to(x)
-#pragma omp target update to(x)
-// CHECK-NEXT: 129: x
-// CHECK-NEXT: 130: [B1.129] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 131: argc
-// CHECK-NEXT: 132: [B1.131] = [B1.130]
+// CHECK-NEXT: [[#TU:]]: cond
+// CHECK-NEXT: [[#TU+1]]: [B1.[[#TU]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT: [[#TU+2]]: [B1.[[#TU+1]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT: [[#TU+3]]: #pragma omp target update to(x) if(target update: cond)
+#pragma omp target update to(x) if(target update:cond)
+// CHECK-NEXT:  [[#TASK:]]: x
+// CHECK-NEXT:  [[#TASK+1]]: [B1.[[#TASK]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TASK+2]]: argc
+// CHECK-NEXT:  [[#TASK+3]]: [B1.[[#TASK+2]]] = [B1.[[#TASK+1]]]
+// CHECK-NEXT:  [[#TASK+4]]: cond
+// CHECK-NEXT:  [[#TASK+5]]: [B1.[[#TASK+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TASK+6]]: [B1.[[#TASK+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TASK+7]]: #pragma omp task if(cond)
+// CHECK-NEXT:    [B1.[[#TASK+3]]];
+#pragma omp task if(cond)
   argc = x;
-// CHECK-NEXT: 133: x
-// CHECK-NEXT: 134: [B1.133] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 135: argc
-// CHECK-NEXT: 136: [B1.135] = [B1.134]
-// CHECK-NEXT: 137: #pragma omp task
-// CHECK-NEXT:    [B1.136];
-#pragma omp task
-  argc = x;
-// CHECK-NEXT: 138: x
-// CHECK-NEXT: 139: [B1.138] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 140: argc
-// CHECK-NEXT: 141: [B1.140] = [B1.139]
-// CHECK-NEXT: 142: #pragma omp taskgroup
-// CHECK-NEXT:    [B1.141];
+// CHECK-NEXT:  [[#TG:]]: x
+// CHECK-NEXT:  [[#TG+1]]: [B1.[[#TG]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TG+2]]: argc
+// CHECK-NEXT:  [[#TG+3]]: [B1.[[#TG+2]]] = [B1.[[#TG+1]]]
+// CHECK-NEXT:  [[#TG+4]]: #pragma omp taskgroup
+// CHECK-NEXT:    [B1.[[#TG+3]]];
 #pragma omp taskgroup
   argc = x;
-// CHECK-NEXT: 143: x
-// CHECK-NEXT: 144: [B1.143] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 145: argc
-// CHECK-NEXT: 146: [B1.145] = [B1.144]
-// CHECK-NEXT: 147: #pragma omp taskloop
+// CHECK-NEXT:  [[#TL:]]: x
+// CHECK-NEXT:  [[#TL+1]]: [B1.[[#TL]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TL+2]]: argc
+// CHECK-NEXT:  [[#TL+3]]: [B1.[[#TL+2]]] = [B1.[[#TL+1]]]
+// CHECK-NEXT:  [[#TL+4]]: cond
+// CHECK-NEXT:  [[#TL+5]]: [B1.[[#TL+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TL+6]]: [B1.[[#TL+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TL+7]]: #pragma omp taskloop if(cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.146];
-#pragma omp taskloop
+// CHECK-NEXT:        [B1.[[#TL+3]]];
+#pragma omp taskloop if(cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT: 148: x
-// CHECK-NEXT: 149: [B1.148] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 150: argc
-// CHECK-NEXT: 151: [B1.150] = [B1.149]
-// CHECK-NEXT: 152: #pragma omp taskloop simd
+// CHECK-NEXT:  [[#TLS:]]: x
+// CHECK-NEXT:  [[#TLS+1]]: [B1.[[#TLS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TLS+2]]: argc
+// CHECK-NEXT:  [[#TLS+3]]: [B1.[[#TLS+2]]] = [B1.[[#TLS+1]]]
+// CHECK-NEXT:  [[#TLS+4]]: cond
+// CHECK-NEXT:  [[#TLS+5]]: [B1.[[#TLS+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TLS+6]]: [B1.[[#TLS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TLS+7]]: #pragma omp taskloop simd if(cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.151];
-#pragma omp taskloop simd
+// CHECK-NEXT:        [B1.[[#TLS+3]]];
+#pragma omp taskloop simd if(cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT: 153: x
-// CHECK-NEXT: 154: [B1.153] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 155: argc
-// CHECK-NEXT: 156: [B1.155] = [B1.154]
-// CHECK-NEXT: 157: #pragma omp teams distribute parallel for
+// CHECK-NEXT:  [[#TDPF:]]: x
+// CHECK-NEXT:  [[#TDPF+1]]: [B1.[[#TDPF]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TDPF+2]]: argc
+// CHECK-NEXT:  [[#TDPF+3]]: [B1.[[#TDPF+2]]] = [B1.[[#TDPF+1]]]
+// CHECK-NEXT:  [[#TDPF+4]]: cond
+// CHECK-NEXT:  [[#TDPF+5]]: [B1.[[#TDPF+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TDPF+6]]: [B1.[[#TDPF+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TDPF+7]]: #pragma omp teams distribute parallel for if(cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.156];
-// CHECK-NEXT: 158: #pragma omp target
+// CHECK-NEXT:        [B1.[[#TDPF+3]]];
+// CHECK-NEXT:  [[#TDPF+8]]: #pragma omp target
 #pragma omp target
-#pragma omp teams distribute parallel for
+#pragma omp teams distribute parallel for if(cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:[B1.157] 159: x
-// CHECK-NEXT: 160: [B1.159] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 161: argc
-// CHECK-NEXT: 162: [B1.161] = [B1.160]
-// CHECK-NEXT: 163: #pragma omp teams distribute parallel for simd
+// CHECK-NEXT:  [B1.[[#TDPF+7]]] [[#TDPFS:]]: x
+// CHECK-NEXT:  [[#TDPFS+1]]: [B1.[[#TDPFS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TDPFS+2]]: argc
+// CHECK-NEXT:  [[#TDPFS+3]]: [B1.[[#TDPFS+2]]] = [B1.[[#TDPFS+1]]]
+// CHECK-NEXT:  [[#TDPFS+4]]: cond
+// CHECK-NEXT:  [[#TDPFS+5]]: [B1.[[#TDPFS+4]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TDPFS+6]]: [B1.[[#TDPFS+5]]] (ImplicitCastExpr, IntegralToBoolean, _Bool)
+// CHECK-NEXT:  [[#TDPFS+7]]: #pragma omp teams distribute parallel for simd if(cond)
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.162];
-// CHECK-NEXT: 164: #pragma omp target
+// CHECK-NEXT:        [B1.[[#TDPFS+3]]];
+// CHECK-NEXT:  [[#TDPFS+8]]: #pragma omp target
 #pragma omp target
-#pragma omp teams distribute parallel for simd
+#pragma omp teams distribute parallel for simd if(cond)
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:[B1.163] 165: x
-// CHECK-NEXT: 166: [B1.165] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 167: argc
-// CHECK-NEXT: 168: [B1.167] = [B1.166]
-// CHECK-NEXT: 169: #pragma omp teams distribute simd
+// CHECK-NEXT:  [B1.[[#TDPFS+7]]] [[#TDS:]]: x
+// CHECK-NEXT:  [[#TDS+1]]: [B1.[[#TDS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TDS+2]]: argc
+// CHECK-NEXT:  [[#TDS+3]]: [B1.[[#TDS+2]]] = [B1.[[#TDS+1]]]
+// CHECK-NEXT:  [[#TDS+4]]: #pragma omp teams distribute simd
 // CHECK-NEXT:    for (int i = 0; i < 10; ++i)
-// CHECK-NEXT:        [B1.168];
-// CHECK-NEXT: 170: #pragma omp target
+// CHECK-NEXT:        [B1.[[#TDS+3]]];
+// CHECK-NEXT:  [[#TDS+5]]: #pragma omp target
 #pragma omp target
 #pragma omp teams distribute simd
   for (int i = 0; i < 10; ++i)
     argc = x;
-// CHECK-NEXT:[B1.169] 171: x
-// CHECK-NEXT: 172: [B1.171] (ImplicitCastExpr, LValueToRValue, int)
-// CHECK-NEXT: 173: argc
-// CHECK-NEXT: 174: [B1.173] = [B1.172]
-// CHECK-NEXT: 175: #pragma omp teams
-// CHECK-NEXT:    [B1.174];
-// CHECK-NEXT: 176: #pragma omp target
+// CHECK-NEXT:  [B1.[[#TDS+4]]] [[#TEAMS:]]: x
+// CHECK-NEXT:  [[#TEAMS+1]]: [B1.[[#TEAMS]]] (ImplicitCastExpr, LValueToRValue, int)
+// CHECK-NEXT:  [[#TEAMS+2]]: argc
+// CHECK-NEXT:  [[#TEAMS+3]]: [B1.[[#TEAMS+2]]] = [B1.[[#TEAMS+1]]]
+// CHECK-NEXT:  [[#TEAMS+4]]: #pragma omp teams
+// CHECK-NEXT:    [B1.[[#TEAMS+3]]];
+// CHECK-NEXT:  [[#TEAMS+5]]: #pragma omp target
 #pragma omp target
 #pragma omp teams
   argc = x;
-// CHECK-NEXT:[B1.175]   Preds
+// CHECK-NEXT:  [B1.[[#TEAMS+4]]]   Preds
 }
 
index 3d629c927e9072d4b09a2b8da1e0d65728065a00..222087ca9e61b838fdd8ae582e938fadf20a30ee 100644 (file)
@@ -9,6 +9,16 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp parallel
+  {
+#pragma omp cancel parallel if (cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+    for (int i = 0; i < 10; ++i)
+      ;
+  }
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index a06ff2377c043ac1f438ad9803d196c1bcfd79d4..e628a15c3ab44b58b43388c441b532fa308635e0 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp distribute parallel for if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 7769272026e6b37ee901de1560feb229c1f93ad2..6cf18faf0a87fc33dda83aa8efe60f54163a7593 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp distribute parallel for simd if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 32f9ef3a7defab609f494eafac4bb35a2437b12f..56bb06be0cc71422d81545703a690ce9057bd0f5 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp parallel for if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index aa1e302d042420748732e0ee1c9fb24d420b643d..bab9339d4917488fbc4173b302ea2179fd0cff4c 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp parallel for simd if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 7f802a9e4236ab3a23baecea3d39365ee3d21c28..f095e66bbfa5ed5e7e147c35ff303ce387adb58e 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp parallel if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 8d36b6d5d3086d879d285383138d29b8df4e7ffe..b7c92df4f30dff9d7dd6ad35f1f42f959964bc1a 100644 (file)
@@ -9,6 +9,14 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp parallel sections if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  {
+    ;
+  }
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index c6f9b4b34eeeaf1729f4b11eec14cd5704d4bfe8..29f898c6d9fa7e23dd5e962f34558b6fdb4b2b98 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target data map(argc) if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 int main(int argc, char **argv) {
index 5123d607dc6a18ac0291efe97488e2359e049c2c..21019e9ae7f8c4d51b193789bb5bb6fc4b56c2a6 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target enter data map(to:argc) if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 int main(int argc, char **argv) {
index c45b32ff3fe7579966280c61ae5fbc08ab100d07..7b2385c16cd2137a6ee29eca5ff25fc8be304840 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target exit data map(from: argc) if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 int main(int argc, char **argv) {
index e6b667f2cffbf348e66803b1ad35f3232c6157b2..f381e9eb91ebd5c97cd5e999538798b6ca24d99c 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 445dc1775b0f2963c8f2208a1200269886928db4..a5a181b9d273afc1ad815f390bb884f59dbecdb4 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target parallel for if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index b0da8017019f0e1ea9511d517439779094a86d7b..ef9a2089d1087f9c6bc06a8f50cbcefb993ee1c5 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target parallel for simd if(parallel: cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 460e0c8655f096061dd308ac4e527a7415e66b15..ac498a7108b0d123394973dda1f62f034b46cf46 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target parallel if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 94d2ab308daa2363fbf14aa908712a1b0a15125c..5f3e9e3910ac6e9ebcc3068d7349ab38aeaf325e 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target simd if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index fd1ffb08cbe8ccede50d07f891da6f478f7e0ac8..499cd3ac580505435bb050b4d84f0d9232c68f52 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target teams distribute if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index e1114028b687759fa40e3a140d5183f334224496..6df23076472ec5d30be74a171b84827fda10343b 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target teams distribute parallel for if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 59c75893a171466ac101323118ff08e68209849b..e88c1f1dbbfff1488e58a62c586a64254e6261a7 100644 (file)
@@ -9,6 +9,14 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target teams distribute parallel for simd if (parallel \
+                                                          : cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 7134a8394cbb855a74c523a888896b7b40a28964..53af6e759d21e5781b576a58b048e3499dbf41f9 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target teams distribute simd if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 8d3d690d631fae8b21fff97eefb4e157bb326fb7..4bc82a349398d46c2e9e1c23931df0b0564a73a2 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target teams if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 9ded332b04eb983031d8d365ef38f1b05a105276..d967713e456fb69611995cfd1afd1eaae3aab455 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target update to(argc) if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 305af22149d85ef722de80ed2658ee3ded3938d4..2d47b32b9a15370d212a606f1598ad38716234bb 100644 (file)
@@ -9,6 +9,13 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp task if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index 6f724b050178a684f1650d153df995b6be691dcc..b76599d41a46a0652a4da8ed68f765d1f164cd80 100644 (file)
@@ -9,6 +9,14 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target
+#pragma omp teams distribute parallel for if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}
index c01e6e87e39a540c0ae9ef4069e776bd077e7b42..39a0b326383a28153f623519106dbad324202889 100644 (file)
@@ -9,6 +9,14 @@ bool foobool(int argc) {
   return argc;
 }
 
+void xxx(int argc) {
+  int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
+#pragma omp target
+#pragma omp teams distribute parallel for simd if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
+  for (int i = 0; i < 10; ++i)
+    ;
+}
+
 struct S1; // expected-note {{declared here}}
 
 template <class T, class S> // expected-note {{declared here}}