<div dir="ltr">Thanks, that makes sense. <br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 10:45 PM, Bataev, Alexey <span dir="ltr"><<a href="mailto:a.bataev@hotmail.com" target="_blank">a.bataev@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div>Michael, we leaving and additional
space symbol only for directives with clauses (as a separator
between directive and the first clause in list). If there are no
clauses at all, this separator space is not required.<br>
<pre cols="72">Best regards,
Alexey Bataev
=============
Software Engineer
Intel Compiler Team</pre>
<a href="tel:21.07.2014%2017" value="+12107201417" target="_blank">21.07.2014 17</a>:53, Michael Wong пишет:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>Since all these <br>
parallel<br>
simd<br>
for<br>
sections<br>
section<br>
single<br>
master<br>
parallel for<br>
parallel sections<br>
<br>
use nearly the exact same format of changes (including
changing the same file), I went through all of them
together. <br>
<br>
</div>
If there is no delta then I will just refer to this
review.<br>
<br>
</div>
So far this code looks good and all the pattern fits (except
the TRY_TO case that TObias mentioned).<br>
<br>
</div>
One small comment I noticed so far:<br>
</div>
In <br>
<div>StmtPrinter.cpp (some strings are missing an ending space.
I am not sure this is important or even relevant, just for
uniformity:<br>
<br>
</div>
Line 808: missing a space after section in the quoted string.
This is the case for<br>
section<br>
master <br>
e.g.<br>
<br>
void StmtPrinter::VisitOMPSectionDirective(OMPSectionDirective
*Node) {<br>
Indent() << "#pragma omp section";<br>
PrintOMPExecutableDirective(Node);<br>
}<br>
<div><br>
</div>
<div>I will continue to add reviews for the others but mention
this one as lead case.<br>
Thanks.<br>
</div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">
On Tue, Jul 8, 2014 at 4:12 AM, Alexey Bataev <span dir="ltr"><<a href="mailto:a.bataev@hotmail.com" target="_blank">a.bataev@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Author: abataev<br>
Date: Tue Jul 8 03:12:03 2014<br>
New Revision: 212516<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=212516&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=212516&view=rev</a><br>
Log:<br>
[OPENMP] Parsing and sema analysis for 'omp parallel
sections' directive.<br>
<br>
Added:<br>
cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp
(with props)<br>
cfe/trunk/test/OpenMP/parallel_sections_copyin_messages.cpp
(with props)<br>
cfe/trunk/test/OpenMP/parallel_sections_default_messages.cpp
(with props)<br>
cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp
(with props)<br>
cfe/trunk/test/OpenMP/parallel_sections_if_messages.cpp
(with props)<br>
cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp
(with props)<br>
cfe/trunk/test/OpenMP/parallel_sections_messages.cpp
(with props)<br>
cfe/trunk/test/OpenMP/parallel_sections_misc_messages.c
(with props)<br>
cfe/trunk/test/OpenMP/parallel_sections_num_threads_messages.cpp
(with props)<br>
cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp
(with props)<br>
cfe/trunk/test/OpenMP/parallel_sections_proc_bind_messages.cpp
(with props)<br>
cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp
(with props)<br>
cfe/trunk/test/OpenMP/parallel_sections_shared_messages.cpp
(with props)<br>
Modified:<br>
cfe/trunk/include/clang-c/Index.h<br>
cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h<br>
cfe/trunk/include/clang/AST/RecursiveASTVisitor.h<br>
cfe/trunk/include/clang/AST/StmtOpenMP.h<br>
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
cfe/trunk/include/clang/Basic/OpenMPKinds.def<br>
cfe/trunk/include/clang/Basic/StmtNodes.td<br>
cfe/trunk/include/clang/Sema/Sema.h<br>
cfe/trunk/include/clang/Serialization/ASTBitCodes.h<br>
cfe/trunk/lib/AST/Stmt.cpp<br>
cfe/trunk/lib/AST/StmtPrinter.cpp<br>
cfe/trunk/lib/AST/StmtProfile.cpp<br>
cfe/trunk/lib/Basic/OpenMPKinds.cpp<br>
cfe/trunk/lib/CodeGen/CGStmt.cpp<br>
cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp<br>
cfe/trunk/lib/CodeGen/CodeGenFunction.h<br>
cfe/trunk/lib/Parse/ParseOpenMP.cpp<br>
cfe/trunk/lib/Sema/SemaOpenMP.cpp<br>
cfe/trunk/lib/Sema/TreeTransform.h<br>
cfe/trunk/lib/Serialization/ASTReaderStmt.cpp<br>
cfe/trunk/lib/Serialization/ASTWriterStmt.cpp<br>
cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp<br>
cfe/trunk/test/OpenMP/nesting_of_regions.cpp<br>
cfe/trunk/tools/libclang/CIndex.cpp<br>
cfe/trunk/tools/libclang/CXCursor.cpp<br>
<br>
Modified: cfe/trunk/include/clang-c/Index.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang-c/Index.h?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang-c/Index.h (original)<br>
+++ cfe/trunk/include/clang-c/Index.h Tue Jul 8 03:12:03
2014<br>
@@ -2159,9 +2159,13 @@ enum CXCursorKind {<br>
*/<br>
CXCursor_OMPParallelForDirective = 238,<br>
<br>
+ /** \brief OpenMP parallel sections directive.<br>
+ */<br>
+ CXCursor_OMPParallelSectionsDirective = 239,<br>
+<br>
/** \brief Windows Structured Exception Handling's leave
statement.<br>
*/<br>
- CXCursor_SEHLeaveStmt = 239,<br>
+ CXCursor_SEHLeaveStmt = 240,<br>
<br>
CXCursor_LastStmt =
CXCursor_SEHLeaveStmt,<br>
<br>
<br>
Modified:
cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h
(original)<br>
+++ cfe/trunk/include/clang/AST/DataRecursiveASTVisitor.h
Tue Jul 8 03:12:03 2014<br>
@@ -2316,6 +2316,11 @@
DEF_TRAVERSE_STMT(OMPParallelForDirectiv<br>
return false;<br>
})<br>
<br>
+DEF_TRAVERSE_STMT(OMPParallelSectionsDirective, {<br>
+ if (!TraverseOMPExecutableDirective(S))<br>
+ return false;<br>
+})<br>
+<br>
// OpenMP clauses.<br>
template <typename Derived><br>
bool
RecursiveASTVisitor<Derived>::TraverseOMPClause(OMPClause
*C) {<br>
<br>
Modified: cfe/trunk/include/clang/AST/RecursiveASTVisitor.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RecursiveASTVisitor.h?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/RecursiveASTVisitor.h
(original)<br>
+++ cfe/trunk/include/clang/AST/RecursiveASTVisitor.h Tue
Jul 8 03:12:03 2014<br>
@@ -2338,6 +2338,11 @@
DEF_TRAVERSE_STMT(OMPParallelForDirectiv<br>
return false;<br>
})<br>
<br>
+DEF_TRAVERSE_STMT(OMPParallelSectionsDirective, {<br>
+ if (!TraverseOMPExecutableDirective(S))<br>
+ return false;<br>
+})<br>
+<br>
// OpenMP clauses.<br>
template <typename Derived><br>
bool
RecursiveASTVisitor<Derived>::TraverseOMPClause(OMPClause
*C) {<br>
<br>
Modified: cfe/trunk/include/clang/AST/StmtOpenMP.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtOpenMP.h?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/StmtOpenMP.h?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/AST/StmtOpenMP.h (original)<br>
+++ cfe/trunk/include/clang/AST/StmtOpenMP.h Tue Jul 8
03:12:03 2014<br>
@@ -599,6 +599,65 @@ public:<br>
}<br>
};<br>
<br>
+/// \brief This represents '#pragma omp parallel sections'
directive.<br>
+///<br>
+/// \code<br>
+/// #pragma omp parallel sections private(a,b)
reduction(+:c,d)<br>
+/// \endcode<br>
+/// In this example directive '#pragma omp parallel
sections' has clauses<br>
+/// 'private' with the variables 'a' and 'b' and
'reduction' with operator '+'<br>
+/// and variables 'c' and 'd'.<br>
+///<br>
+class OMPParallelSectionsDirective : public
OMPExecutableDirective {<br>
+ friend class ASTStmtReader;<br>
+ /// \brief Build directive with the given start and end
location.<br>
+ ///<br>
+ /// \param StartLoc Starting location of the directive
kind.<br>
+ /// \param EndLoc Ending location of the directive.<br>
+ /// \param NumClauses Number of clauses.<br>
+ ///<br>
+ OMPParallelSectionsDirective(SourceLocation StartLoc,
SourceLocation EndLoc,<br>
+ unsigned NumClauses)<br>
+ : OMPExecutableDirective(this,
OMPParallelSectionsDirectiveClass,<br>
+ OMPD_parallel_sections,
StartLoc, EndLoc,<br>
+ NumClauses, 1) {}<br>
+<br>
+ /// \brief Build an empty directive.<br>
+ ///<br>
+ /// \param NumClauses Number of clauses.<br>
+ ///<br>
+ explicit OMPParallelSectionsDirective(unsigned
NumClauses)<br>
+ : OMPExecutableDirective(this,
OMPParallelSectionsDirectiveClass,<br>
+ OMPD_parallel_sections,
SourceLocation(),<br>
+ SourceLocation(),
NumClauses, 1) {}<br>
+<br>
+public:<br>
+ /// \brief Creates directive with a list of \a Clauses.<br>
+ ///<br>
+ /// \param C AST context.<br>
+ /// \param StartLoc Starting location of the directive
kind.<br>
+ /// \param EndLoc Ending Location of the directive.<br>
+ /// \param Clauses List of clauses.<br>
+ /// \param AssociatedStmt Statement, associated with the
directive.<br>
+ ///<br>
+ static OMPParallelSectionsDirective *<br>
+ Create(const ASTContext &C, SourceLocation StartLoc,
SourceLocation EndLoc,<br>
+ ArrayRef<OMPClause *> Clauses, Stmt
*AssociatedStmt);<br>
+<br>
+ /// \brief Creates an empty directive with the place for
\a NumClauses<br>
+ /// clauses.<br>
+ ///<br>
+ /// \param C AST context.<br>
+ /// \param NumClauses Number of clauses.<br>
+ ///<br>
+ static OMPParallelSectionsDirective *<br>
+ CreateEmpty(const ASTContext &C, unsigned NumClauses,
EmptyShell);<br>
+<br>
+ static bool classof(const Stmt *T) {<br>
+ return T->getStmtClass() ==
OMPParallelSectionsDirectiveClass;<br>
+ }<br>
+};<br>
+<br>
} // end namespace clang<br>
<br>
#endif<br>
<br>
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
(original)<br>
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue
Jul 8 03:12:03 2014<br>
@@ -7124,11 +7124,15 @@ def err_omp_prohibited_region_simd :
Err<br>
"OpenMP constructs may not be nested inside a simd
region">;<br>
def err_omp_sections_not_compound_stmt : Error<<br>
"the statement for '#pragma omp sections' must be a
compound statement">;<br>
+def err_omp_parallel_sections_not_compound_stmt : Error<<br>
+ "the statement for '#pragma omp parallel sections' must
be a compound statement">;<br>
def err_omp_orphaned_section_directive : Error<<br>
"%select{orphaned 'omp section' directives are
prohibited, it|'omp section' directive}0"<br>
" must be closely nested to a sections region%select{|,
not a %1 region}0">;<br>
def err_omp_sections_substmt_not_section : Error<<br>
"statement in 'omp sections' directive must be enclosed
into a section region">;<br>
+def err_omp_parallel_sections_substmt_not_section :
Error<<br>
+ "statement in 'omp parallel sections' directive must be
enclosed into a section region">;<br>
} // end of OpenMP category<br>
<br>
let CategoryName = "Related Result Type Issue" in {<br>
<br>
Modified: cfe/trunk/include/clang/Basic/OpenMPKinds.def<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/OpenMPKinds.def?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/OpenMPKinds.def?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Basic/OpenMPKinds.def (original)<br>
+++ cfe/trunk/include/clang/Basic/OpenMPKinds.def Tue Jul 8
03:12:03 2014<br>
@@ -39,6 +39,9 @@<br>
#ifndef OPENMP_PARALLEL_FOR_CLAUSE<br>
# define OPENMP_PARALLEL_FOR_CLAUSE(Name)<br>
#endif<br>
+#ifndef OPENMP_PARALLEL_SECTIONS_CLAUSE<br>
+# define OPENMP_PARALLEL_SECTIONS_CLAUSE(Name)<br>
+#endif<br>
#ifndef OPENMP_DEFAULT_KIND<br>
# define OPENMP_DEFAULT_KIND(Name)<br>
#endif<br>
@@ -59,6 +62,7 @@ OPENMP_DIRECTIVE(sections)<br>
OPENMP_DIRECTIVE(section)<br>
OPENMP_DIRECTIVE(single)<br>
OPENMP_DIRECTIVE_EXT(parallel_for, "parallel for")<br>
+OPENMP_DIRECTIVE_EXT(parallel_sections, "parallel
sections")<br>
<br>
// OpenMP clauses.<br>
OPENMP_CLAUSE(if, OMPIfClause)<br>
@@ -153,6 +157,18 @@ OPENMP_PARALLEL_FOR_CLAUSE(collapse)<br>
OPENMP_PARALLEL_FOR_CLAUSE(schedule)<br>
OPENMP_PARALLEL_FOR_CLAUSE(ordered)<br>
<br>
+// Clauses allowed for OpenMP directive 'parallel
sections'.<br>
+OPENMP_PARALLEL_SECTIONS_CLAUSE(if)<br>
+OPENMP_PARALLEL_SECTIONS_CLAUSE(num_threads)<br>
+OPENMP_PARALLEL_SECTIONS_CLAUSE(default)<br>
+OPENMP_PARALLEL_SECTIONS_CLAUSE(proc_bind)<br>
+OPENMP_PARALLEL_SECTIONS_CLAUSE(private)<br>
+OPENMP_PARALLEL_SECTIONS_CLAUSE(firstprivate)<br>
+OPENMP_PARALLEL_SECTIONS_CLAUSE(shared)<br>
+OPENMP_PARALLEL_SECTIONS_CLAUSE(reduction)<br>
+OPENMP_PARALLEL_SECTIONS_CLAUSE(copyin)<br>
+OPENMP_PARALLEL_SECTIONS_CLAUSE(lastprivate)<br>
+<br>
#undef OPENMP_SCHEDULE_KIND<br>
#undef OPENMP_PROC_BIND_KIND<br>
#undef OPENMP_DEFAULT_KIND<br>
@@ -163,6 +179,7 @@ OPENMP_PARALLEL_FOR_CLAUSE(ordered)<br>
#undef OPENMP_SECTIONS_CLAUSE<br>
#undef OPENMP_PARALLEL_CLAUSE<br>
#undef OPENMP_PARALLEL_FOR_CLAUSE<br>
+#undef OPENMP_PARALLEL_SECTIONS_CLAUSE<br>
#undef OPENMP_SIMD_CLAUSE<br>
#undef OPENMP_FOR_CLAUSE<br>
<br>
<br>
Modified: cfe/trunk/include/clang/Basic/StmtNodes.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/StmtNodes.td?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/StmtNodes.td?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Basic/StmtNodes.td (original)<br>
+++ cfe/trunk/include/clang/Basic/StmtNodes.td Tue Jul 8
03:12:03 2014<br>
@@ -185,3 +185,4 @@ def OMPSectionsDirective :
DStmt<OMPExec<br>
def OMPSectionDirective :
DStmt<OMPExecutableDirective>;<br>
def OMPSingleDirective :
DStmt<OMPExecutableDirective>;<br>
def OMPParallelForDirective :
DStmt<OMPExecutableDirective>;<br>
+def OMPParallelSectionsDirective :
DStmt<OMPExecutableDirective>;<br>
<br>
Modified: cfe/trunk/include/clang/Sema/Sema.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Sema/Sema.h (original)<br>
+++ cfe/trunk/include/clang/Sema/Sema.h Tue Jul 8 03:12:03
2014<br>
@@ -7342,6 +7342,12 @@ public:<br>
ArrayRef<OMPClause *> Clauses, Stmt *AStmt,
SourceLocation StartLoc,<br>
SourceLocation EndLoc,<br>
llvm::DenseMap<VarDecl *, Expr *>
&VarsWithImplicitDSA);<br>
+ /// \brief Called on well-formed '\#pragma omp parallel
sections' after<br>
+ /// parsing of the associated statement.<br>
+ StmtResult
ActOnOpenMPParallelSectionsDirective(ArrayRef<OMPClause
*> Clauses,<br>
+ Stmt
*AStmt,<br>
+
SourceLocation StartLoc,<br>
+
SourceLocation EndLoc);<br>
<br>
OMPClause *ActOnOpenMPSingleExprClause(OpenMPClauseKind
Kind,<br>
Expr *Expr,<br>
<br>
Modified:
cfe/trunk/include/clang/Serialization/ASTBitCodes.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Serialization/ASTBitCodes.h?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/Serialization/ASTBitCodes.h
(original)<br>
+++ cfe/trunk/include/clang/Serialization/ASTBitCodes.h Tue
Jul 8 03:12:03 2014<br>
@@ -1347,6 +1347,7 @@ namespace clang {<br>
STMT_OMP_SECTION_DIRECTIVE,<br>
STMT_OMP_SINGLE_DIRECTIVE,<br>
STMT_OMP_PARALLEL_FOR_DIRECTIVE,<br>
+ STMT_OMP_PARALLEL_SECTIONS_DIRECTIVE,<br>
<br>
// ARC<br>
EXPR_OBJC_BRIDGED_CAST, // ObjCBridgedCastExpr<br>
<br>
Modified: cfe/trunk/lib/AST/Stmt.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Stmt.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/Stmt.cpp (original)<br>
+++ cfe/trunk/lib/AST/Stmt.cpp Tue Jul 8 03:12:03 2014<br>
@@ -1504,3 +1504,27 @@
OMPParallelForDirective::CreateEmpty(con<br>
return new (Mem) OMPParallelForDirective(CollapsedNum,
NumClauses);<br>
}<br>
<br>
+OMPParallelSectionsDirective
*OMPParallelSectionsDirective::Create(<br>
+ const ASTContext &C, SourceLocation StartLoc,
SourceLocation EndLoc,<br>
+ ArrayRef<OMPClause *> Clauses, Stmt
*AssociatedStmt) {<br>
+ unsigned Size =
llvm::RoundUpToAlignment(sizeof(OMPParallelSectionsDirective),<br>
+
llvm::alignOf<OMPClause *>());<br>
+ void *Mem =<br>
+ C.Allocate(Size + sizeof(OMPClause *) *
Clauses.size() + sizeof(Stmt *));<br>
+ OMPParallelSectionsDirective *Dir =<br>
+ new (Mem) OMPParallelSectionsDirective(StartLoc,
EndLoc, Clauses.size());<br>
+ Dir->setClauses(Clauses);<br>
+ Dir->setAssociatedStmt(AssociatedStmt);<br>
+ return Dir;<br>
+}<br>
+<br>
+OMPParallelSectionsDirective *<br>
+OMPParallelSectionsDirective::CreateEmpty(const ASTContext
&C,<br>
+ unsigned
NumClauses, EmptyShell) {<br>
+ unsigned Size =
llvm::RoundUpToAlignment(sizeof(OMPParallelSectionsDirective),<br>
+
llvm::alignOf<OMPClause *>());<br>
+ void *Mem =<br>
+ C.Allocate(Size + sizeof(OMPClause *) * NumClauses +
sizeof(Stmt *));<br>
+ return new (Mem)
OMPParallelSectionsDirective(NumClauses);<br>
+}<br>
+<br>
<br>
Modified: cfe/trunk/lib/AST/StmtPrinter.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtPrinter.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/StmtPrinter.cpp (original)<br>
+++ cfe/trunk/lib/AST/StmtPrinter.cpp Tue Jul 8 03:12:03
2014<br>
@@ -820,6 +820,12 @@ void
StmtPrinter::VisitOMPParallelForDir<br>
PrintOMPExecutableDirective(Node);<br>
}<br>
<br>
+void StmtPrinter::VisitOMPParallelSectionsDirective(<br>
+ OMPParallelSectionsDirective *Node) {<br>
+ Indent() << "#pragma omp parallel sections ";<br>
+ PrintOMPExecutableDirective(Node);<br>
+}<br>
+<br>
//===----------------------------------------------------------------------===//<br>
// Expr printing methods.<br>
//===----------------------------------------------------------------------===//<br>
<br>
Modified: cfe/trunk/lib/AST/StmtProfile.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/AST/StmtProfile.cpp (original)<br>
+++ cfe/trunk/lib/AST/StmtProfile.cpp Tue Jul 8 03:12:03
2014<br>
@@ -385,6 +385,11 @@
StmtProfiler::VisitOMPParallelForDirecti<br>
VisitOMPExecutableDirective(S);<br>
}<br>
<br>
+void StmtProfiler::VisitOMPParallelSectionsDirective(<br>
+ const OMPParallelSectionsDirective *S) {<br>
+ VisitOMPExecutableDirective(S);<br>
+}<br>
+<br>
void StmtProfiler::VisitExpr(const Expr *S) {<br>
VisitStmt(S);<br>
}<br>
<br>
Modified: cfe/trunk/lib/Basic/OpenMPKinds.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/OpenMPKinds.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/OpenMPKinds.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Basic/OpenMPKinds.cpp (original)<br>
+++ cfe/trunk/lib/Basic/OpenMPKinds.cpp Tue Jul 8 03:12:03
2014<br>
@@ -227,6 +227,16 @@ bool
clang::isAllowedClauseForDirective(<br>
break;<br>
}<br>
break;<br>
+ case OMPD_parallel_sections:<br>
+ switch (CKind) {<br>
+#define OPENMP_PARALLEL_SECTIONS_CLAUSE(Name)
\<br>
+ case OMPC_##Name:
\<br>
+ return true;<br>
+#include "clang/Basic/OpenMPKinds.def"<br>
+ default:<br>
+ break;<br>
+ }<br>
+ break;<br>
case OMPD_unknown:<br>
case OMPD_threadprivate:<br>
case OMPD_task:<br>
@@ -243,13 +253,13 @@ bool
clang::isOpenMPLoopDirective(OpenMP<br>
<br>
bool
clang::isOpenMPWorksharingDirective(OpenMPDirectiveKind
DKind) {<br>
return DKind == OMPD_for || DKind == OMPD_sections ||
DKind == OMPD_section ||<br>
- DKind == OMPD_single ||<br>
- DKind == OMPD_parallel_for; // TODO add next
directives.<br>
+ DKind == OMPD_single || DKind == OMPD_parallel_for
||<br>
+ DKind == OMPD_parallel_sections; // TODO add next
directives.<br>
}<br>
<br>
bool clang::isOpenMPParallelDirective(OpenMPDirectiveKind
DKind) {<br>
- return DKind == OMPD_parallel ||<br>
- DKind == OMPD_parallel_for; // TODO add next
directives.<br>
+ return DKind == OMPD_parallel || DKind ==
OMPD_parallel_for ||<br>
+ DKind == OMPD_parallel_sections; // TODO add next
directives.<br>
}<br>
<br>
bool clang::isOpenMPSimdDirective(OpenMPDirectiveKind
DKind) {<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Tue Jul 8 03:12:03
2014<br>
@@ -197,6 +197,9 @@ void CodeGenFunction::EmitStmt(const Stm<br>
case Stmt::OMPParallelForDirectiveClass:<br>
EmitOMPParallelForDirective(cast<OMPParallelForDirective>(*S));<br>
break;<br>
+ case Stmt::OMPParallelSectionsDirectiveClass:<br>
+
EmitOMPParallelSectionsDirective(cast<OMPParallelSectionsDirective>(*S));<br>
+ break;<br>
}<br>
}<br>
<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp (original)<br>
+++ cfe/trunk/lib/CodeGen/CGStmtOpenMP.cpp Tue Jul 8
03:12:03 2014<br>
@@ -95,3 +95,8 @@ CodeGenFunction::EmitOMPParallelForDirec<br>
llvm_unreachable("CodeGen for 'omp parallel for' is not
supported yet.");<br>
}<br>
<br>
+void CodeGenFunction::EmitOMPParallelSectionsDirective(<br>
+ const OMPParallelSectionsDirective &) {<br>
+ llvm_unreachable("CodeGen for 'omp parallel sections' is
not supported yet.");<br>
+}<br>
+<br>
<br>
Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)<br>
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Tue Jul 8
03:12:03 2014<br>
@@ -1904,6 +1904,7 @@ public:<br>
void EmitOMPSectionDirective(const OMPSectionDirective
&S);<br>
void EmitOMPSingleDirective(const OMPSingleDirective
&S);<br>
void EmitOMPParallelForDirective(const
OMPParallelForDirective &S);<br>
+ void EmitOMPParallelSectionsDirective(const
OMPParallelSectionsDirective &S);<br>
<br>
//===--------------------------------------------------------------------===//<br>
// LValue Expression Emission<br>
<br>
Modified: cfe/trunk/lib/Parse/ParseOpenMP.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseOpenMP.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseOpenMP.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Parse/ParseOpenMP.cpp (original)<br>
+++ cfe/trunk/lib/Parse/ParseOpenMP.cpp Tue Jul 8 03:12:03
2014<br>
@@ -40,6 +40,9 @@ static OpenMPDirectiveKind ParseOpenMPDi<br>
if (SDKind == OMPD_for) {<br>
P.ConsumeToken();<br>
DKind = OMPD_parallel_for;<br>
+ } else if (SDKind == OMPD_sections) {<br>
+ P.ConsumeToken();<br>
+ DKind = OMPD_parallel_sections;<br>
}<br>
}<br>
return DKind;<br>
@@ -85,6 +88,7 @@ Parser::DeclGroupPtrTy Parser::ParseOpen<br>
case OMPD_section:<br>
case OMPD_single:<br>
case OMPD_parallel_for:<br>
+ case OMPD_parallel_sections:<br>
Diag(Tok, diag::err_omp_unexpected_directive)<br>
<< getOpenMPDirectiveName(DKind);<br>
break;<br>
@@ -101,7 +105,8 @@ Parser::DeclGroupPtrTy Parser::ParseOpen<br>
///<br>
/// executable-directive:<br>
/// annot_pragma_openmp 'parallel' | 'simd' | 'for'
| 'sections' |<br>
-/// 'section' | 'single' | 'parallel for' {clause}
annot_pragma_openmp_end<br>
+/// 'section' | 'single' | 'parallel for' |
'parallel sections' {clause}<br>
+/// annot_pragma_openmp_end<br>
///<br>
StmtResult
Parser::ParseOpenMPDeclarativeOrExecutableDirective() {<br>
assert(Tok.is(tok::annot_pragma_openmp) && "Not
an OpenMP directive!");<br>
@@ -141,7 +146,8 @@ StmtResult Parser::ParseOpenMPDeclarativ<br>
case OMPD_sections:<br>
case OMPD_single:<br>
case OMPD_section:<br>
- case OMPD_parallel_for: {<br>
+ case OMPD_parallel_for:<br>
+ case OMPD_parallel_sections: {<br>
ConsumeToken();<br>
<br>
if (isOpenMPLoopDirective(DKind))<br>
<br>
Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)<br>
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Tue Jul 8 03:12:03
2014<br>
@@ -976,6 +976,14 @@ void
Sema::ActOnOpenMPRegionStart(OpenMP<br>
Params);<br>
break;<br>
}<br>
+ case OMPD_parallel_sections: {<br>
+ Sema::CapturedParamNameType Params[] = {<br>
+ std::make_pair(StringRef(), QualType()) //
__context with shared vars<br>
+ };<br>
+
ActOnCapturedRegionStart(DSAStack->getConstructLoc(),
CurScope, CR_OpenMP,<br>
+ Params);<br>
+ break;<br>
+ }<br>
case OMPD_threadprivate:<br>
case OMPD_task:<br>
llvm_unreachable("OpenMP Directive is not allowed");<br>
@@ -998,6 +1006,7 @@ bool CheckNestingOfRegions(Sema
&SemaRef<br>
// | parallel | section | +
|<br>
// | parallel | single | *
|<br>
// | parallel | parallel for | *
|<br>
+ // | parallel |parallel sections| *
|<br>
//
+------------------+-----------------+------------------------------------+<br>
// | for | parallel | *
|<br>
// | for | for | +
|<br>
@@ -1006,6 +1015,7 @@ bool CheckNestingOfRegions(Sema
&SemaRef<br>
// | for | section | +
|<br>
// | for | single | +
|<br>
// | for | parallel for | *
|<br>
+ // | for |parallel sections| *
|<br>
//
+------------------+-----------------+------------------------------------+<br>
// | simd | parallel |
|<br>
// | simd | for |
|<br>
@@ -1014,6 +1024,7 @@ bool CheckNestingOfRegions(Sema
&SemaRef<br>
// | simd | section |
|<br>
// | simd | single |
|<br>
// | simd | parallel for |
|<br>
+ // | simd |parallel sections|
|<br>
//
+------------------+-----------------+------------------------------------+<br>
// | sections | parallel | *
|<br>
// | sections | for | +
|<br>
@@ -1022,6 +1033,7 @@ bool CheckNestingOfRegions(Sema
&SemaRef<br>
// | sections | section | *
|<br>
// | sections | single | +
|<br>
// | sections | parallel for | *
|<br>
+ // | sections |parallel sections| *
|<br>
//
+------------------+-----------------+------------------------------------+<br>
// | section | parallel | *
|<br>
// | section | for | +
|<br>
@@ -1030,6 +1042,7 @@ bool CheckNestingOfRegions(Sema
&SemaRef<br>
// | section | section | +
|<br>
// | section | single | +
|<br>
// | section | parallel for | *
|<br>
+ // | section |parallel sections| *
|<br>
//
+------------------+-----------------+------------------------------------+<br>
// | single | parallel | *
|<br>
// | single | for | +
|<br>
@@ -1038,6 +1051,7 @@ bool CheckNestingOfRegions(Sema
&SemaRef<br>
// | single | section | +
|<br>
// | single | single | +
|<br>
// | single | parallel for | *
|<br>
+ // | single |parallel sections| *
|<br>
//
+------------------+-----------------+------------------------------------+<br>
// | parallel for | parallel | *
|<br>
// | parallel for | for | +
|<br>
@@ -1046,6 +1060,16 @@ bool CheckNestingOfRegions(Sema
&SemaRef<br>
// | parallel for | section | +
|<br>
// | parallel for | single | +
|<br>
// | parallel for | parallel for | *
|<br>
+ // | parallel for |parallel sections| *
|<br>
+ //
+------------------+-----------------+------------------------------------+<br>
+ // | parallel sections| parallel | *
|<br>
+ // | parallel sections| for | +
|<br>
+ // | parallel sections| simd | *
|<br>
+ // | parallel sections| sections | +
|<br>
+ // | parallel sections| section | *
|<br>
+ // | parallel sections| single | +
|<br>
+ // | parallel sections| parallel for | *
|<br>
+ // | parallel sections|parallel sections| *
|<br>
//
+------------------+-----------------+------------------------------------+<br>
if (Stack->getCurScope()) {<br>
auto ParentRegion = Stack->getParentDirective();<br>
@@ -1063,7 +1087,8 @@ bool CheckNestingOfRegions(Sema
&SemaRef<br>
// Orphaned section directives are prohibited. That
is, the section<br>
// directives must appear within the sections
construct and must not be<br>
// encountered elsewhere in the sections region.<br>
- if (ParentRegion != OMPD_sections) {<br>
+ if (ParentRegion != OMPD_sections &&<br>
+ ParentRegion != OMPD_parallel_sections) {<br>
SemaRef.Diag(StartLoc,
diag::err_omp_orphaned_section_directive)<br>
<< (ParentRegion != OMPD_unknown)<br>
<< getOpenMPDirectiveName(ParentRegion);<br>
@@ -1155,6 +1180,10 @@ StmtResult
Sema::ActOnOpenMPExecutableDi<br>
Res =
ActOnOpenMPParallelForDirective(ClausesWithImplicit, AStmt,
StartLoc,<br>
EndLoc,
VarsWithInheritedDSA);<br>
break;<br>
+ case OMPD_parallel_sections:<br>
+ Res =
ActOnOpenMPParallelSectionsDirective(ClausesWithImplicit,
AStmt,<br>
+ StartLoc,
EndLoc);<br>
+ break;<br>
case OMPD_threadprivate:<br>
case OMPD_task:<br>
llvm_unreachable("OpenMP Directive is not allowed");<br>
@@ -1834,6 +1863,41 @@ StmtResult
Sema::ActOnOpenMPParallelForD<br>
NestedLoopCount,
Clauses, AStmt);<br>
}<br>
<br>
+StmtResult<br>
+Sema::ActOnOpenMPParallelSectionsDirective(ArrayRef<OMPClause
*> Clauses,<br>
+ Stmt *AStmt,
SourceLocation StartLoc,<br>
+ SourceLocation
EndLoc) {<br>
+ assert(AStmt && isa<CapturedStmt>(AStmt)
&& "Captured statement expected");<br>
+ auto BaseStmt = AStmt;<br>
+ while (CapturedStmt *CS =
dyn_cast_or_null<CapturedStmt>(BaseStmt))<br>
+ BaseStmt = CS->getCapturedStmt();<br>
+ if (auto C =
dyn_cast_or_null<CompoundStmt>(BaseStmt)) {<br>
+ auto S = C->children();<br>
+ if (!S)<br>
+ return StmtError();<br>
+ // All associated statements must be '#pragma omp
section' except for<br>
+ // the first one.<br>
+ for (++S; S; ++S) {<br>
+ auto SectionStmt = *S;<br>
+ if (!SectionStmt ||
!isa<OMPSectionDirective>(SectionStmt)) {<br>
+ if (SectionStmt)<br>
+ Diag(SectionStmt->getLocStart(),<br>
+
diag::err_omp_parallel_sections_substmt_not_section);<br>
+ return StmtError();<br>
+ }<br>
+ }<br>
+ } else {<br>
+ Diag(AStmt->getLocStart(),<br>
+
diag::err_omp_parallel_sections_not_compound_stmt);<br>
+ return StmtError();<br>
+ }<br>
+<br>
+ getCurFunction()->setHasBranchProtectedScope();<br>
+<br>
+ return OMPParallelSectionsDirective::Create(Context,
StartLoc, EndLoc,<br>
+ Clauses,
AStmt);<br>
+}<br>
+<br>
OMPClause
*Sema::ActOnOpenMPSingleExprClause(OpenMPClauseKind Kind,
Expr *Expr,<br>
SourceLocation
StartLoc,<br>
SourceLocation
LParenLoc,<br>
<br>
Modified: cfe/trunk/lib/Sema/TreeTransform.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/TreeTransform.h?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Sema/TreeTransform.h (original)<br>
+++ cfe/trunk/lib/Sema/TreeTransform.h Tue Jul 8 03:12:03
2014<br>
@@ -6494,6 +6494,17 @@ StmtResult
TreeTransform<Derived>::Trans<br>
return Res;<br>
}<br>
<br>
+template <typename Derived><br>
+StmtResult
TreeTransform<Derived>::TransformOMPParallelSectionsDirective(<br>
+ OMPParallelSectionsDirective *D) {<br>
+ DeclarationNameInfo DirName;<br>
+
getDerived().getSema().StartOpenMPDSABlock(OMPD_parallel_sections,
DirName,<br>
+ nullptr,
D->getLocStart());<br>
+ StmtResult Res =
getDerived().TransformOMPExecutableDirective(D);<br>
+ getDerived().getSema().EndOpenMPDSABlock(Res.get());<br>
+ return Res;<br>
+}<br>
+<br>
//===----------------------------------------------------------------------===//<br>
// OpenMP clause transformation<br>
//===----------------------------------------------------------------------===//<br>
<br>
Modified: cfe/trunk/lib/Serialization/ASTReaderStmt.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTReaderStmt.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTReaderStmt.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTReaderStmt.cpp Tue Jul 8
03:12:03 2014<br>
@@ -1950,6 +1950,14 @@ void
ASTStmtReader::VisitOMPParallelForD<br>
VisitOMPExecutableDirective(D);<br>
}<br>
<br>
+void ASTStmtReader::VisitOMPParallelSectionsDirective(<br>
+ OMPParallelSectionsDirective *D) {<br>
+ VisitStmt(D);<br>
+ // The NumClauses field was read in ReadStmtFromStream.<br>
+ ++Idx;<br>
+ VisitOMPExecutableDirective(D);<br>
+}<br>
+<br>
//===----------------------------------------------------------------------===//<br>
// ASTReader Implementation<br>
//===----------------------------------------------------------------------===//<br>
@@ -2470,6 +2478,11 @@ Stmt
*ASTReader::ReadStmtFromStream(Modu<br>
break;<br>
}<br>
<br>
+ case STMT_OMP_PARALLEL_SECTIONS_DIRECTIVE:<br>
+ S = OMPParallelSectionsDirective::CreateEmpty(<br>
+ Context, Record[ASTStmtReader::NumStmtFields],
Empty);<br>
+ break;<br>
+<br>
case EXPR_CXX_OPERATOR_CALL:<br>
S = new (Context) CXXOperatorCallExpr(Context,
Empty);<br>
break;<br>
<br>
Modified: cfe/trunk/lib/Serialization/ASTWriterStmt.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Serialization/ASTWriterStmt.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/Serialization/ASTWriterStmt.cpp (original)<br>
+++ cfe/trunk/lib/Serialization/ASTWriterStmt.cpp Tue Jul 8
03:12:03 2014<br>
@@ -1859,6 +1859,14 @@ void
ASTStmtWriter::VisitOMPParallelForD<br>
Code = serialization::STMT_OMP_PARALLEL_FOR_DIRECTIVE;<br>
}<br>
<br>
+void ASTStmtWriter::VisitOMPParallelSectionsDirective(<br>
+ OMPParallelSectionsDirective *D) {<br>
+ VisitStmt(D);<br>
+ Record.push_back(D->getNumClauses());<br>
+ VisitOMPExecutableDirective(D);<br>
+ Code =
serialization::STMT_OMP_PARALLEL_SECTIONS_DIRECTIVE;<br>
+}<br>
+<br>
//===----------------------------------------------------------------------===//<br>
// ASTWriter Implementation<br>
//===----------------------------------------------------------------------===//<br>
<br>
Modified: cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp
(original)<br>
+++ cfe/trunk/lib/StaticAnalyzer/Core/ExprEngine.cpp Tue Jul
8 03:12:03 2014<br>
@@ -738,6 +738,7 @@ void ExprEngine::Visit(const Stmt *S, Ex<br>
case Stmt::OMPSectionDirectiveClass:<br>
case Stmt::OMPSingleDirectiveClass:<br>
case Stmt::OMPParallelForDirectiveClass:<br>
+ case Stmt::OMPParallelSectionsDirectiveClass:<br>
llvm_unreachable("Stmt should not be in analyzer
evaluation loop");<br>
<br>
case Stmt::ObjCSubscriptRefExprClass:<br>
<br>
Modified: cfe/trunk/test/OpenMP/nesting_of_regions.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/nesting_of_regions.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/nesting_of_regions.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/test/OpenMP/nesting_of_regions.cpp (original)<br>
+++ cfe/trunk/test/OpenMP/nesting_of_regions.cpp Tue Jul 8
03:12:03 2014<br>
@@ -30,6 +30,11 @@ void foo() {<br>
#pragma omp parallel for<br>
for (int i = 0; i < 10; ++i)<br>
;<br>
+#pragma omp parallel<br>
+#pragma omp parallel sections<br>
+ {<br>
+ bar();<br>
+ }<br>
<br>
// SIMD DIRECTIVE<br>
#pragma omp simd<br>
@@ -77,6 +82,13 @@ void foo() {<br>
for (int i = 0; i < 10; ++i)<br>
;<br>
}<br>
+#pragma omp simd<br>
+ for (int i = 0; i < 10; ++i) {<br>
+#pragma omp parallel sections // expected-error {{OpenMP
constructs may not be nested inside a simd region}}<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
<br>
// FOR DIRECTIVE<br>
#pragma omp for<br>
@@ -141,6 +153,13 @@ void foo() {<br>
for (int i = 0; i < 10; ++i)<br>
;<br>
}<br>
+#pragma omp for<br>
+ for (int i = 0; i < 10; ++i) {<br>
+#pragma omp parallel sections<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
<br>
// SECTIONS DIRECTIVE<br>
#pragma omp sections<br>
@@ -206,6 +225,13 @@ void foo() {<br>
for (int i = 0; i < 10; ++i)<br>
;<br>
}<br>
+#pragma omp sections<br>
+ {<br>
+#pragma omp parallel sections<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
<br>
// SECTION DIRECTIVE<br>
#pragma omp section // expected-error {{orphaned 'omp
section' directives are prohibited, it must be closely
nested to a sections region}}<br>
@@ -269,6 +295,13 @@ void foo() {<br>
for (int i = 0; i < 10; ++i)<br>
;<br>
}<br>
+#pragma omp single<br>
+ {<br>
+#pragma omp parallel sections<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
<br>
// PARALLEL FOR DIRECTIVE<br>
#pragma omp parallel for<br>
@@ -333,6 +366,85 @@ void foo() {<br>
for (int i = 0; i < 10; ++i)<br>
;<br>
}<br>
+#pragma omp parallel for<br>
+ for (int i = 0; i < 10; ++i) {<br>
+#pragma omp parallel sections<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
+<br>
+// PARALLEL SECTIONS DIRECTIVE<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp for // expected-error {{region cannot be
closely nested inside 'parallel sections' region; perhaps
you forget to enclose 'omp for' directive into a parallel
region?}}<br>
+ for (int i = 0; i < 10; ++i)<br>
+ ;<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp simd<br>
+ for (int i = 0; i < 10; ++i)<br>
+ ;<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp parallel<br>
+ for (int i = 0; i < 10; ++i)<br>
+ ;<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp sections // expected-error {{region cannot be
closely nested inside 'parallel sections' region; perhaps
you forget to enclose 'omp sections' directive into a
parallel region?}}<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp section<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp section<br>
+ {<br>
+#pragma omp single // expected-error {{region cannot be
closely nested inside 'section' region; perhaps you forget
to enclose 'omp single' directive into a parallel region?}}<br>
+ bar();<br>
+ }<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp parallel<br>
+ {<br>
+#pragma omp single // OK<br>
+ {<br>
+ bar();<br>
+ }<br>
+#pragma omp for // OK<br>
+ for (int i = 0; i < 10; ++i)<br>
+ ;<br>
+#pragma omp sections // OK<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp parallel for<br>
+ for (int i = 0; i < 10; ++i)<br>
+ ;<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp parallel sections<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
}<br>
<br>
void foo() {<br>
@@ -367,6 +479,11 @@ void foo() {<br>
#pragma omp parallel for<br>
for (int i = 0; i < 10; ++i)<br>
;<br>
+#pragma omp parallel<br>
+#pragma omp parallel sections<br>
+ {<br>
+ bar();<br>
+ }<br>
<br>
// SIMD DIRECTIVE<br>
#pragma omp simd<br>
@@ -412,6 +529,13 @@ void foo() {<br>
for (int i = 0; i < 10; ++i)<br>
;<br>
}<br>
+#pragma omp simd<br>
+ for (int i = 0; i < 10; ++i) {<br>
+#pragma omp parallel sections // expected-error {{OpenMP
constructs may not be nested inside a simd region}}<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
<br>
// FOR DIRECTIVE<br>
#pragma omp for<br>
@@ -474,6 +598,13 @@ void foo() {<br>
for (int i = 0; i < 10; ++i)<br>
;<br>
}<br>
+#pragma omp for<br>
+ for (int i = 0; i < 10; ++i) {<br>
+#pragma omp parallel sections<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
<br>
// SECTIONS DIRECTIVE<br>
#pragma omp sections<br>
@@ -536,6 +667,13 @@ void foo() {<br>
for (int i = 0; i < 10; ++i)<br>
;<br>
}<br>
+#pragma omp sections<br>
+ {<br>
+#pragma omp parallel sections<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
<br>
// SECTION DIRECTIVE<br>
#pragma omp section // expected-error {{orphaned 'omp
section' directives are prohibited, it must be closely
nested to a sections region}}<br>
@@ -599,6 +737,13 @@ void foo() {<br>
for (int i = 0; i < 10; ++i)<br>
;<br>
}<br>
+#pragma omp single<br>
+ {<br>
+#pragma omp parallel sections<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
<br>
// PARALLEL FOR DIRECTIVE<br>
#pragma omp parallel for<br>
@@ -663,6 +808,85 @@ void foo() {<br>
for (int i = 0; i < 10; ++i)<br>
;<br>
}<br>
+#pragma omp parallel for<br>
+ for (int i = 0; i < 10; ++i) {<br>
+#pragma omp parallel sections<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
+<br>
+// PARALLEL SECTIONS DIRECTIVE<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp for // expected-error {{region cannot be
closely nested inside 'parallel sections' region; perhaps
you forget to enclose 'omp for' directive into a parallel
region?}}<br>
+ for (int i = 0; i < 10; ++i)<br>
+ ;<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp simd<br>
+ for (int i = 0; i < 10; ++i)<br>
+ ;<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp parallel<br>
+ for (int i = 0; i < 10; ++i)<br>
+ ;<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp sections // expected-error {{region cannot be
closely nested inside 'parallel sections' region; perhaps
you forget to enclose 'omp sections' directive into a
parallel region?}}<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp section<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp section<br>
+ {<br>
+#pragma omp single // expected-error {{region cannot be
closely nested inside 'section' region; perhaps you forget
to enclose 'omp single' directive into a parallel region?}}<br>
+ bar();<br>
+ }<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp parallel<br>
+ {<br>
+#pragma omp single // OK<br>
+ {<br>
+ bar();<br>
+ }<br>
+#pragma omp for // OK<br>
+ for (int i = 0; i < 10; ++i)<br>
+ ;<br>
+#pragma omp sections // OK<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp parallel for<br>
+ for (int i = 0; i < 10; ++i)<br>
+ ;<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+#pragma omp parallel sections<br>
+ {<br>
+ bar();<br>
+ }<br>
+ }<br>
return foo<int>();<br>
}<br>
<br>
<br>
Added: cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp?rev=212516&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp
(added)<br>
+++ cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp
Tue Jul 8 03:12:03 2014<br>
@@ -0,0 +1,144 @@<br>
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ast-print %s
| FileCheck %s<br>
+// RUN: %clang_cc1 -fopenmp=libiomp5 -x c++ -std=c++11
-emit-pch -o %t %s<br>
+// RUN: %clang_cc1 -fopenmp=libiomp5 -std=c++11
-include-pch %t -fsyntax-only -verify %s -ast-print |
FileCheck %s<br>
+// expected-no-diagnostics<br>
+<br>
+#ifndef HEADER<br>
+#define HEADER<br>
+<br>
+void foo() {}<br>
+<br>
+template <class T><br>
+struct S {<br>
+ operator T() { return T(); }<br>
+ static T TS;<br>
+#pragma omp threadprivate(TS)<br>
+};<br>
+<br>
+// CHECK: template <class T = int> struct S {<br>
+// CHECK: static int TS;<br>
+// CHECK-NEXT: #pragma omp
threadprivate(S<int>::TS)<br>
+// CHECK-NEXT: }<br>
+// CHECK: template <class T = long> struct S {<br>
+// CHECK: static long TS;<br>
+// CHECK-NEXT: #pragma omp
threadprivate(S<long>::TS)<br>
+// CHECK-NEXT: }<br>
+// CHECK: template <class T> struct S {<br>
+// CHECK: static T TS;<br>
+// CHECK-NEXT: #pragma omp threadprivate(S::TS)<br>
+// CHECK: };<br>
+<br>
+template <typename T, int C><br>
+T tmain(T argc, T *argv) {<br>
+ T b = argc, c, d, e, f, g;<br>
+ static T a;<br>
+ S<T> s;<br>
+#pragma omp parallel sections<br>
+ {<br>
+ a = 2;<br>
+ }<br>
+#pragma omp parallel sections default(none), private(argc,
b) firstprivate(argv) shared(d) if (argc > 0)
num_threads(C) copyin(S < T > ::TS) proc_bind(master)
reduction(+ : c) reduction(max : e)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections if (C) num_threads(s)
proc_bind(close) reduction(^ : e, f) reduction(&& :
g) lastprivate(b, c)<br>
+ {<br>
+ foo();<br>
+#pragma omp section<br>
+ foo();<br>
+ }<br>
+ return 0;<br>
+}<br>
+<br>
+// CHECK: template <typename T = int, int C = 5> int
tmain(int argc, int *argv) {<br>
+// CHECK-NEXT: int b = argc, c, d, e, f, g;<br>
+// CHECK-NEXT: static int a;<br>
+// CHECK-NEXT: S<int> s;<br>
+// CHECK-NEXT: #pragma omp parallel sections<br>
+// CHECK-NEXT: {<br>
+// CHECK-NEXT: a = 2;<br>
+// CHECK-NEXT: }<br>
+// CHECK-NEXT: #pragma omp parallel sections default(none)
private(argc,b) firstprivate(argv) shared(d) if(argc > 0)
num_threads(5) copyin(S<int>::TS) proc_bind(master)
reduction(+: c) reduction(max: e)<br>
+// CHECK-NEXT: {<br>
+// CHECK-NEXT: foo();<br>
+// CHECK-NEXT: }<br>
+// CHECK-NEXT: #pragma omp parallel sections if(5)
num_threads(s) proc_bind(close) reduction(^: e,f)
reduction(&&: g) lastprivate(b,c)<br>
+// CHECK-NEXT: {<br>
+// CHECK-NEXT: foo();<br>
+// CHECK-NEXT: #pragma omp section<br>
+// CHECK-NEXT: foo();<br>
+// CHECK-NEXT: }<br>
+// CHECK: template <typename T = long, int C = 1>
long tmain(long argc, long *argv) {<br>
+// CHECK-NEXT: long b = argc, c, d, e, f, g;<br>
+// CHECK-NEXT: static long a;<br>
+// CHECK-NEXT: S<long> s;<br>
+// CHECK-NEXT: #pragma omp parallel sections<br>
+// CHECK-NEXT: {<br>
+// CHECK-NEXT: a = 2;<br>
+// CHECK-NEXT: }<br>
+// CHECK-NEXT: #pragma omp parallel sections default(none)
private(argc,b) firstprivate(argv) shared(d) if(argc > 0)
num_threads(1) copyin(S<long>::TS) proc_bind(master)
reduction(+: c) reduction(max: e)<br>
+// CHECK-NEXT: {<br>
+// CHECK-NEXT: foo();<br>
+// CHECK-NEXT: }<br>
+// CHECK-NEXT: #pragma omp parallel sections if(1)
num_threads(s) proc_bind(close) reduction(^: e,f)
reduction(&&: g) lastprivate(b,c)<br>
+// CHECK-NEXT: {<br>
+// CHECK-NEXT: foo();<br>
+// CHECK-NEXT: #pragma omp section<br>
+// CHECK-NEXT: foo();<br>
+// CHECK-NEXT: }<br>
+// CHECK: template <typename T, int C> T tmain(T
argc, T *argv) {<br>
+// CHECK-NEXT: T b = argc, c, d, e, f, g;<br>
+// CHECK-NEXT: static T a;<br>
+// CHECK-NEXT: S<T> s;<br>
+// CHECK-NEXT: #pragma omp parallel sections<br>
+// CHECK-NEXT: {<br>
+// CHECK-NEXT: a = 2;<br>
+// CHECK-NEXT: }<br>
+// CHECK-NEXT: #pragma omp parallel sections default(none)
private(argc,b) firstprivate(argv) shared(d) if(argc > 0)
num_threads(C) copyin(S<T>::TS) proc_bind(master)
reduction(+: c) reduction(max: e)<br>
+// CHECK-NEXT: {<br>
+// CHECK-NEXT: foo();<br>
+// CHECK-NEXT: }<br>
+// CHECK-NEXT: #pragma omp parallel sections if(C)
num_threads(s) proc_bind(close) reduction(^: e,f)
reduction(&&: g) lastprivate(b,c)<br>
+// CHECK-NEXT: {<br>
+// CHECK-NEXT: foo();<br>
+// CHECK-NEXT: #pragma omp section<br>
+// CHECK-NEXT: foo();<br>
+// CHECK-NEXT: }<br>
+<br>
+enum Enum {};<br>
+<br>
+int main(int argc, char **argv) {<br>
+ long x;<br>
+ int b = argc, c, d, e, f, g;<br>
+ static int a;<br>
+#pragma omp threadprivate(a)<br>
+ Enum ee;<br>
+// CHECK: Enum ee;<br>
+#pragma omp parallel sections<br>
+ // CHECK-NEXT: #pragma omp parallel sections<br>
+ {<br>
+ a = 2;<br>
+ }<br>
+// CHECK-NEXT: {<br>
+// CHECK-NEXT: a = 2;<br>
+// CHECK-NEXT: }<br>
+#pragma omp parallel sections default(none), private(argc,
b) firstprivate(argv) if (argc > 0) num_threads(ee)
copyin(a) proc_bind(spread) reduction(| : c, d) reduction(*
: e) lastprivate(argv)<br>
+ // CHECK-NEXT: #pragma omp parallel sections
default(none) private(argc,b) firstprivate(argv) if(argc
> 0) num_threads(ee) copyin(a) proc_bind(spread)
reduction(|: c,d) reduction(*: e) lastprivate(argv)<br>
+ {<br>
+ foo();<br>
+#pragma omp section<br>
+ foo();<br>
+#pragma omp section<br>
+ foo();<br>
+ }<br>
+ // CHECK-NEXT: {<br>
+ // CHECK-NEXT: foo();<br>
+ // CHECK-NEXT: #pragma omp section<br>
+ // CHECK-NEXT: foo();<br>
+ // CHECK-NEXT: #pragma omp section<br>
+ // CHECK-NEXT: foo();<br>
+ // CHECK-NEXT: }<br>
+ return tmain<int, 5>(b, &b) + tmain<long,
1>(x, &x);<br>
+}<br>
+<br>
+#endif<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_ast_print.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Added:
cfe/trunk/test/OpenMP/parallel_sections_copyin_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_copyin_messages.cpp?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_copyin_messages.cpp?rev=212516&view=auto</a><br>
==============================================================================<br>
---
cfe/trunk/test/OpenMP/parallel_sections_copyin_messages.cpp
(added)<br>
+++
cfe/trunk/test/OpenMP/parallel_sections_copyin_messages.cpp
Tue Jul 8 03:12:03 2014<br>
@@ -0,0 +1,105 @@<br>
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit
100 -o - %s<br>
+<br>
+void foo() {<br>
+}<br>
+<br>
+bool foobool(int argc) {<br>
+ return argc;<br>
+}<br>
+<br>
+struct S1; // expected-note {{declared here}}<br>
+class S2 {<br>
+ mutable int a;<br>
+<br>
+public:<br>
+ S2() : a(0) {}<br>
+ S2 &operator=(S2 &s2) { return *this; }<br>
+};<br>
+class S3 {<br>
+ int a;<br>
+<br>
+public:<br>
+ S3() : a(0) {}<br>
+ S3 &operator=(S3 &s3) { return *this; }<br>
+};<br>
+class S4 { // expected-note {{'S4' declared here}}<br>
+ int a;<br>
+ S4();<br>
+ S4 &operator=(const S4 &s4);<br>
+<br>
+public:<br>
+ S4(int v) : a(v) {}<br>
+};<br>
+class S5 { // expected-note {{'S5' declared here}}<br>
+ int a;<br>
+ S5() : a(0) {}<br>
+ S5 &operator=(const S5 &s5) { return *this; }<br>
+<br>
+public:<br>
+ S5(int v) : a(v) {}<br>
+};<br>
+template <class T><br>
+class ST {<br>
+public:<br>
+ static T s;<br>
+};<br>
+<br>
+S2 k;<br>
+S3 h;<br>
+S4 l(3); // expected-note {{'l' defined here}}<br>
+S5 m(4); // expected-note {{'m' defined here}}<br>
+#pragma omp threadprivate(h, k, l, m)<br>
+<br>
+int main(int argc, char **argv) {<br>
+ int i;<br>
+#pragma omp parallel sections copyin // expected-error
{{expected '(' after 'copyin'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyin( // expected-error
{{expected expression}} expected-error {{expected ')'}}
expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyin() // expected-error
{{expected expression}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyin(k // expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyin(h, // expected-error
{{expected expression}} expected-error {{expected ')'}}
expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyin(argc > 0 ? argv[1]
: argv[2]) // expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyin(l) // expected-error
{{copyin variable must have an accessible, unambiguous copy
assignment operator}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyin(S1) // expected-error
{{'S1' does not refer to a value}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyin(argv[1]) //
expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyin(i) // expected-error
{{copyin variable must be threadprivate}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyin(m) // expected-error
{{copyin variable must have an accessible, unambiguous copy
assignment operator}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyin(ST < int > ::s)
// expected-error {{copyin variable must be threadprivate}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+ return 0;<br>
+}<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_copyin_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_copyin_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_copyin_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Added:
cfe/trunk/test/OpenMP/parallel_sections_default_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_default_messages.cpp?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_default_messages.cpp?rev=212516&view=auto</a><br>
==============================================================================<br>
---
cfe/trunk/test/OpenMP/parallel_sections_default_messages.cpp
(added)<br>
+++
cfe/trunk/test/OpenMP/parallel_sections_default_messages.cpp
Tue Jul 8 03:12:03 2014<br>
@@ -0,0 +1,39 @@<br>
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit
100 -o - %s<br>
+<br>
+void foo();<br>
+<br>
+int main(int argc, char **argv) {<br>
+#pragma omp parallel sections default // expected-error
{{expected '(' after 'default'}}<br>
+ {<br>
+#pragma omp parallel sections default( // expected-error
{{expected 'none' or 'shared' in OpenMP clause 'default'}}
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+#pragma omp parallel sections default() // expected-error
{{expected 'none' or 'shared' in OpenMP clause 'default'}}<br>
+ {<br>
+#pragma omp parallel sections default(none //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+#pragma omp parallel sections default(shared),
default(shared) // expected-error {{directive '#pragma omp
parallel sections' cannot contain more than one 'default'
clause}}<br>
+ {<br>
+#pragma omp parallel sections default(x) // expected-error
{{expected 'none' or 'shared' in OpenMP clause 'default'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ }<br>
+ }<br>
+ }<br>
+ }<br>
+ }<br>
+<br>
+#pragma omp parallel sections default(none)<br>
+ {<br>
+ ++argc; // expected-error {{variable 'argc' must have
explicitly specified data sharing attributes}}<br>
+ }<br>
+<br>
+#pragma omp parallel sections default(none)<br>
+ {<br>
+#pragma omp parallel sections default(shared)<br>
+ {<br>
+ ++argc;<br>
+ }<br>
+ }<br>
+ return 0;<br>
+}<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_default_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_default_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_default_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Added:
cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp?rev=212516&view=auto</a><br>
==============================================================================<br>
---
cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp
(added)<br>
+++
cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp
Tue Jul 8 03:12:03 2014<br>
@@ -0,0 +1,295 @@<br>
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 %s<br>
+<br>
+void foo() {<br>
+}<br>
+<br>
+bool foobool(int argc) {<br>
+ return argc;<br>
+}<br>
+<br>
+struct S1; // expected-note 2 {{declared here}}
expected-note 2 {{forward declaration of 'S1'}}<br>
+extern S1 a;<br>
+class S2 {<br>
+ mutable int a;<br>
+<br>
+public:<br>
+ S2() : a(0) {}<br>
+ S2(S2 &s2) : a(s2.a) {}<br>
+ static float S2s;<br>
+ static const float S2sc;<br>
+};<br>
+const float S2::S2sc = 0;<br>
+const S2 b;<br>
+const S2 ba[5];<br>
+class S3 {<br>
+ int a;<br>
+ S3 &operator=(const S3 &s3);<br>
+<br>
+public:<br>
+ S3() : a(0) {}<br>
+ S3(S3 &s3) : a(s3.a) {}<br>
+};<br>
+const S3 c;<br>
+const S3 ca[5];<br>
+extern const int f;<br>
+class S4 { // expected-note 2 {{'S4' declared here}}<br>
+ int a;<br>
+ S4();<br>
+ S4(const S4 &s4);<br>
+<br>
+public:<br>
+ S4(int v) : a(v) {}<br>
+};<br>
+class S5 { // expected-note 4 {{'S5' declared here}}<br>
+ int a;<br>
+ S5(const S5 &s5) : a(s5.a) {}<br>
+<br>
+public:<br>
+ S5() : a(0) {}<br>
+ S5(int v) : a(v) {}<br>
+};<br>
+class S6 {<br>
+ int a;<br>
+ S6() : a(0) {}<br>
+<br>
+public:<br>
+ S6(const S6 &s6) : a(s6.a) {}<br>
+ S6(int v) : a(v) {}<br>
+};<br>
+<br>
+S3 h;<br>
+#pragma omp threadprivate(h) // expected-note 2 {{defined
as threadprivate or thread local}}<br>
+<br>
+template <class I, class C><br>
+int foomain(int argc, char **argv) {<br>
+ I e(4); // expected-note {{'e' defined here}}<br>
+ C g(5); // expected-note 2 {{'g' defined here}}<br>
+ int i;<br>
+ int &j = i; //
expected-note {{'j' defined here}}<br>
+#pragma omp parallel sections firstprivate //
expected-error {{expected '(' after 'firstprivate'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate( //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate() //
expected-error {{expected expression}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(argc //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(argc, //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(argc > 0 ?
argv[1] : argv[2]) // expected-error {{expected variable
name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(argc)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(S1) //
expected-error {{'S1' does not refer to a value}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(a, b) //
expected-error {{firstprivate variable with incomplete type
'S1'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(argv[1]) //
expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(e, g) //
expected-error 2 {{firstprivate variable must have an
accessible, unambiguous copy constructor}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(h) //
expected-error {{threadprivate or thread local variable
cannot be firstprivate}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections linear(i) // expected-error
{{unexpected OpenMP clause 'linear' in directive '#pragma
omp parallel sections'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel<br>
+ {<br>
+ int v = 0;<br>
+ int i;<br>
+#pragma omp parallel sections firstprivate(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+ v += i;<br>
+ }<br>
+#pragma omp parallel shared(i)<br>
+#pragma omp parallel private(i)<br>
+#pragma omp parallel sections firstprivate(j) //
expected-error {{arguments of OpenMP clause 'firstprivate'
cannot be of reference type}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(g)
firstprivate(g) // expected-error {{firstprivate variable
must have an accessible, unambiguous copy constructor}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel private(i)<br>
+#pragma omp parallel sections firstprivate(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel reduction(+ : i)<br>
+#pragma omp parallel sections firstprivate(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+ return 0;<br>
+}<br>
+<br>
+int main(int argc, char **argv) {<br>
+ const int d = 5;<br>
+ const int da[5] = {0};<br>
+ S4 e(4); // expected-note {{'e' defined here}}<br>
+ S5 g(5); // expected-note 2 {{'g' defined here}}<br>
+ S3 m;<br>
+ S6 n(2);<br>
+ int i;<br>
+ int &j = i; //
expected-note {{'j' defined here}}<br>
+#pragma omp parallel sections firstprivate //
expected-error {{expected '(' after 'firstprivate'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate( //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate() //
expected-error {{expected expression}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(argc //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(argc, //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(argc > 0 ?
argv[1] : argv[2]) // expected-error {{expected variable
name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(argc)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(S1) //
expected-error {{'S1' does not refer to a value}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(a, b, c, d, f)
// expected-error {{firstprivate variable with incomplete
type 'S1'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(argv[1]) //
expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(2 * 2) //
expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(ba) // OK<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(ca) // OK<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(da) // OK<br>
+ {<br>
+ foo();<br>
+ }<br>
+ int xa;<br>
+#pragma omp parallel sections firstprivate(xa) // OK<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(S2::S2s) // OK<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(S2::S2sc) // OK<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections safelen(5) // expected-error
{{unexpected OpenMP clause 'safelen' in directive '#pragma
omp parallel sections'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(e, g) //
expected-error 2 {{firstprivate variable must have an
accessible, unambiguous copy constructor}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(m) // OK<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(h) //
expected-error {{threadprivate or thread local variable
cannot be firstprivate}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(xa), firstprivate(xa)
// expected-error {{private variable cannot be
firstprivate}} expected-note {{defined as private}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel shared(xa)<br>
+#pragma omp parallel sections firstprivate(xa) // OK: may
be firstprivate<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(j) //
expected-error {{arguments of OpenMP clause 'firstprivate'
cannot be of reference type}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(g)
firstprivate(g) // expected-error {{firstprivate variable
must have an accessible, unambiguous copy constructor}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(n)
firstprivate(n) // OK<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel<br>
+ {<br>
+ int v = 0;<br>
+ int i;<br>
+#pragma omp parallel sections firstprivate(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+ v += i;<br>
+ }<br>
+#pragma omp parallel private(i)<br>
+#pragma omp parallel sections firstprivate(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel reduction(+ : i)<br>
+#pragma omp parallel sections firstprivate(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+ return foomain<S4, S5>(argc, argv); //
expected-note {{in instantiation of function template
specialization 'foomain<S4, S5>' requested here}}<br>
+}<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_firstprivate_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Added:
cfe/trunk/test/OpenMP/parallel_sections_if_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_if_messages.cpp?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_if_messages.cpp?rev=212516&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/OpenMP/parallel_sections_if_messages.cpp
(added)<br>
+++ cfe/trunk/test/OpenMP/parallel_sections_if_messages.cpp
Tue Jul 8 03:12:03 2014<br>
@@ -0,0 +1,113 @@<br>
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit
100 %s<br>
+<br>
+void foo() {<br>
+}<br>
+<br>
+bool foobool(int argc) {<br>
+ return argc;<br>
+}<br>
+<br>
+struct S1; // expected-note {{declared here}}<br>
+<br>
+template <class T, class S> // expected-note
{{declared here}}<br>
+int tmain(T argc, S **argv) {<br>
+ #pragma omp parallel sections if // expected-error
{{expected '(' after 'if'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if ( // expected-error
{{expected expression}} expected-error {{expected ')'}}
expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if () // expected-error
{{expected expression}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (argc // expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (argc)) //
expected-warning {{extra tokens at the end of '#pragma omp
parallel sections' are ignored}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (argc > 0 ? argv[1] :
argv[2])<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (foobool(argc)), if
(true) // expected-error {{directive '#pragma omp parallel
sections' cannot contain more than one 'if' clause}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (S) // expected-error
{{'S' does not refer to a value}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (argv[1]=2) //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (argc argc) //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if(argc)<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+ return 0;<br>
+}<br>
+<br>
+int main(int argc, char **argv) {<br>
+ #pragma omp parallel sections if // expected-error
{{expected '(' after 'if'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if ( // expected-error
{{expected expression}} expected-error {{expected ')'}}
expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if () // expected-error
{{expected expression}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (argc // expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (argc)) //
expected-warning {{extra tokens at the end of '#pragma omp
parallel sections' are ignored}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (argc > 0 ? argv[1] :
argv[2])<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (foobool(argc)), if
(true) // expected-error {{directive '#pragma omp parallel
sections' cannot contain more than one 'if' clause}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (S1) // expected-error
{{'S1' does not refer to a value}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (argv[1]=2) //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (argc argc) //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if (1 0) // expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ #pragma omp parallel sections if(if(tmain(argc, argv) //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+ return tmain(argc, argv);<br>
+}<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_if_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_if_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_if_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Added:
cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp?rev=212516&view=auto</a><br>
==============================================================================<br>
---
cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp
(added)<br>
+++
cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp
Tue Jul 8 03:12:03 2014<br>
@@ -0,0 +1,269 @@<br>
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 %s<br>
+<br>
+void foo() {<br>
+}<br>
+<br>
+bool foobool(int argc) {<br>
+ return argc;<br>
+}<br>
+<br>
+struct S1; // expected-note 2 {{declared here}}
expected-note 2 {{forward declaration of 'S1'}}<br>
+extern S1 a;<br>
+class S2 {<br>
+ mutable int a;<br>
+<br>
+public:<br>
+ S2() : a(0) {}<br>
+ S2(S2 &s2) : a(s2.a) {}<br>
+ static float S2s; // expected-note {{static data member
is predetermined as shared}}<br>
+ static const float S2sc;<br>
+};<br>
+const float S2::S2sc = 0; // expected-note {{static data
member is predetermined as shared}}<br>
+const S2 b;<br>
+const S2 ba[5];<br>
+class S3 { // expected-note 2 {{'S3' declared here}}<br>
+ int a;<br>
+ S3 &operator=(const S3 &s3);<br>
+<br>
+public:<br>
+ S3() : a(0) {}<br>
+ S3(S3 &s3) : a(s3.a) {}<br>
+};<br>
+const S3 c; // expected-note {{global variable is
predetermined as shared}}<br>
+const S3 ca[5]; // expected-note {{global variable is
predetermined as shared}}<br>
+extern const int f; // expected-note {{global variable is
predetermined as shared}}<br>
+class S4 { // expected-note 3 {{'S4' declared
here}}<br>
+ int a;<br>
+ S4();<br>
+ S4(const S4 &s4);<br>
+<br>
+public:<br>
+ S4(int v) : a(v) {}<br>
+};<br>
+class S5 { // expected-note {{'S5' declared here}}<br>
+ int a;<br>
+ S5() : a(0) {}<br>
+<br>
+public:<br>
+ S5(const S5 &s5) : a(s5.a) {}<br>
+ S5(int v) : a(v) {}<br>
+};<br>
+class S6 {<br>
+ int a;<br>
+ S6() : a(0) {}<br>
+<br>
+public:<br>
+ S6(const S6 &s6) : a(s6.a) {}<br>
+ S6(int v) : a(v) {}<br>
+};<br>
+<br>
+S3 h;<br>
+#pragma omp threadprivate(h) // expected-note 2 {{defined
as threadprivate or thread local}}<br>
+<br>
+template <class I, class C><br>
+int foomain(int argc, char **argv) {<br>
+ I e(4); // expected-note {{'e' defined here}}<br>
+ I g(5); // expected-note {{'g' defined here}}<br>
+ int i;<br>
+ int &j = i; //
expected-note {{'j' defined here}}<br>
+#pragma omp parallel sections lastprivate // expected-error
{{expected '(' after 'lastprivate'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate( //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate() //
expected-error {{expected expression}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(argc //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(argc, //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(argc > 0 ?
argv[1] : argv[2]) // expected-error {{expected variable
name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(argc)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(S1) //
expected-error {{'S1' does not refer to a value}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(a, b) //
expected-error {{lastprivate variable with incomplete type
'S1'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(argv[1]) //
expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(e, g) //
expected-error 2 {{lastprivate variable must have an
accessible, unambiguous default constructor}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(h) //
expected-error {{threadprivate or thread local variable
cannot be lastprivate}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections linear(i) // expected-error
{{unexpected OpenMP clause 'linear' in directive '#pragma
omp parallel sections'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel<br>
+ {<br>
+ int v = 0;<br>
+ int i;<br>
+#pragma omp parallel sections lastprivate(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+ v += i;<br>
+ }<br>
+#pragma omp parallel shared(i)<br>
+#pragma omp parallel private(i)<br>
+#pragma omp parallel sections lastprivate(j) //
expected-error {{arguments of OpenMP clause 'lastprivate'
cannot be of reference type}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+ return 0;<br>
+}<br>
+<br>
+int main(int argc, char **argv) {<br>
+ const int d = 5; // expected-note {{constant
variable is predetermined as shared}}<br>
+ const int da[5] = {0}; // expected-note {{constant
variable is predetermined as shared}}<br>
+ S4 e(4); // expected-note {{'e' defined
here}}<br>
+ S5 g(5); // expected-note {{'g' defined
here}}<br>
+ S3 m; // expected-note 2 {{'m' defined
here}}<br>
+ S6 n(2);<br>
+ int i;<br>
+ int &j = i; //
expected-note {{'j' defined here}}<br>
+#pragma omp parallel sections lastprivate // expected-error
{{expected '(' after 'lastprivate'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate( //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate() //
expected-error {{expected expression}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(argc //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(argc, //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(argc > 0 ?
argv[1] : argv[2]) // expected-error {{expected variable
name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(argc)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(S1) //
expected-error {{'S1' does not refer to a value}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(a, b, c, d, f) //
expected-error {{lastprivate variable with incomplete type
'S1'}} expected-error 3 {{shared variable cannot be
lastprivate}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(argv[1]) //
expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(2 * 2) //
expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(ba)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(ca) //
expected-error {{shared variable cannot be lastprivate}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(da) //
expected-error {{shared variable cannot be lastprivate}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+ int xa;<br>
+#pragma omp parallel sections lastprivate(xa) // OK<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(S2::S2s) //
expected-error {{shared variable cannot be lastprivate}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(S2::S2sc) //
expected-error {{shared variable cannot be lastprivate}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections safelen(5) // expected-error
{{unexpected OpenMP clause 'safelen' in directive '#pragma
omp parallel sections'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(e, g) //
expected-error 2 {{lastprivate variable must have an
accessible, unambiguous default constructor}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(m) //
expected-error {{lastprivate variable must have an
accessible, unambiguous copy assignment operator}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(h) //
expected-error {{threadprivate or thread local variable
cannot be lastprivate}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(xa), lastprivate(xa)
// expected-error {{private variable cannot be lastprivate}}
expected-note {{defined as private}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel private(xa)<br>
+#pragma omp parallel sections lastprivate(xa)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel reduction(+ : xa)<br>
+#pragma omp parallel sections lastprivate(xa)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(j) //
expected-error {{arguments of OpenMP clause 'lastprivate'
cannot be of reference type}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections firstprivate(m)
lastprivate(m) // expected-error {{lastprivate variable must
have an accessible, unambiguous copy assignment operator}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(n)
firstprivate(n) // OK<br>
+ {<br>
+ foo();<br>
+ }<br>
+ return foomain<S4, S5>(argc, argv); //
expected-note {{in instantiation of function template
specialization 'foomain<S4, S5>' requested here}}<br>
+}<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_lastprivate_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Added: cfe/trunk/test/OpenMP/parallel_sections_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_messages.cpp?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_messages.cpp?rev=212516&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/OpenMP/parallel_sections_messages.cpp
(added)<br>
+++ cfe/trunk/test/OpenMP/parallel_sections_messages.cpp Tue
Jul 8 03:12:03 2014<br>
@@ -0,0 +1,86 @@<br>
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit
100 -std=c++11 -o - %s<br>
+<br>
+void foo() {<br>
+}<br>
+<br>
+#pragma omp parallel sections // expected-error
{{unexpected OpenMP directive '#pragma omp parallel
sections'}}<br>
+<br>
+int main(int argc, char **argv) {<br>
+#pragma omp parallel sections {// expected-warning {{extra
tokens at the end of '#pragma omp parallel sections' are
ignored}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections( // expected-warning {{extra
tokens at the end of '#pragma omp parallel sections' are
ignored}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections[ // expected-warning {{extra
tokens at the end of '#pragma omp parallel sections' are
ignored}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections] // expected-warning {{extra
tokens at the end of '#pragma omp parallel sections' are
ignored}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections) // expected-warning {{extra
tokens at the end of '#pragma omp parallel sections' are
ignored}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections } // expected-warning {{extra
tokens at the end of '#pragma omp parallel sections' are
ignored}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-warning@+1 {{extra tokens at the end of
'#pragma omp parallel sections' are ignored}}<br>
+#pragma omp parallel sections unknown()<br>
+ {<br>
+ foo();<br>
+#pragma omp section<br>
+ L1:<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+ ;<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+ goto L1; // expected-error {{use of undeclared label
'L1'}}<br>
+ }<br>
+<br>
+ for (int i = 0; i < 10; ++i) {<br>
+ switch (argc) {<br>
+ case (0):<br>
+#pragma omp parallel sections<br>
+ {<br>
+ foo();<br>
+ break; // expected-error {{'break' statement not
in loop or switch statement}}<br>
+ continue; // expected-error {{'continue' statement
not in loop statement}}<br>
+ }<br>
+ default:<br>
+ break;<br>
+ }<br>
+ }<br>
+#pragma omp parallel sections default(none)<br>
+ {<br>
+ ++argc; // expected-error {{variable 'argc' must have
explicitly specified data sharing attributes}}<br>
+ }<br>
+<br>
+ goto L2; // expected-error {{use of undeclared label
'L2'}}<br>
+#pragma omp parallel sections<br>
+ {<br>
+ L2:<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections<br>
+ {<br>
+ return 1; // expected-error {{cannot return from OpenMP
region}}<br>
+ }<br>
+<br>
+ [[]] // expected-error {{an attribute list cannot appear
here}}<br>
+#pragma omp parallel sections<br>
+ {<br>
+ }<br>
+<br>
+ return 0;<br>
+}<br>
+<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Added:
cfe/trunk/test/OpenMP/parallel_sections_misc_messages.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_misc_messages.c?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_misc_messages.c?rev=212516&view=auto</a><br>
==============================================================================<br>
--- cfe/trunk/test/OpenMP/parallel_sections_misc_messages.c
(added)<br>
+++ cfe/trunk/test/OpenMP/parallel_sections_misc_messages.c
Tue Jul 8 03:12:03 2014<br>
@@ -0,0 +1,260 @@<br>
+// RUN: %clang_cc1 -fsyntax-only -fopenmp=libiomp5 -verify
%s<br>
+<br>
+void foo();<br>
+<br>
+// expected-error@+1 {{unexpected OpenMP directive '#pragma
omp parallel sections'}}<br>
+#pragma omp parallel sections<br>
+<br>
+// expected-error@+1 {{unexpected OpenMP directive '#pragma
omp parallel sections'}}<br>
+#pragma omp parallel sections foo<br>
+<br>
+void test_no_clause() {<br>
+ int i;<br>
+#pragma omp parallel sections<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+// expected-error@+2 {{the statement for '#pragma omp
parallel sections' must be a compound statement}}<br>
+#pragma omp parallel sections<br>
+ ++i;<br>
+<br>
+#pragma omp parallel sections<br>
+ {<br>
+ foo();<br>
+ foo(); // expected-error {{statement in 'omp parallel
sections' directive must be enclosed into a section region}}<br>
+ }<br>
+<br>
+}<br>
+<br>
+void test_branch_protected_scope() {<br>
+ int i = 0;<br>
+L1:<br>
+ ++i;<br>
+<br>
+ int x[24];<br>
+<br>
+#pragma omp parallel sections<br>
+ {<br>
+ if (i == 5)<br>
+ goto L1; // expected-error {{use of undeclared label
'L1'}}<br>
+ else if (i == 6)<br>
+ return; // expected-error {{cannot return from OpenMP
region}}<br>
+ else if (i == 7)<br>
+ goto L2;<br>
+ else if (i == 8) {<br>
+ L2:<br>
+ x[i]++;<br>
+ }<br>
+#pragma omp section<br>
+ if (i == 5)<br>
+ goto L1; // expected-error {{use of undeclared label
'L1'}}<br>
+ else if (i == 6)<br>
+ return; // expected-error {{cannot return from OpenMP
region}}<br>
+ else if (i == 7)<br>
+ goto L3;<br>
+ else if (i == 8) {<br>
+ L3:<br>
+ x[i]++;<br>
+ }<br>
+ }<br>
+<br>
+ if (x[0] == 0)<br>
+ goto L2; // expected-error {{use of undeclared label
'L2'}}<br>
+ else if (x[1] == 1)<br>
+ goto L1;<br>
+ goto L3; // expected-error {{use of undeclared label
'L3'}}<br>
+}<br>
+<br>
+void test_invalid_clause() {<br>
+ int i;<br>
+// expected-warning@+1 {{extra tokens at the end of
'#pragma omp parallel sections' are ignored}}<br>
+#pragma omp parallel sections foo bar<br>
+ {<br>
+ foo();<br>
+// expected-error@+1 {{unexpected OpenMP clause 'nowait' in
directive '#pragma omp section'}}<br>
+#pragma omp section nowait<br>
+ ;<br>
+ }<br>
+}<br>
+<br>
+void test_non_identifiers() {<br>
+ int i, x;<br>
+<br>
+// expected-warning@+1 {{extra tokens at the end of
'#pragma omp parallel sections' are ignored}}<br>
+#pragma omp parallel sections;<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+2 {{unexpected OpenMP clause 'linear' in
directive '#pragma omp parallel sections'}}<br>
+// expected-warning@+1 {{extra tokens at the end of
'#pragma omp parallel sections' are ignored}}<br>
+#pragma omp parallel sections linear(x);<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+// expected-warning@+1 {{extra tokens at the end of
'#pragma omp parallel sections' are ignored}}<br>
+#pragma omp parallel sections private(x);<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+// expected-warning@+1 {{extra tokens at the end of
'#pragma omp parallel sections' are ignored}}<br>
+#pragma omp parallel sections, private(x);<br>
+ {<br>
+ foo();<br>
+ }<br>
+}<br>
+<br>
+void test_private() {<br>
+ int i;<br>
+// expected-error@+2 {{expected expression}}<br>
+// expected-error@+1 {{expected ')'}} expected-note@+1 {{to
match this '('}}<br>
+#pragma omp parallel sections private(<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to
match this '('}}<br>
+// expected-error@+1 2 {{expected expression}}<br>
+#pragma omp parallel sections private(,<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+1 2 {{expected expression}}<br>
+#pragma omp parallel sections private(, )<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+1 {{expected expression}}<br>
+#pragma omp parallel sections private()<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+1 {{expected expression}}<br>
+#pragma omp parallel sections private(int)<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+1 {{expected variable name}}<br>
+#pragma omp parallel sections private(0)<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+ int x, y, z;<br>
+#pragma omp parallel sections private(x)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(x, y)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(x, y, z)<br>
+ {<br>
+ foo();<br>
+ }<br>
+}<br>
+<br>
+void test_lastprivate() {<br>
+ int i;<br>
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to
match this '('}}<br>
+// expected-error@+1 {{expected expression}}<br>
+#pragma omp parallel sections lastprivate(<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to
match this '('}}<br>
+// expected-error@+1 2 {{expected expression}}<br>
+#pragma omp parallel sections lastprivate(,<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+1 2 {{expected expression}}<br>
+#pragma omp parallel sections lastprivate(, )<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+1 {{expected expression}}<br>
+#pragma omp parallel sections lastprivate()<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+1 {{expected expression}}<br>
+#pragma omp parallel sections lastprivate(int)<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+1 {{expected variable name}}<br>
+#pragma omp parallel sections lastprivate(0)<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+ int x, y, z;<br>
+#pragma omp parallel sections lastprivate(x)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(x, y)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(x, y, z)<br>
+ {<br>
+ foo();<br>
+ }<br>
+}<br>
+<br>
+void test_firstprivate() {<br>
+ int i;<br>
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to
match this '('}}<br>
+// expected-error@+1 {{expected expression}}<br>
+#pragma omp parallel sections firstprivate(<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+// expected-error@+2 {{expected ')'}} expected-note@+2 {{to
match this '('}}<br>
+// expected-error@+1 2 {{expected expression}}<br>
+#pragma omp parallel sections firstprivate(,<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+1 2 {{expected expression}}<br>
+#pragma omp parallel sections firstprivate(, )<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+1 {{expected expression}}<br>
+#pragma omp parallel sections firstprivate()<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+1 {{expected expression}}<br>
+#pragma omp parallel sections firstprivate(int)<br>
+ {<br>
+ foo();<br>
+ }<br>
+// expected-error@+1 {{expected variable name}}<br>
+#pragma omp parallel sections firstprivate(0)<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+ int x, y, z;<br>
+#pragma omp parallel sections lastprivate(x)
firstprivate(x)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(x, y)
firstprivate(x, y)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections lastprivate(x, y, z)
firstprivate(x, y, z)<br>
+ {<br>
+ foo();<br>
+ }<br>
+}<br>
+<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_misc_messages.c<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_misc_messages.c<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_misc_messages.c<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Added:
cfe/trunk/test/OpenMP/parallel_sections_num_threads_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_num_threads_messages.cpp?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_num_threads_messages.cpp?rev=212516&view=auto</a><br>
==============================================================================<br>
---
cfe/trunk/test/OpenMP/parallel_sections_num_threads_messages.cpp
(added)<br>
+++
cfe/trunk/test/OpenMP/parallel_sections_num_threads_messages.cpp
Tue Jul 8 03:12:03 2014<br>
@@ -0,0 +1,63 @@<br>
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit
100 %s<br>
+<br>
+void foo() {<br>
+}<br>
+<br>
+bool foobool(int argc) {<br>
+ return argc;<br>
+}<br>
+<br>
+struct S1; // expected-note {{declared here}}<br>
+<br>
+template <class T, typename S, int N> //
expected-note {{declared here}}<br>
+T tmain(T argc, S **argv) {<br>
+ #pragma omp parallel sections num_threads //
expected-error {{expected '(' after 'num_threads'}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads ( //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads () //
expected-error {{expected expression}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads (argc //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads (argc)) //
expected-warning {{extra tokens at the end of '#pragma omp
parallel sections' are ignored}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads ((argc > 0)
? argv[1] : argv[2]) // expected-error 2 {{expression must
have integral or unscoped enumeration type, not 'char *'}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads
(foobool(argc)), num_threads (true), num_threads (-5) //
expected-error 2 {{directive '#pragma omp parallel sections'
cannot contain more than one 'num_threads' clause}}
expected-error {{argument to 'num_threads' clause must be a
positive integer value}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads (S) //
expected-error {{'S' does not refer to a value}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads (argv[1]=2) //
expected-error {{expected ')'}} expected-note {{to match
this '('}} expected-error 2 {{expression must have integral
or unscoped enumeration type, not 'char *'}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads (argc)<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads (N) //
expected-error {{argument to 'num_threads' clause must be a
positive integer value}}<br>
+ {foo();}<br>
+<br>
+ return argc;<br>
+}<br>
+<br>
+int main(int argc, char **argv) {<br>
+ #pragma omp parallel sections num_threads //
expected-error {{expected '(' after 'num_threads'}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads ( //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads () //
expected-error {{expected expression}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads (argc //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads (argc)) //
expected-warning {{extra tokens at the end of '#pragma omp
parallel sections' are ignored}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads (argc > 0 ?
argv[1] : argv[2]) // expected-error {{integral }}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads
(foobool(argc)), num_threads (true), num_threads (-5) //
expected-error 2 {{directive '#pragma omp parallel sections'
cannot contain more than one 'num_threads' clause}}
expected-error {{argument to 'num_threads' clause must be a
positive integer value}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads (S1) //
expected-error {{'S1' does not refer to a value}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads (argv[1]=2) //
expected-error {{expected ')'}} expected-note {{to match
this '('}} expected-error {{expression must have integral or
unscoped enumeration type, not 'char *'}}<br>
+ {foo();}<br>
+ #pragma omp parallel sections num_threads
(num_threads(tmain<int, char, -1>(argc, argv) //
expected-error 2 {{expected ')'}} expected-note 2 {{to match
this '('}} expected-note {{in instantiation of function
template specialization 'tmain<int, char, -1>'
requested here}}<br>
+ {foo();}<br>
+<br>
+ return tmain<int, char, 3>(argc, argv); //
expected-note {{in instantiation of function template
specialization 'tmain<int, char, 3>' requested here}}<br>
+}<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_num_threads_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_num_threads_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_num_threads_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Added:
cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp?rev=212516&view=auto</a><br>
==============================================================================<br>
---
cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp
(added)<br>
+++
cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp
Tue Jul 8 03:12:03 2014<br>
@@ -0,0 +1,204 @@<br>
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 %s<br>
+<br>
+void foo() {<br>
+}<br>
+<br>
+bool foobool(int argc) {<br>
+ return argc;<br>
+}<br>
+<br>
+struct S1; // expected-note 2 {{declared here}}
expected-note 2 {{forward declaration of 'S1'}}<br>
+extern S1 a;<br>
+class S2 {<br>
+ mutable int a;<br>
+<br>
+public:<br>
+ S2() : a(0) {}<br>
+};<br>
+const S2 b;<br>
+const S2 ba[5];<br>
+class S3 {<br>
+ int a;<br>
+<br>
+public:<br>
+ S3() : a(0) {}<br>
+};<br>
+const S3 ca[5];<br>
+class S4 { // expected-note {{'S4' declared here}}<br>
+ int a;<br>
+ S4();<br>
+<br>
+public:<br>
+ S4(int v) : a(v) {}<br>
+};<br>
+class S5 { // expected-note {{'S5' declared here}}<br>
+ int a;<br>
+ S5() : a(0) {}<br>
+<br>
+public:<br>
+ S5(int v) : a(v) {}<br>
+};<br>
+<br>
+S3 h;<br>
+#pragma omp threadprivate(h) // expected-note 2 {{defined
as threadprivate or thread local}}<br>
+<br>
+template <class I, class C><br>
+int foomain(I argc, C **argv) {<br>
+ I e(4);<br>
+ I g(5);<br>
+ int i;<br>
+ int &j = i; // expected-note
{{'j' defined here}}<br>
+#pragma omp parallel sections private // expected-error
{{expected '(' after 'private'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private( // expected-error
{{expected expression}} expected-error {{expected ')'}}
expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private() // expected-error
{{expected expression}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(argc //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(argc, //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(argc > 0 ? argv[1]
: argv[2]) // expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(argc)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(S1) // expected-error
{{'S1' does not refer to a value}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(a, b) //
expected-error {{private variable with incomplete type
'S1'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(argv[1]) //
expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(e, g)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(h) // expected-error
{{threadprivate or thread local variable cannot be private}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyprivate(i) //
expected-error {{unexpected OpenMP clause 'copyprivate' in
directive '#pragma omp parallel sections'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel<br>
+ {<br>
+ int v = 0;<br>
+ int i;<br>
+#pragma omp parallel sections private(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+ v += i;<br>
+ }<br>
+#pragma omp parallel shared(i)<br>
+#pragma omp parallel private(i)<br>
+#pragma omp parallel sections private(j) // expected-error
{{arguments of OpenMP clause 'private' cannot be of
reference type}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+ return 0;<br>
+}<br>
+<br>
+int main(int argc, char **argv) {<br>
+ S4 e(4); // expected-note {{'e' defined here}}<br>
+ S5 g(5); // expected-note {{'g' defined here}}<br>
+ int i;<br>
+ int &j = i; // expected-note
{{'j' defined here}}<br>
+#pragma omp parallel sections private // expected-error
{{expected '(' after 'private'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private( // expected-error
{{expected expression}} expected-error {{expected ')'}}
expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private() // expected-error
{{expected expression}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(argc //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(argc, //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(argc > 0 ? argv[1]
: argv[2]) // expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(argc)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(S1) // expected-error
{{'S1' does not refer to a value}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(a, b) //
expected-error {{private variable with incomplete type
'S1'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(argv[1]) //
expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(e, g) //
expected-error 2 {{private variable must have an accessible,
unambiguous default constructor}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(h) // expected-error
{{threadprivate or thread local variable cannot be private}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections copyprivate(i) //
expected-error {{unexpected OpenMP clause 'copyprivate' in
directive '#pragma omp parallel sections'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel<br>
+ {<br>
+ int i;<br>
+#pragma omp parallel sections private(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+ }<br>
+#pragma omp parallel shared(i)<br>
+#pragma omp parallel private(i)<br>
+#pragma omp parallel sections private(j) // expected-error
{{arguments of OpenMP clause 'private' cannot be of
reference type}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(i)<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+ return 0;<br>
+}<br>
+<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_private_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Added:
cfe/trunk/test/OpenMP/parallel_sections_proc_bind_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_proc_bind_messages.cpp?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_proc_bind_messages.cpp?rev=212516&view=auto</a><br>
==============================================================================<br>
---
cfe/trunk/test/OpenMP/parallel_sections_proc_bind_messages.cpp
(added)<br>
+++
cfe/trunk/test/OpenMP/parallel_sections_proc_bind_messages.cpp
Tue Jul 8 03:12:03 2014<br>
@@ -0,0 +1,28 @@<br>
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit
100 -o - %s<br>
+<br>
+void foo();<br>
+<br>
+int main(int argc, char **argv) {<br>
+#pragma omp parallel sections proc_bind // expected-error
{{expected '(' after 'proc_bind'}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections proc_bind( // expected-error
{{expected 'master', 'close' or 'spread' in OpenMP clause
'proc_bind'}} expected-error {{expected ')'}} expected-note
{{to match this '('}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections proc_bind() // expected-error
{{expected 'master', 'close' or 'spread' in OpenMP clause
'proc_bind'}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections proc_bind(master //
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections proc_bind(close),
proc_bind(spread) // expected-error {{directive '#pragma omp
parallel sections' cannot contain more than one 'proc_bind'
clause}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections proc_bind(x) //
expected-error {{expected 'master', 'close' or 'spread' in
OpenMP clause 'proc_bind'}}<br>
+ { foo(); }<br>
+<br>
+#pragma omp parallel sections proc_bind(master)<br>
+ { ++argc; }<br>
+<br>
+#pragma omp parallel sections proc_bind(close)<br>
+ {<br>
+#pragma omp parallel sections proc_bind(spread)<br>
+ { ++argc; }<br>
+ }<br>
+ return 0;<br>
+}<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_proc_bind_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_proc_bind_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_proc_bind_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Added:
cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp?rev=212516&view=auto</a><br>
==============================================================================<br>
---
cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp
(added)<br>
+++
cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp
Tue Jul 8 03:12:03 2014<br>
@@ -0,0 +1,358 @@<br>
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit
100 -o - %s<br>
+<br>
+void foo() {<br>
+}<br>
+<br>
+bool foobool(int argc) {<br>
+ return argc;<br>
+}<br>
+<br>
+struct S1; // expected-note {{declared here}} expected-note
4 {{forward declaration of 'S1'}}<br>
+extern S1 a;<br>
+class S2 {<br>
+ mutable int a;<br>
+ S2 &operator+=(const S2 &arg) { return (*this); }<br>
+<br>
+public:<br>
+ S2() : a(0) {}<br>
+ S2(S2 &s2) : a(s2.a) {}<br>
+ static float S2s; // expected-note 2 {{static data member
is predetermined as shared}}<br>
+ static const float S2sc;<br>
+};<br>
+const float S2::S2sc = 0; // expected-note 2 {{'S2sc'
defined here}}<br>
+S2 b; // expected-note 2 {{'b' defined
here}}<br>
+const S2 ba[5]; // expected-note 2 {{'ba' defined
here}}<br>
+class S3 {<br>
+ int a;<br>
+<br>
+public:<br>
+ S3() : a(0) {}<br>
+ S3(const S3 &s3) : a(s3.a) {}<br>
+ S3 operator+=(const S3 &arg1) { return arg1; }<br>
+};<br>
+int operator+=(const S3 &arg1, const S3 &arg2) {
return 5; }<br>
+S3 c; // expected-note 2 {{'c' defined here}}<br>
+const S3 ca[5]; // expected-note 2 {{'ca' defined
here}}<br>
+extern const int f; // expected-note 4 {{'f' declared
here}}<br>
+class S4 { // expected-note {{'S4' declared here}}<br>
+ int a;<br>
+ S4();<br>
+ S4(const S4 &s4);<br>
+ S4 &operator+=(const S4 &arg) { return (*this); }<br>
+<br>
+public:<br>
+ S4(int v) : a(v) {}<br>
+};<br>
+S4 &operator&=(S4 &arg1, S4 &arg2) { return
arg1; }<br>
+class S5 {<br>
+ int a;<br>
+ S5() : a(0) {}<br>
+ S5(const S5 &s5) : a(s5.a) {}<br>
+ S5 &operator+=(const S5 &arg);<br>
+<br>
+public:<br>
+ S5(int v) : a(v) {}<br>
+};<br>
+class S6 {<br>
+ int a;<br>
+<br>
+public:<br>
+ S6() : a(6) {}<br>
+ operator int() { return 6; }<br>
+} o; // expected-note 2 {{'o' defined here}}<br>
+<br>
+S3 h, k;<br>
+#pragma omp threadprivate(h) // expected-note 2 {{defined
as threadprivate or thread local}}<br>
+<br>
+template <class T> // expected-note {{declared
here}}<br>
+T tmain(T argc) { // expected-note 2 {{'argc'
defined here}}<br>
+ const T d = T(); // expected-note 4 {{'d' defined
here}}<br>
+ const T da[5] = {T()}; // expected-note 2 {{'da' defined
here}}<br>
+ T qa[5] = {T()};<br>
+ T i;<br>
+ T &j = i; //
expected-note 4 {{'j' defined here}}<br>
+ S3 &p = k; //
expected-note 2 {{'p' defined here}}<br>
+ const T &r = da[(int)i]; //
expected-note 2 {{'r' defined here}}<br>
+ T &q = qa[(int)i]; //
expected-note 2 {{'q' defined here}}<br>
+ T fl; // expected-note
{{'fl' defined here}}<br>
+#pragma omp parallel sections reduction // expected-error
{{expected '(' after 'reduction'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction + // expected-error
{{expected '(' after 'reduction'}} expected-warning {{extra
tokens at the end of '#pragma omp parallel sections' are
ignored}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction( // expected-error
{{expected unqualified-id}} expected-warning {{missing ':'
after reduction identifier - ignoring}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(- //
expected-warning {{missing ':' after reduction identifier -
ignoring}} expected-error {{expected expression}}
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction() // expected-error
{{expected unqualified-id}} expected-warning {{missing ':'
after reduction identifier - ignoring}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(*) //
expected-warning {{missing ':' after reduction identifier -
ignoring}} expected-error {{expected expression}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(\) //
expected-error {{expected unqualified-id}} expected-warning
{{missing ':' after reduction identifier - ignoring}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(& : argc //
expected-error {{expected ')'}} expected-note {{to match
this '('}} expected-error {{variable of type 'float' is not
valid for specified reduction operation}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(| : argc, //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}
expected-error {{variable of type 'float' is not valid for
specified reduction operation}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(|| : argc ? i :
argc) // expected-error 2 {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(foo : argc)
//expected-error {{incorrect reduction identifier, expected
one of '+', '-', '*', '&', '|', '^', '&&', '||',
'min' or 'max'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(&& : argc)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(^ : T) //
expected-error {{'T' does not refer to a value}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(+ : a, b, c, d, f)
// expected-error {{reduction variable with incomplete type
'S1'}} expected-error 3 {{const-qualified variable cannot be
reduction}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(min : a, b, c, d,
f) // expected-error {{reduction variable with incomplete
type 'S1'}} expected-error 2 {{arguments of OpenMP clause
'reduction' for 'min' or 'max' must be of arithmetic type}}
expected-error 3 {{const-qualified variable cannot be
reduction}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(max : qa[1]) //
expected-error 2 {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(+ : ba) //
expected-error {{a reduction variable with array type 'const
S2 [5]'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(* : ca) //
expected-error {{a reduction variable with array type 'const
S3 [5]'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(- : da) //
expected-error {{a reduction variable with array type 'const
int [5]'}} expected-error {{a reduction variable with array
type 'const float [5]'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(^ : fl) //
expected-error {{variable of type 'float' is not valid for
specified reduction operation}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(&& :
S2::S2s) // expected-error {{shared variable cannot be
reduction}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(&& :
S2::S2sc) // expected-error {{const-qualified variable
cannot be reduction}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(+ : h, k) //
expected-error {{threadprivate or thread local variable
cannot be reduction}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(+ : o) //
expected-error {{variable of type 'class S6' is not valid
for specified reduction operation}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(i), reduction(+ : j),
reduction(+ : q) // expected-error 4 {{argument of OpenMP
clause 'reduction' must reference the same object in all
threads}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel private(k)<br>
+#pragma omp parallel sections reduction(+ : p), reduction(+
: p) // expected-error 2 {{argument of OpenMP clause
'reduction' must reference the same object in all threads}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(+ : p), reduction(+
: p) // expected-error 3 {{variable can appear only once in
OpenMP 'reduction' clause}} expected-note 3 {{previously
referenced here}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(+ : r) //
expected-error 2 {{const-qualified variable cannot be
reduction}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel shared(i)<br>
+#pragma omp parallel reduction(min : i)<br>
+#pragma omp parallel sections reduction(max : j) //
expected-error 2 {{argument of OpenMP clause 'reduction'
must reference the same object in all threads}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel private(fl)<br>
+#pragma omp parallel sections reduction(+ : fl)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel reduction(* : fl)<br>
+#pragma omp parallel sections reduction(+ : fl)<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+ return T();<br>
+}<br>
+<br>
+int main(int argc, char **argv) {<br>
+ const int d = 5; // expected-note 2 {{'d' defined
here}}<br>
+ const int da[5] = {0}; // expected-note {{'da' defined
here}}<br>
+ int qa[5] = {0};<br>
+ S4 e(4); // expected-note {{'e' defined here}}<br>
+ S5 g(5); // expected-note {{'g' defined here}}<br>
+ int i;<br>
+ int &j = i; //
expected-note 2 {{'j' defined here}}<br>
+ S3 &p = k; //
expected-note 2 {{'p' defined here}}<br>
+ const int &r = da[i]; //
expected-note {{'r' defined here}}<br>
+ int &q = qa[i]; //
expected-note {{'q' defined here}}<br>
+ float fl; // expected-note
{{'fl' defined here}}<br>
+#pragma omp parallel sections reduction // expected-error
{{expected '(' after 'reduction'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction + // expected-error
{{expected '(' after 'reduction'}} expected-warning {{extra
tokens at the end of '#pragma omp parallel sections' are
ignored}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction( // expected-error
{{expected unqualified-id}} expected-warning {{missing ':'
after reduction identifier - ignoring}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(- //
expected-warning {{missing ':' after reduction identifier -
ignoring}} expected-error {{expected expression}}
expected-error {{expected ')'}} expected-note {{to match
this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction() // expected-error
{{expected unqualified-id}} expected-warning {{missing ':'
after reduction identifier - ignoring}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(*) //
expected-warning {{missing ':' after reduction identifier -
ignoring}} expected-error {{expected expression}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(\) //
expected-error {{expected unqualified-id}} expected-warning
{{missing ':' after reduction identifier - ignoring}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(foo : argc //
expected-error {{expected ')'}} expected-note {{to match
this '('}} expected-error {{incorrect reduction identifier,
expected one of '+', '-', '*', '&', '|', '^',
'&&', '||', 'min' or 'max'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(| : argc, //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(|| : argc > 0 ?
argv[1] : argv[2]) // expected-error {{expected variable
name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(~ : argc) //
expected-error {{expected unqualified-id}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(&& : argc)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(^ : S1) //
expected-error {{'S1' does not refer to a value}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(+ : a, b, c, d, f)
// expected-error {{reduction variable with incomplete type
'S1'}} expected-error 2 {{const-qualified variable cannot be
reduction}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(min : a, b, c, d,
f) // expected-error {{reduction variable with incomplete
type 'S1'}} expected-error 2 {{arguments of OpenMP clause
'reduction' for 'min' or 'max' must be of arithmetic type}}
expected-error 2 {{const-qualified variable cannot be
reduction}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(max : argv[1]) //
expected-error {{expected variable name}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(+ : ba) //
expected-error {{a reduction variable with array type 'const
S2 [5]'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(* : ca) //
expected-error {{a reduction variable with array type 'const
S3 [5]'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(- : da) //
expected-error {{a reduction variable with array type 'const
int [5]'}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(^ : fl) //
expected-error {{variable of type 'float' is not valid for
specified reduction operation}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(&& :
S2::S2s) // expected-error {{shared variable cannot be
reduction}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(&& :
S2::S2sc) // expected-error {{const-qualified variable
cannot be reduction}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(& : e, g) //
expected-error {{reduction variable must have an accessible,
unambiguous default constructor}} expected-error {{variable
of type 'S5' is not valid for specified reduction
operation}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(+ : h, k) //
expected-error {{threadprivate or thread local variable
cannot be reduction}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(+ : o) //
expected-error {{variable of type 'class S6' is not valid
for specified reduction operation}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections private(i), reduction(+ : j),
reduction(+ : q) // expected-error 2 {{argument of OpenMP
clause 'reduction' must reference the same object in all
threads}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel private(k)<br>
+#pragma omp parallel sections reduction(+ : p), reduction(+
: p) // expected-error 2 {{argument of OpenMP clause
'reduction' must reference the same object in all threads}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(+ : p), reduction(+
: p) // expected-error {{variable can appear only once in
OpenMP 'reduction' clause}} expected-note {{previously
referenced here}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel sections reduction(+ : r) //
expected-error {{const-qualified variable cannot be
reduction}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel shared(i)<br>
+#pragma omp parallel reduction(min : i)<br>
+#pragma omp parallel sections reduction(max : j) //
expected-error {{argument of OpenMP clause 'reduction' must
reference the same object in all threads}}<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel private(fl)<br>
+#pragma omp parallel sections reduction(+ : fl)<br>
+ {<br>
+ foo();<br>
+ }<br>
+#pragma omp parallel reduction(* : fl)<br>
+#pragma omp parallel sections reduction(+ : fl)<br>
+ {<br>
+ foo();<br>
+ }<br>
+<br>
+ return tmain(argc) + tmain(fl); // expected-note {{in
instantiation of function template specialization
'tmain<int>' requested here}} expected-note {{in
instantiation of function template specialization
'tmain<float>' requested here}}<br>
+}<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_reduction_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Added:
cfe/trunk/test/OpenMP/parallel_sections_shared_messages.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_shared_messages.cpp?rev=212516&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/parallel_sections_shared_messages.cpp?rev=212516&view=auto</a><br>
==============================================================================<br>
---
cfe/trunk/test/OpenMP/parallel_sections_shared_messages.cpp
(added)<br>
+++
cfe/trunk/test/OpenMP/parallel_sections_shared_messages.cpp
Tue Jul 8 03:12:03 2014<br>
@@ -0,0 +1,110 @@<br>
+// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit
100 %s<br>
+<br>
+void foo() {<br>
+}<br>
+<br>
+bool foobool(int argc) {<br>
+ return argc;<br>
+}<br>
+<br>
+struct S1; // expected-note {{declared here}}<br>
+extern S1 a;<br>
+class S2 {<br>
+ mutable int a;<br>
+<br>
+public:<br>
+ S2() : a(0) {}<br>
+ S2(S2 &s2) : a(s2.a) {}<br>
+};<br>
+const S2 b;<br>
+const S2 ba[5];<br>
+class S3 {<br>
+ int a;<br>
+<br>
+public:<br>
+ S3() : a(0) {}<br>
+ S3(S3 &s3) : a(s3.a) {}<br>
+};<br>
+const S3 c;<br>
+const S3 ca[5];<br>
+extern const int f;<br>
+class S4 {<br>
+ int a;<br>
+ S4();<br>
+ S4(const S4 &s4);<br>
+<br>
+public:<br>
+ S4(int v) : a(v) {}<br>
+};<br>
+class S5 {<br>
+ int a;<br>
+ S5() : a(0) {}<br>
+ S5(const S5 &s5) : a(s5.a) {}<br>
+<br>
+public:<br>
+ S5(int v) : a(v) {}<br>
+};<br>
+<br>
+S3 h;<br>
+#pragma omp threadprivate(h) // expected-note {{defined as
threadprivate or thread local}}<br>
+<br>
+int main(int argc, char **argv) {<br>
+ const int d = 5;<br>
+ const int da[5] = {0};<br>
+ S4 e(4);<br>
+ S5 g(5);<br>
+ int i;<br>
+ int &j = i;<br>
+#pragma omp parallel sections shared // expected-error
{{expected '(' after 'shared'}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared( // expected-error
{{expected expression}} expected-error {{expected ')'}}
expected-note {{to match this '('}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared() // expected-error
{{expected expression}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared(argc // expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared(argc, //
expected-error {{expected expression}} expected-error
{{expected ')'}} expected-note {{to match this '('}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared(argc > 0 ? argv[1]
: argv[2]) // expected-error {{expected variable name}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared(argc)<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared(S1) // expected-error
{{'S1' does not refer to a value}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared(a, b, c, d, f)<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared(argv[1]) //
expected-error {{expected variable name}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared(ba)<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared(ca)<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared(da)<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared(e, g)<br>
+ { foo(); }<br>
+#pragma omp parallel sections shared(h) // expected-error
{{threadprivate or thread local variable cannot be shared}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections private(i), shared(i) //
expected-error {{private variable cannot be shared}}
expected-note {{defined as private}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections firstprivate(i), shared(i) //
expected-error {{firstprivate variable cannot be shared}}
expected-note {{defined as firstprivate}}<br>
+ { foo(); }<br>
+#pragma omp parallel sections private(i)<br>
+ {<br>
+#pragma omp parallel sections shared(i)<br>
+ {<br>
+#pragma omp parallel sections shared(j)<br>
+ { foo(); }<br>
+ }<br>
+ }<br>
+#pragma omp parallel sections firstprivate(i)<br>
+ {<br>
+#pragma omp parallel sections shared(i)<br>
+ {<br>
+#pragma omp parallel sections shared(j)<br>
+ { foo(); }<br>
+ }<br>
+ }<br>
+<br>
+ return 0;<br>
+}<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_shared_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:eol-style</a> = native<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_shared_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:keywords</a> = Author Date Id Rev URL<br>
<br>
Propchange:
cfe/trunk/test/OpenMP/parallel_sections_shared_messages.cpp<br>
------------------------------------------------------------------------------<br>
<a>svn:mime-type</a> = text/plain<br>
<br>
Modified: cfe/trunk/tools/libclang/CIndex.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/tools/libclang/CIndex.cpp (original)<br>
+++ cfe/trunk/tools/libclang/CIndex.cpp Tue Jul 8 03:12:03
2014<br>
@@ -1861,6 +1861,7 @@ public:<br>
void VisitOMPSectionDirective(const OMPSectionDirective
*D);<br>
void VisitOMPSingleDirective(const OMPSingleDirective
*D);<br>
void VisitOMPParallelForDirective(const
OMPParallelForDirective *D);<br>
+ void VisitOMPParallelSectionsDirective(const
OMPParallelSectionsDirective *D);<br>
<br>
private:<br>
void AddDeclarationNameInfo(const Stmt *S);<br>
@@ -2317,6 +2318,11 @@
EnqueueVisitor::VisitOMPParallelForDirec<br>
VisitOMPExecutableDirective(D);<br>
}<br>
<br>
+void EnqueueVisitor::VisitOMPParallelSectionsDirective(<br>
+ const OMPParallelSectionsDirective *D) {<br>
+ VisitOMPExecutableDirective(D);<br>
+}<br>
+<br>
void CursorVisitor::EnqueueWorkList(VisitorWorkList
&WL, const Stmt *S) {<br>
EnqueueVisitor(WL, MakeCXCursor(S, StmtParent,
TU,RegionOfInterest)).Visit(S);<br>
}<br>
@@ -4003,6 +4009,8 @@ CXString
clang_getCursorKindSpelling(enu<br>
return cxstring::createRef("OMPSingleDirective");<br>
case CXCursor_OMPParallelForDirective:<br>
return cxstring::createRef("OMPParallelForDirective");<br>
+ case CXCursor_OMPParallelSectionsDirective:<br>
+ return
cxstring::createRef("OMPParallelSectionsDirective");<br>
}<br>
<br>
llvm_unreachable("Unhandled CXCursorKind");<br>
<br>
Modified: cfe/trunk/tools/libclang/CXCursor.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.cpp?rev=212516&r1=212515&r2=212516&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CXCursor.cpp?rev=212516&r1=212515&r2=212516&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/tools/libclang/CXCursor.cpp (original)<br>
+++ cfe/trunk/tools/libclang/CXCursor.cpp Tue Jul 8
03:12:03 2014<br>
@@ -538,6 +538,9 @@ CXCursor cxcursor::MakeCXCursor(const St<br>
case Stmt::OMPParallelForDirectiveClass:<br>
K = CXCursor_OMPParallelForDirective;<br>
break;<br>
+ case Stmt::OMPParallelSectionsDirectiveClass:<br>
+ K = CXCursor_OMPParallelSectionsDirective;<br>
+ break;<br>
}<br>
<br>
CXCursor C = { K, 0, { Parent, S, TU } };<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@cs.uiuc.edu" target="_blank">cfe-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</blockquote></div><br></div>