]> granicus.if.org Git - clang/commitdiff
[OPENMP]Fix PR41768: check DSA for globals with default(none) clauses.
authorAlexey Bataev <a.bataev@hotmail.com>
Thu, 9 May 2019 18:14:57 +0000 (18:14 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Thu, 9 May 2019 18:14:57 +0000 (18:14 +0000)
If the default(none) was specified for the construct, we might miss
diagnostic for the globals without explicitly specified data-sharing
attributes. Patch fixes this problem.

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

41 files changed:
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/Sema/SemaExpr.cpp
lib/Sema/SemaOpenMP.cpp
test/OpenMP/distribute_parallel_for_default_messages.cpp
test/OpenMP/distribute_parallel_for_messages.cpp
test/OpenMP/distribute_parallel_for_simd_default_messages.cpp
test/OpenMP/parallel_default_messages.cpp
test/OpenMP/parallel_for_default_messages.cpp
test/OpenMP/parallel_for_messages.cpp
test/OpenMP/parallel_for_simd_default_messages.cpp
test/OpenMP/parallel_for_simd_messages.cpp
test/OpenMP/parallel_messages.cpp
test/OpenMP/parallel_sections_default_messages.cpp
test/OpenMP/parallel_sections_messages.cpp
test/OpenMP/report_default_DSA.cpp
test/OpenMP/target_parallel_default_messages.cpp
test/OpenMP/target_parallel_for_default_messages.cpp
test/OpenMP/target_parallel_for_messages.cpp
test/OpenMP/target_parallel_for_simd_default_messages.cpp
test/OpenMP/target_parallel_for_simd_messages.cpp
test/OpenMP/target_teams_default_messages.cpp
test/OpenMP/target_teams_distribute_default_messages.cpp
test/OpenMP/target_teams_distribute_messages.cpp
test/OpenMP/target_teams_distribute_parallel_for_default_messages.cpp
test/OpenMP/target_teams_distribute_parallel_for_messages.cpp
test/OpenMP/target_teams_distribute_parallel_for_simd_default_messages.cpp
test/OpenMP/target_teams_distribute_parallel_for_simd_messages.cpp
test/OpenMP/target_teams_messages.cpp
test/OpenMP/task_default_messages.cpp
test/OpenMP/task_firstprivate_messages.cpp
test/OpenMP/task_messages.cpp
test/OpenMP/teams_default_messages.cpp
test/OpenMP/teams_distribute_default_messages.cpp
test/OpenMP/teams_distribute_parallel_for_default_messages.cpp
test/OpenMP/teams_distribute_parallel_for_messages.cpp
test/OpenMP/teams_distribute_parallel_for_simd_default_messages.cpp
test/OpenMP/teams_distribute_parallel_for_simd_messages.cpp
test/OpenMP/teams_distribute_simd_default_messages.cpp
test/OpenMP/teams_distribute_simd_messages.cpp
test/OpenMP/teams_messages.cpp

index 9f011ea42960f1a6e87f6c831f87a8014d5afd41..be4d43faf8fa90ddd6cfd00d237739a8051574f0 100644 (file)
@@ -8821,6 +8821,8 @@ def err_omp_threadprivate_incomplete_type : Error<
   "threadprivate variable with incomplete type %0">;
 def err_omp_no_dsa_for_variable : Error<
   "variable %0 must have explicitly specified data sharing attributes">;
+def note_omp_default_dsa_none : Note<
+  "explicit data sharing attribute requested here">;
 def err_omp_wrong_dsa : Error<
   "%0 variable cannot be %1">;
 def err_omp_variably_modified_type_not_supported : Error<
index 3d2f5b5fbf2141a7900c4423955ce56794c42670..3a8b7adb8b3cd8ed9b1365d4a83fd42547000674 100644 (file)
@@ -8890,7 +8890,8 @@ public:
   /// Check if the specified variable is used in one of the private
   /// clauses (private, firstprivate, lastprivate, reduction etc.) in OpenMP
   /// constructs.
-  VarDecl *isOpenMPCapturedDecl(ValueDecl *D);
+  VarDecl *isOpenMPCapturedDecl(ValueDecl *D, bool CheckScopeInfo = false,
+                                unsigned StopAt = 0);
   ExprResult getOpenMPCapturedExpr(VarDecl *Capture, ExprValueKind VK,
                                    ExprObjectKind OK, SourceLocation Loc);
 
index 31d00dc2ed2ac3c749921c811fc39b12db3f1b74..f0058381a1bf84e2fe2c81dcd0ec58a21d1bd485 100644 (file)
@@ -15474,7 +15474,9 @@ bool Sema::tryCaptureVariable(
   // Capture global variables if it is required to use private copy of this
   // variable.
   bool IsGlobal = !Var->hasLocalStorage();
-  if (IsGlobal && !(LangOpts.OpenMP && isOpenMPCapturedDecl(Var)))
+  if (IsGlobal &&
+      !(LangOpts.OpenMP && isOpenMPCapturedDecl(Var, /*CheckScopeInfo=*/true,
+                                                MaxFunctionScopesIndex)))
     return true;
   Var = Var->getCanonicalDecl();
 
index 0aebd8e03a680e6a4a67d61c92a0a47904552449..49f73a28ac06407bf61db2236424bdb5d4a71e8e 100644 (file)
@@ -1695,7 +1695,8 @@ bool Sema::isInOpenMPTargetExecutionDirective() const {
              false);
 }
 
-VarDecl *Sema::isOpenMPCapturedDecl(ValueDecl *D) {
+VarDecl *Sema::isOpenMPCapturedDecl(ValueDecl *D, bool CheckScopeInfo,
+                                    unsigned StopAt) {
   assert(LangOpts.OpenMP && "OpenMP is not allowed");
   D = getCanonicalDecl(D);
 
@@ -1764,6 +1765,22 @@ VarDecl *Sema::isOpenMPCapturedDecl(ValueDecl *D) {
     }
   }
 
+  if (CheckScopeInfo) {
+    bool OpenMPFound = false;
+    for (unsigned I = StopAt + 1; I > 0; --I) {
+      FunctionScopeInfo *FSI = FunctionScopes[I - 1];
+      if(!isa<CapturingScopeInfo>(FSI))
+        return nullptr;
+      if (auto *RSI = dyn_cast<CapturedRegionScopeInfo>(FSI))
+        if (RSI->CapRegionKind == CR_OpenMP) {
+          OpenMPFound = true;
+          break;
+        }
+    }
+    if (!OpenMPFound)
+      return nullptr;
+  }
+
   if (DSAStack->getCurrentDirective() != OMPD_unknown &&
       (!DSAStack->isClauseParsingMode() ||
        DSAStack->getParentDirective() != OMPD_unknown)) {
@@ -1780,7 +1797,10 @@ VarDecl *Sema::isOpenMPCapturedDecl(ValueDecl *D) {
     DVarPrivate = DSAStack->hasDSA(D, isOpenMPPrivate,
                                    [](OpenMPDirectiveKind) { return true; },
                                    DSAStack->isClauseParsingMode());
-    if (DVarPrivate.CKind != OMPC_unknown)
+    // The variable is not private or it is the variable in the directive with
+    // default(none) clause and not used in any clause.
+    if (DVarPrivate.CKind != OMPC_unknown ||
+        (VD && DSAStack->getDefaultDSA() == DSA_none))
       return VD ? VD : cast<VarDecl>(DVarPrivate.PrivateCopy->getDecl());
   }
   return nullptr;
@@ -4184,6 +4204,7 @@ StmtResult Sema::ActOnOpenMPExecutableDirective(
   for (const auto &P : VarsWithInheritedDSA) {
     Diag(P.second->getExprLoc(), diag::err_omp_no_dsa_for_variable)
         << P.first << P.second->getSourceRange();
+    Diag(DSAStack->getDefaultDSALocation(), diag::note_omp_default_dsa_none);
   }
   ErrorFound = !VarsWithInheritedDSA.empty() || ErrorFound;
 
index cb9cbcf6ba410e07bc294e841017dd2c377dc529..19042ef8a55864cd11e07b8e14e8f1a9381e9215 100644 (file)
@@ -24,7 +24,7 @@ T tmain(T argc) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note 2 {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i) // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 #pragma omp target
@@ -39,7 +39,7 @@ T tmain(T argc) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for default(none)
+#pragma omp distribute parallel for default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i)  // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 
@@ -72,7 +72,7 @@ int main(int argc, char **argv) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp distribute parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 #pragma omp target
@@ -87,7 +87,7 @@ int main(int argc, char **argv) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for default(none)
+#pragma omp distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i)  // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 
index 5ea73a88fc54d90dc0e84ccb60099d66fb2761fb..6bda5d106b7806498de017076f180abad327cb82 100644 (file)
@@ -81,7 +81,7 @@ L1:
   }
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for default(none)
+#pragma omp distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i = 0; i < 10; ++i)
     ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
index 3014d039d296c836cd4db47dba102103f06a9174..80f88a17cec438be95fc29634277c0d5a2c75ba3 100644 (file)
@@ -24,7 +24,7 @@ T tmain(T argc) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp distribute parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note 2 {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i) // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 #pragma omp target
@@ -39,7 +39,7 @@ T tmain(T argc) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for simd default(none)
+#pragma omp distribute parallel for simd default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i)  // expected-error 2 {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 
@@ -72,7 +72,7 @@ int main(int argc, char **argv) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp distribute parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 #pragma omp target
@@ -87,7 +87,7 @@ int main(int argc, char **argv) {
     foo();
 #pragma omp target
 #pragma omp teams
-#pragma omp distribute parallel for simd default(none)
+#pragma omp distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i)  // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 
index eb4b378f0dab59433b3dede349ce9c492d2038b4..440e91b10382e2dd0c0936d47c83d8410f7b02c0 100644 (file)
@@ -18,14 +18,14 @@ int main(int argc, char **argv) {
   #pragma omp parallel default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
   foo();
 
-  #pragma omp parallel default(none)
+  #pragma omp parallel default(none) // expected-note {{explicit data sharing attribute requested here}}
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
-  #pragma omp parallel default(none)
+  #pragma omp parallel default(none) // expected-note {{explicit data sharing attribute requested here}}
   #pragma omp parallel default(shared)
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
-  #pragma omp parallel default(none)
+  #pragma omp parallel default(none) // ge40-note {{explicit data sharing attribute requested here}}
   (void)c; // ge40-error {{variable 'c' must have explicitly specified data sharing attributes}}
   return 0;
 }
index 95f6c9193e9e659c063c3021303088ff24f34223..8baa2f6c04552dbdb490533bfd357ecce7e7bc08 100644 (file)
@@ -15,7 +15,7 @@ int main(int argc, char **argv) {
 #pragma omp parallel for default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
   for (i = 0; i < argc; ++i)
     foo();
-#pragma omp parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 #pragma omp parallel for default(shared), default(shared) // expected-error {{directive '#pragma omp parallel for' cannot contain more than one 'default' clause}}
@@ -25,11 +25,11 @@ int main(int argc, char **argv) {
   for (i = 0; i < argc; ++i)
     foo();
 
-#pragma omp parallel for default(none)
+#pragma omp parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i)  // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 
-#pragma omp parallel default(none)
+#pragma omp parallel default(none) // expected-note {{explicit data sharing attribute requested here}}
 #pragma omp parallel for default(shared)
   for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
index 9ab4bccfc984900d55b3b3494942783c03ea0833..f5aa6e66472fc47d2b1d47d5bf16f827481c84f5 100644 (file)
@@ -58,7 +58,7 @@ L1:
       break;
     }
   }
-#pragma omp parallel for default(none)
+#pragma omp parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i = 0; i < 10; ++i)
     ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
index 6d751449bc3c4e3241ac2f56f7144a854eef4f4b..7b30e4106a88d2a4c0e086aeb9b03cfeeb282b0a 100644 (file)
@@ -15,7 +15,7 @@ int main(int argc, char **argv) {
 #pragma omp parallel for simd default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
   for (i = 0; i < argc; ++i)
     foo();
-#pragma omp parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 #pragma omp parallel for simd default(shared), default(shared) // expected-error {{directive '#pragma omp parallel for simd' cannot contain more than one 'default' clause}}
@@ -25,11 +25,11 @@ int main(int argc, char **argv) {
   for (i = 0; i < argc; ++i)
     foo();
 
-#pragma omp parallel for simd default(none)
+#pragma omp parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i)  // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 
-#pragma omp parallel default(none)
+#pragma omp parallel default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
 #pragma omp parallel for simd default(shared)
   for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} expected-error {{variable 'i' must have explicitly specified data sharing attributes}}
     foo();
index f1d4c5b935be7d9e6475fa7d089c3a80c73df0de..77b9b0851e816bbe1244ece6f297e51c15ff86cf 100644 (file)
@@ -58,7 +58,7 @@ L1:
       break;
     }
   }
-#pragma omp parallel for simd default(none)
+#pragma omp parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i = 0; i < 10; ++i)
     ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
index 8b0c0353c20d6bd607e8a7199421ba569efbafcb..aa932e69e371938050ccc12a533de8548daa3ddb 100644 (file)
@@ -7,6 +7,7 @@ void foo() {
 
 #pragma omp parallel // expected-error {{unexpected OpenMP directive '#pragma omp parallel'}}
 
+int a;
 struct S;
 S& bar();
 int main(int argc, char **argv) {
@@ -54,8 +55,11 @@ int main(int argc, char **argv) {
        break;
     }
   }
-  #pragma omp parallel default(none)
-  ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
+#pragma omp parallel default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
+  {
+    ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
+    ++a;    // expected-error {{variable 'a' must have explicitly specified data sharing attributes}}
+  }
 
   goto L2; // expected-error {{use of undeclared label 'L2'}}
   #pragma omp parallel
@@ -73,3 +77,25 @@ int main(int argc, char **argv) {
   return 0;
 }
 
+struct a {
+  static constexpr int b = 0;
+};
+template <bool> struct c;
+template <typename d, typename e> bool operator<(d, e);
+struct f {
+  int cbegin;
+};
+class g {
+  f blocks;
+  void j();
+};
+template <typename> struct is_error_code_enum : a {};
+struct h {
+  template <typename i, typename = c<is_error_code_enum<i>::b>> h(i);
+};
+h operator<(h, h);
+void g::j() {
+#pragma omp parallel for default(none)
+  for (auto a = blocks.cbegin; a < blocks; ++a) // expected-error {{invalid operands to binary expression ('f' and 'int')}}
+    ;
+}
index b16e5f73695ed754ce3710eb767ac3b32104a02a..3d2e74933f12c651938530998e399cabc86bda03 100644 (file)
@@ -25,12 +25,12 @@ int main(int argc, char **argv) {
     }
   }
 
-#pragma omp parallel sections default(none)
+#pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}}
   {
     ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
   }
 
-#pragma omp parallel sections default(none)
+#pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}}
   {
 #pragma omp parallel sections default(shared)
     {
index 459953acd9a2bd0ad200c02f17d083b0e03a8d5c..81f0c517cde0a196dd3f45cb47fb2aea10414ad2 100644 (file)
@@ -62,7 +62,7 @@ int main(int argc, char **argv) {
       break;
     }
   }
-#pragma omp parallel sections default(none)
+#pragma omp parallel sections default(none) // expected-note {{explicit data sharing attribute requested here}}
   {
     ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
   }
index ba620a4ce8ebf6b93b5404fcd482842798e5dad5..d6f8158b0e82d0e77643483b70a13e399f87467e 100644 (file)
@@ -7,7 +7,7 @@ void foo(int x, int n) {
   for (int iter = 0; iter < x; iter++) {
 #pragma omp target teams distribute parallel for map( \
     from                                              \
-    : vec [0:n]) default(none)
+    : vec [0:n]) default(none) // expected-note 4 {{explicit data sharing attribute requested here}}
     // expected-error@+1 {{variable 'n' must have explicitly specified data sharing attributes}}
     for (int ii = 0; ii < n; ii++) {
       // expected-error@+3 {{variable 'iter' must have explicitly specified data sharing attributes}}
index 9fb3fac69743178655c4582898be5b26ded676af..0aab663b0b9e2d5d600b49a13130402065745566 100644 (file)
@@ -18,14 +18,14 @@ int main(int argc, char **argv) {
   #pragma omp target parallel default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
   foo();
 
-  #pragma omp target parallel default(none)
+  #pragma omp target parallel default(none) // expected-note {{explicit data sharing attribute requested here}}
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
   #pragma omp target parallel default(none)
   foo();
   #pragma omp target parallel default(shared)
   ++argc;
-  #pragma omp target parallel default(none)
+  #pragma omp target parallel default(none) // expected-note {{explicit data sharing attribute requested here}}
   #pragma omp parallel default(shared)
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
   return 0;
index 94049cd37bafcd52306625765bb6bde69bf47102..aba3b300673e4e2554385bfb1fb8af740535f52b 100644 (file)
@@ -15,7 +15,7 @@ int main(int argc, char **argv) {
 #pragma omp target parallel for default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
   for (i = 0; i < argc; ++i)
     foo();
-#pragma omp target parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target parallel for default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 #pragma omp target parallel for default(shared), default(shared) // expected-error {{directive '#pragma omp target parallel for' cannot contain more than one 'default' clause}}
@@ -25,7 +25,7 @@ int main(int argc, char **argv) {
   for (i = 0; i < argc; ++i)
     foo();
 
-#pragma omp target parallel for default(none)
+#pragma omp target parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i)  // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 
index 6bf4ac2807644efdc18af0b964b9c6149574a4b1..c454987e255fda5ba6476d787a40f185e5d7c531 100644 (file)
@@ -61,7 +61,7 @@ L1:
       break;
     }
   }
-#pragma omp target parallel for default(none)
+#pragma omp target parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i = 0; i < 10; ++i)
     ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
index b67bfc52e75b086bc570b0faf9b31838d152ec47..4b634e51168a08c5f5feee854d4fabea5a97dc43 100644 (file)
@@ -15,7 +15,7 @@ int main(int argc, char **argv) {
 #pragma omp target parallel for simd default() // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
   for (i = 0; i < argc; ++i)
     foo();
-#pragma omp target parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}}
+#pragma omp target parallel for simd default(none // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 #pragma omp target parallel for simd default(shared), default(shared) // expected-error {{directive '#pragma omp target parallel for simd' cannot contain more than one 'default' clause}}
@@ -25,7 +25,7 @@ int main(int argc, char **argv) {
   for (i = 0; i < argc; ++i)
     foo();
 
-#pragma omp target parallel for simd default(none)
+#pragma omp target parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (i = 0; i < argc; ++i)  // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     foo();
 
index c0e03289d75036fe75ab9b2268f88f533aba3a4d..76090e855371baa32109a1eca971c2a4cb751117 100644 (file)
@@ -61,7 +61,7 @@ L1:
       break;
     }
   }
-#pragma omp target parallel for simd default(none)
+#pragma omp target parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i = 0; i < 10; ++i)
     ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
index 18520d9e8df8c6ad62326f5bf2be3a2efad4703a..a144fa05f126acc5a73c4292445af83dbcc0c58a 100644 (file)
@@ -18,10 +18,10 @@ int main(int argc, char **argv) {
 #pragma omp target teams default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
   foo();
 
-#pragma omp target teams default(none)
+#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
-#pragma omp target teams default(none)
+#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
 #pragma omp parallel default(shared)
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
   return 0;
index 2a3229dde5ec67f79781a3eeadf001925548ed3b..539a296f2674c0480f3fb503abe3dc053bbae815 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc, char **argv) {
   #pragma omp target teams distribute default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
   for (int i=0; i<200; i++) foo();
 
-  #pragma omp target teams distribute default(none)
+  #pragma omp target teams distribute default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
   return 0;
index d3be0f632be3e15ba0400f8305c7d679a9d9f1c8..7b2080ae2b06cc939d919f28c18ddc5d28cebb3c 100644 (file)
@@ -61,7 +61,7 @@ L1:
       break;
     }
   }
-#pragma omp target teams distribute default(none)
+#pragma omp target teams distribute default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i = 0; i < 10; ++i)
     ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
index d7c3fbaa9c75e8beebbca8bf05198f45296dafaf..d5ea823858ba8ce544178cb7a1c1e26f09048052 100644 (file)
@@ -18,7 +18,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute parallel for default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
   for (int i=0; i<200; i++) foo();
 
-#pragma omp target teams distribute parallel for default(none)
+#pragma omp target teams distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
   return 0;
index 551acd2e8f0ffed6c1d1efd7bcb82967dc51c663..e70c5df3898f980c5e9586c639255617e4d7b8a4 100644 (file)
@@ -61,7 +61,7 @@ L1:
       break;
     }
   }
-#pragma omp target teams distribute parallel for default(none)
+#pragma omp target teams distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i = 0; i < 10; ++i)
     ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
 
index a81aacea4af04584084d4e1d7e905b62d18de0e7..d832d8cf1616c155e31cdb3b0d0dd8508a4777bc 100644 (file)
@@ -23,7 +23,7 @@ int main(int argc, char **argv) {
 #pragma omp target teams distribute parallel for simd default (x) // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
   for (int i=0; i<200; i++) foo();
 
-#pragma omp target teams distribute parallel for simd default(none)
+#pragma omp target teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
   return 0;
index 58e88623473f96bbfd01ef79d2292a7b2ab40187..a98f7d83ecdce1d45aaa498ec0285b54f9d7ab8b 100644 (file)
@@ -62,7 +62,7 @@ L1:
       break;
     }
   }
-#pragma omp target teams distribute parallel for simd default(none)
+#pragma omp target teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i = 0; i < 10; ++i)
     ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
 
index bc068f87b619084968cd4f343c7bee386cb569dc..362767ef1d885ee9cccefd22b26055e59b861fae 100644 (file)
@@ -47,14 +47,14 @@ int main(int argc, char **argv) {
        break;
     }
   }
-#pragma omp target teams default(none)
+#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
-#pragma omp target teams default(none)
+#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
 #pragma omp parallel num_threads(argc) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
   ;
 
-#pragma omp target teams default(none)
+#pragma omp target teams default(none) // expected-note {{explicit data sharing attribute requested here}}
   {
 #pragma omp parallel num_threads(argc) // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
     ;
index 046e388c1469fafabd91fc2d7f6b43919f06f0f5..0eb26856e78af1efb8a69d22fa94224de2b3fa9c 100644 (file)
@@ -13,10 +13,10 @@ int main(int argc, char **argv) {
 #pragma omp task default(x)                       // expected-error {{expected 'none' or 'shared' in OpenMP clause 'default'}}
   foo();
 
-#pragma omp task default(none)
+#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
-#pragma omp task default(none)
+#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
 #pragma omp task default(shared)
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
   return 0;
index b34cda78d1e754fa841029632aa52148eda88ebe..f299c755183da621584afe734c5952f69e1e1433 100644 (file)
@@ -23,7 +23,7 @@ template <typename T>
 struct S {
   T b;
   S(T a, T c) {
-#pragma omp task default(none) firstprivate(a, b)
+#pragma omp task default(none) firstprivate(a, b) // expected-note {{explicit data sharing attribute requested here}}
     a = b = c; // expected-error {{variable 'c' must have explicitly specified data sharing attributes}}
   }
 };
index d490c7f8ea489d7240f2bfaafa94ab659ab7e35a..92bb14983b870609d4282bddd087700b620dcaf9 100644 (file)
@@ -38,10 +38,10 @@ int foo() {
 #pragma omp task
 // expected-note@+1 2 {{predetermined as a firstprivate in a task construct here}}
   ++s1;
-#pragma omp task default(none)
+#pragma omp task default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
 #pragma omp task default(shared)
   ++a; // expected-error 2 {{variable 'a' must have explicitly specified data sharing attributes}}
-#pragma omp task default(none)
+#pragma omp task default(none) // expected-note 2 {{explicit data sharing attribute requested here}}
 #pragma omp task
   // expected-error@+1 {{calling a private constructor of class 'S'}}
   ++a; // expected-error 2 {{variable 'a' must have explicitly specified data sharing attributes}}
@@ -167,7 +167,7 @@ L1:
       break;
     }
   }
-#pragma omp task default(none)
+#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
   goto L2; // expected-error {{use of undeclared label 'L2'}}
@@ -184,10 +184,10 @@ L2:
       for (int n = 0; n < 100; ++n) {
   }
 
-#pragma omp task default(none)
+#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
 #pragma omp task default(shared)
   ++a; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}}
-#pragma omp task default(none)
+#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
 #pragma omp task
   ++a; // expected-error {{variable 'a' must have explicitly specified data sharing attributes}}
 #pragma omp task default(shared)
@@ -201,10 +201,10 @@ L2:
 #pragma omp task
 #pragma omp parallel shared(a, b)
   ++a, ++b;
-#pragma omp task default(none)
+#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
 #pragma omp task default(shared)
   ++sa; // expected-error {{variable 'sa' must have explicitly specified data sharing attributes}}
-#pragma omp task default(none)
+#pragma omp task default(none) // expected-note {{explicit data sharing attribute requested here}}
 #pragma omp task
   // expected-error@+1 {{calling a private constructor of class 'S'}}
   ++sa; // expected-error {{variable 'sa' must have explicitly specified data sharing attributes}}
index c032f5e482cd85bf58aa6d410eb6b40c3ac749da..28a5e2902c6fe9bf1efe847afff491c05739d621 100644 (file)
@@ -25,11 +25,11 @@ int main(int argc, char **argv) {
   foo();
 
   #pragma omp target
-  #pragma omp teams default(none)
+  #pragma omp teams default(none) // expected-note {{explicit data sharing attribute requested here}}
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
   #pragma omp target
-  #pragma omp teams default(none)
+  #pragma omp teams default(none) // expected-note {{explicit data sharing attribute requested here}}
   #pragma omp parallel default(shared)
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
   return 0;
index 5e8702a99d97559416519480b8763f749ce3b6fc..9ebce9aea0500c77a62119943bb6eed0ec6863ee 100644 (file)
@@ -25,7 +25,7 @@ int main(int argc, char **argv) {
   for (int i=0; i<200; i++) foo();
 
   #pragma omp target
-  #pragma omp teams distribute default(none)
+  #pragma omp teams distribute default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
   return 0;
index e5b33315203906ef91341e9edf63937b78a05035..efc139d84ad18c629fcae1cde9becea2802360ed 100644 (file)
@@ -25,7 +25,7 @@ int main(int argc, char **argv) {
   for (int i=0; i<200; i++) foo();
 
   #pragma omp target
-  #pragma omp teams distribute parallel for default(none)
+  #pragma omp teams distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
   return 0;
index 57ad66638028fb0386be048424c341b3ea94cc1d..b86178384201e5caad75ac3470d7a9e4c4bc99cf 100644 (file)
@@ -76,7 +76,7 @@ L1:
     }
   }
 #pragma omp target
-#pragma omp teams distribute parallel for default(none)
+#pragma omp teams distribute parallel for default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i = 0; i < 10; ++i)
     ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
 
index 8db9d668fd34f899ef2332494ce07bfd0e27656f..4de844737a46bd7c904ef31b275e8309a8417b62 100644 (file)
@@ -25,7 +25,7 @@ int main(int argc, char **argv) {
   for (int i=0; i<200; i++) foo();
 
   #pragma omp target
-  #pragma omp teams distribute parallel for simd default(none)
+  #pragma omp teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
   return 0;
index d27e156161f8bb90a1f0fecffda97bda3d1c497c..e95ddfc66900af91229579af1b7835fc1315295b 100644 (file)
@@ -76,7 +76,7 @@ L1:
     }
   }
 #pragma omp target
-#pragma omp teams distribute parallel for simd default(none)
+#pragma omp teams distribute parallel for simd default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i = 0; i < 10; ++i)
     ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
 
index af176f46cbfc549c4b348f45cd8cf0684425c26d..8f6db01efb3aaaa15b242f6499470238c63d60cf 100644 (file)
@@ -25,7 +25,7 @@ int main(int argc, char **argv) {
   for (int i=0; i<200; i++) foo();
 
   #pragma omp target
-  #pragma omp teams distribute simd default(none)
+  #pragma omp teams distribute simd default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i=0; i<200; i++) ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
   return 0;
index 79128706bc94aac2ce13c43ab974d4d5a67acca4..7a99e3f352fcb66d1db35ef4067f150cc0c45153 100644 (file)
@@ -76,7 +76,7 @@ L1:
     }
   }
 #pragma omp target
-#pragma omp teams distribute simd default(none)
+#pragma omp teams distribute simd default(none) // expected-note {{explicit data sharing attribute requested here}}
   for (int i = 0; i < 10; ++i)
     ++argc; // expected-error {{ariable 'argc' must have explicitly specified data sharing attributes}}
 
index 6ed3be9da58d85f6a7235745f2a3b7b5cd445cb7..bba7da2e0e3257fbb108bd8ec05308b8b1104a66 100644 (file)
@@ -63,7 +63,7 @@ int main(int argc, char **argv) {
     }
   }
   #pragma omp target
-  #pragma omp teams default(none)
+  #pragma omp teams default(none) // expected-note {{explicit data sharing attribute requested here}}
   ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}
 
   goto L2; // expected-error {{use of undeclared label 'L2'}}