[clang] 2b939e1 - [OpenACC] Implement auto/seq/independent clause Sema for 'loop'

via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 5 10:17:28 PDT 2024


Author: erichkeane
Date: 2024-06-05T10:17:21-07:00
New Revision: 2b939e182db6251f1d54a990e080df5ac8f05c29

URL: https://github.com/llvm/llvm-project/commit/2b939e182db6251f1d54a990e080df5ac8f05c29
DIFF: https://github.com/llvm/llvm-project/commit/2b939e182db6251f1d54a990e080df5ac8f05c29.diff

LOG: [OpenACC] Implement auto/seq/independent clause Sema for 'loop'

These three clauses are all quite trivial, as they take no parameters.
They are mutually exclusive, and 'seq' has some other exclusives that
are implemented here.

The ONE thing that isn't implemented is 2.9's restriction (line 2010):
  'A loop associated with a 'loop' construct that does not have a 'seq'
   clause must be written to meet all the following conditions'.

Future clauses will require similar work, so it'll be done as a
followup.

Added: 
    clang/test/SemaOpenACC/loop-construct-auto_seq_independent-ast.cpp
    clang/test/SemaOpenACC/loop-construct-auto_seq_independent-clauses.c

Modified: 
    clang/include/clang/AST/OpenACCClause.h
    clang/include/clang/Basic/DiagnosticSemaKinds.td
    clang/include/clang/Basic/OpenACCClauses.def
    clang/lib/AST/OpenACCClause.cpp
    clang/lib/AST/StmtProfile.cpp
    clang/lib/AST/TextNodeDumper.cpp
    clang/lib/Parse/ParseOpenACC.cpp
    clang/lib/Sema/SemaOpenACC.cpp
    clang/lib/Sema/TreeTransform.h
    clang/lib/Serialization/ASTReader.cpp
    clang/lib/Serialization/ASTWriter.cpp
    clang/test/AST/ast-print-openacc-loop-construct.cpp
    clang/test/ParserOpenACC/parse-clauses.c
    clang/test/SemaOpenACC/compute-construct-default-clause.c
    clang/test/SemaOpenACC/compute-construct-default-clause.cpp
    clang/test/SemaOpenACC/compute-construct-device_type-clause.c
    clang/test/SemaOpenACC/loop-construct-device_type-clause.c
    clang/tools/libclang/CIndex.cpp

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/AST/OpenACCClause.h b/clang/include/clang/AST/OpenACCClause.h
index 28ff8c44bd256..a4c82cdad87bd 100644
--- a/clang/include/clang/AST/OpenACCClause.h
+++ b/clang/include/clang/AST/OpenACCClause.h
@@ -54,6 +54,149 @@ class OpenACCClause {
   virtual ~OpenACCClause() = default;
 };
 
+// Represents the 'auto' clause.
+class OpenACCAutoClause : public OpenACCClause {
+protected:
+  OpenACCAutoClause(SourceLocation BeginLoc, SourceLocation EndLoc)
+      : OpenACCClause(OpenACCClauseKind::Auto, BeginLoc, EndLoc) {}
+
+public:
+  static bool classof(const OpenACCClause *C) {
+    return C->getClauseKind() == OpenACCClauseKind::Auto;
+  }
+
+  static OpenACCAutoClause *
+  Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc);
+
+  child_range children() {
+    return child_range(child_iterator(), child_iterator());
+  }
+  const_child_range children() const {
+    return const_child_range(const_child_iterator(), const_child_iterator());
+  }
+};
+
+// Represents the 'independent' clause.
+class OpenACCIndependentClause : public OpenACCClause {
+protected:
+  OpenACCIndependentClause(SourceLocation BeginLoc, SourceLocation EndLoc)
+      : OpenACCClause(OpenACCClauseKind::Independent, BeginLoc, EndLoc) {}
+
+public:
+  static bool classof(const OpenACCClause *C) {
+    return C->getClauseKind() == OpenACCClauseKind::Independent;
+  }
+
+  static OpenACCIndependentClause *
+  Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc);
+
+  child_range children() {
+    return child_range(child_iterator(), child_iterator());
+  }
+  const_child_range children() const {
+    return const_child_range(const_child_iterator(), const_child_iterator());
+  }
+};
+// Represents the 'seq' clause.
+class OpenACCSeqClause : public OpenACCClause {
+protected:
+  OpenACCSeqClause(SourceLocation BeginLoc, SourceLocation EndLoc)
+      : OpenACCClause(OpenACCClauseKind::Seq, BeginLoc, EndLoc) {}
+
+public:
+  static bool classof(const OpenACCClause *C) {
+    return C->getClauseKind() == OpenACCClauseKind::Seq;
+  }
+
+  static OpenACCSeqClause *
+  Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc);
+
+  child_range children() {
+    return child_range(child_iterator(), child_iterator());
+  }
+  const_child_range children() const {
+    return const_child_range(const_child_iterator(), const_child_iterator());
+  }
+};
+
+// Not yet implemented, but the type name is necessary for 'seq' diagnostics, so
+// this provides a basic, do-nothing implementation. We still need to add this
+// type to the visitors/etc, as well as get it to take its proper arguments.
+class OpenACCGangClause : public OpenACCClause {
+protected:
+  OpenACCGangClause(SourceLocation BeginLoc, SourceLocation EndLoc)
+      : OpenACCClause(OpenACCClauseKind::Gang, BeginLoc, EndLoc) {
+    llvm_unreachable("Not yet implemented");
+  }
+
+public:
+  static bool classof(const OpenACCClause *C) {
+    return C->getClauseKind() == OpenACCClauseKind::Gang;
+  }
+
+  static OpenACCGangClause *
+  Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc);
+
+  child_range children() {
+    return child_range(child_iterator(), child_iterator());
+  }
+  const_child_range children() const {
+    return const_child_range(const_child_iterator(), const_child_iterator());
+  }
+};
+
+// Not yet implemented, but the type name is necessary for 'seq' diagnostics, so
+// this provides a basic, do-nothing implementation. We still need to add this
+// type to the visitors/etc, as well as get it to take its proper arguments.
+class OpenACCVectorClause : public OpenACCClause {
+protected:
+  OpenACCVectorClause(SourceLocation BeginLoc, SourceLocation EndLoc)
+      : OpenACCClause(OpenACCClauseKind::Vector, BeginLoc, EndLoc) {
+    llvm_unreachable("Not yet implemented");
+  }
+
+public:
+  static bool classof(const OpenACCClause *C) {
+    return C->getClauseKind() == OpenACCClauseKind::Gang;
+  }
+
+  static OpenACCVectorClause *
+  Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc);
+
+  child_range children() {
+    return child_range(child_iterator(), child_iterator());
+  }
+  const_child_range children() const {
+    return const_child_range(const_child_iterator(), const_child_iterator());
+  }
+};
+
+// Not yet implemented, but the type name is necessary for 'seq' diagnostics, so
+// this provides a basic, do-nothing implementation. We still need to add this
+// type to the visitors/etc, as well as get it to take its proper arguments.
+class OpenACCWorkerClause : public OpenACCClause {
+protected:
+  OpenACCWorkerClause(SourceLocation BeginLoc, SourceLocation EndLoc)
+      : OpenACCClause(OpenACCClauseKind::Gang, BeginLoc, EndLoc) {
+    llvm_unreachable("Not yet implemented");
+  }
+
+public:
+  static bool classof(const OpenACCClause *C) {
+    return C->getClauseKind() == OpenACCClauseKind::Gang;
+  }
+
+  static OpenACCWorkerClause *
+  Create(const ASTContext &Ctx, SourceLocation BeginLoc, SourceLocation EndLoc);
+
+  child_range children() {
+    return child_range(child_iterator(), child_iterator());
+  }
+  const_child_range children() const {
+    return const_child_range(const_child_iterator(), const_child_iterator());
+  }
+};
+
 /// Represents a clause that has a list of parameters.
 class OpenACCClauseWithParams : public OpenACCClause {
   /// Location of the '('.

diff  --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td
index 1a117245a325e..87745140cb0eb 100644
--- a/clang/include/clang/Basic/DiagnosticSemaKinds.td
+++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td
@@ -12399,6 +12399,9 @@ def note_acc_expected_pointer_var : Note<"expected variable of pointer type">;
 def err_acc_clause_after_device_type
     : Error<"OpenACC clause '%0' may not follow a '%1' clause in a "
             "%select{'%3'|compute}2 construct">;
+def err_acc_clause_cannot_combine
+    : Error<"OpenACC clause '%0' may not appear on the same construct as a "
+            "'%1' clause on a 'loop' construct">;
 def err_acc_reduction_num_gangs_conflict
     : Error<
           "OpenACC 'reduction' clause may not appear on a 'parallel' construct "
@@ -12416,6 +12419,9 @@ def note_acc_reduction_composite_member_loc : Note<"invalid field is here">;
 def err_acc_loop_not_for_loop
     : Error<"OpenACC 'loop' construct can only be applied to a 'for' loop">;
 def note_acc_construct_here : Note<"'%0' construct is here">;
+def err_acc_loop_spec_conflict
+    : Error<"OpenACC clause '%0' on '%1' construct conflicts with previous "
+            "data dependence clause">;
 
 // AMDGCN builtins diagnostics
 def err_amdgcn_global_load_lds_size_invalid_value : Error<"invalid size value">;

diff  --git a/clang/include/clang/Basic/OpenACCClauses.def b/clang/include/clang/Basic/OpenACCClauses.def
index 3e464abaafd92..53f4cd103d142 100644
--- a/clang/include/clang/Basic/OpenACCClauses.def
+++ b/clang/include/clang/Basic/OpenACCClauses.def
@@ -21,6 +21,7 @@
 #define CLAUSE_ALIAS(ALIAS_NAME, CLAUSE_NAME)
 #endif
 
+VISIT_CLAUSE(Auto)
 VISIT_CLAUSE(Async)
 VISIT_CLAUSE(Attach)
 VISIT_CLAUSE(Copy)
@@ -41,6 +42,7 @@ VISIT_CLAUSE(DeviceType)
 CLAUSE_ALIAS(DType, DeviceType)
 VISIT_CLAUSE(FirstPrivate)
 VISIT_CLAUSE(If)
+VISIT_CLAUSE(Independent)
 VISIT_CLAUSE(NoCreate)
 VISIT_CLAUSE(NumGangs)
 VISIT_CLAUSE(NumWorkers)
@@ -48,6 +50,7 @@ VISIT_CLAUSE(Present)
 VISIT_CLAUSE(Private)
 VISIT_CLAUSE(Reduction)
 VISIT_CLAUSE(Self)
+VISIT_CLAUSE(Seq)
 VISIT_CLAUSE(VectorLength)
 VISIT_CLAUSE(Wait)
 

diff  --git a/clang/lib/AST/OpenACCClause.cpp b/clang/lib/AST/OpenACCClause.cpp
index cb2c7f98be75c..403ce9a221571 100644
--- a/clang/lib/AST/OpenACCClause.cpp
+++ b/clang/lib/AST/OpenACCClause.cpp
@@ -320,6 +320,48 @@ OpenACCReductionClause *OpenACCReductionClause::Create(
       OpenACCReductionClause(BeginLoc, LParenLoc, Operator, VarList, EndLoc);
 }
 
+OpenACCAutoClause *OpenACCAutoClause::Create(const ASTContext &C,
+                                             SourceLocation BeginLoc,
+                                             SourceLocation EndLoc) {
+  void *Mem = C.Allocate(sizeof(OpenACCAutoClause));
+  return new (Mem) OpenACCAutoClause(BeginLoc, EndLoc);
+}
+
+OpenACCIndependentClause *
+OpenACCIndependentClause::Create(const ASTContext &C, SourceLocation BeginLoc,
+                                 SourceLocation EndLoc) {
+  void *Mem = C.Allocate(sizeof(OpenACCIndependentClause));
+  return new (Mem) OpenACCIndependentClause(BeginLoc, EndLoc);
+}
+
+OpenACCSeqClause *OpenACCSeqClause::Create(const ASTContext &C,
+                                           SourceLocation BeginLoc,
+                                           SourceLocation EndLoc) {
+  void *Mem = C.Allocate(sizeof(OpenACCSeqClause));
+  return new (Mem) OpenACCSeqClause(BeginLoc, EndLoc);
+}
+
+OpenACCGangClause *OpenACCGangClause::Create(const ASTContext &C,
+                                             SourceLocation BeginLoc,
+                                             SourceLocation EndLoc) {
+  void *Mem = C.Allocate(sizeof(OpenACCGangClause));
+  return new (Mem) OpenACCGangClause(BeginLoc, EndLoc);
+}
+
+OpenACCWorkerClause *OpenACCWorkerClause::Create(const ASTContext &C,
+                                                 SourceLocation BeginLoc,
+                                                 SourceLocation EndLoc) {
+  void *Mem = C.Allocate(sizeof(OpenACCWorkerClause));
+  return new (Mem) OpenACCWorkerClause(BeginLoc, EndLoc);
+}
+
+OpenACCVectorClause *OpenACCVectorClause::Create(const ASTContext &C,
+                                                 SourceLocation BeginLoc,
+                                                 SourceLocation EndLoc) {
+  void *Mem = C.Allocate(sizeof(OpenACCVectorClause));
+  return new (Mem) OpenACCVectorClause(BeginLoc, EndLoc);
+}
+
 //===----------------------------------------------------------------------===//
 //  OpenACC clauses printing methods
 //===----------------------------------------------------------------------===//
@@ -495,3 +537,16 @@ void OpenACCClausePrinter::VisitDeviceTypeClause(
                         });
   OS << ")";
 }
+
+void OpenACCClausePrinter::VisitAutoClause(const OpenACCAutoClause &C) {
+  OS << "auto";
+}
+
+void OpenACCClausePrinter::VisitIndependentClause(
+    const OpenACCIndependentClause &C) {
+  OS << "independent";
+}
+
+void OpenACCClausePrinter::VisitSeqClause(const OpenACCSeqClause &C) {
+  OS << "seq";
+}

diff  --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp
index 6d9a76120cfef..d1655905a6656 100644
--- a/clang/lib/AST/StmtProfile.cpp
+++ b/clang/lib/AST/StmtProfile.cpp
@@ -2589,6 +2589,13 @@ void OpenACCClauseProfiler::VisitWaitClause(const OpenACCWaitClause &Clause) {
 void OpenACCClauseProfiler::VisitDeviceTypeClause(
     const OpenACCDeviceTypeClause &Clause) {}
 
+void OpenACCClauseProfiler::VisitAutoClause(const OpenACCAutoClause &Clause) {}
+
+void OpenACCClauseProfiler::VisitIndependentClause(
+    const OpenACCIndependentClause &Clause) {}
+
+void OpenACCClauseProfiler::VisitSeqClause(const OpenACCSeqClause &Clause) {}
+
 void OpenACCClauseProfiler::VisitReductionClause(
     const OpenACCReductionClause &Clause) {
   for (auto *E : Clause.getVarList())

diff  --git a/clang/lib/AST/TextNodeDumper.cpp b/clang/lib/AST/TextNodeDumper.cpp
index b2bf259ec24ee..8bacceea0f22b 100644
--- a/clang/lib/AST/TextNodeDumper.cpp
+++ b/clang/lib/AST/TextNodeDumper.cpp
@@ -398,11 +398,13 @@ void TextNodeDumper::Visit(const OpenACCClause *C) {
       OS << '(' << cast<OpenACCDefaultClause>(C)->getDefaultClauseKind() << ')';
       break;
     case OpenACCClauseKind::Async:
+    case OpenACCClauseKind::Auto:
     case OpenACCClauseKind::Attach:
     case OpenACCClauseKind::Copy:
     case OpenACCClauseKind::PCopy:
     case OpenACCClauseKind::PresentOrCopy:
     case OpenACCClauseKind::If:
+    case OpenACCClauseKind::Independent:
     case OpenACCClauseKind::DevicePtr:
     case OpenACCClauseKind::FirstPrivate:
     case OpenACCClauseKind::NoCreate:
@@ -411,6 +413,7 @@ void TextNodeDumper::Visit(const OpenACCClause *C) {
     case OpenACCClauseKind::Present:
     case OpenACCClauseKind::Private:
     case OpenACCClauseKind::Self:
+    case OpenACCClauseKind::Seq:
     case OpenACCClauseKind::VectorLength:
       // The condition expression will be printed as a part of the 'children',
       // but print 'clause' here so it is clear what is happening from the dump.

diff  --git a/clang/lib/Parse/ParseOpenACC.cpp b/clang/lib/Parse/ParseOpenACC.cpp
index c7b6763b4dbdd..0261e8ea3c9b7 100644
--- a/clang/lib/Parse/ParseOpenACC.cpp
+++ b/clang/lib/Parse/ParseOpenACC.cpp
@@ -1132,6 +1132,8 @@ Parser::OpenACCClauseParseResult Parser::ParseOpenACCClauseParams(
       // clause, as we are a 'single token' clause.
       ParsedClause.setEndLoc(ClauseLoc);
     }
+  } else {
+    ParsedClause.setEndLoc(ClauseLoc);
   }
   return OpenACCSuccess(
       Actions.OpenACC().ActOnClause(ExistingClauses, ParsedClause));

diff  --git a/clang/lib/Sema/SemaOpenACC.cpp b/clang/lib/Sema/SemaOpenACC.cpp
index 1f99543248f27..cdb60d4d36397 100644
--- a/clang/lib/Sema/SemaOpenACC.cpp
+++ b/clang/lib/Sema/SemaOpenACC.cpp
@@ -285,6 +285,30 @@ bool doesClauseApplyToDirective(OpenACCDirectiveKind DirectiveKind,
       return false;
     }
 
+  case OpenACCClauseKind::Seq:
+    switch (DirectiveKind) {
+    case OpenACCDirectiveKind::Loop:
+    case OpenACCDirectiveKind::Routine:
+    case OpenACCDirectiveKind::ParallelLoop:
+    case OpenACCDirectiveKind::SerialLoop:
+    case OpenACCDirectiveKind::KernelsLoop:
+      return true;
+    default:
+      return false;
+    }
+
+  case OpenACCClauseKind::Independent:
+  case OpenACCClauseKind::Auto:
+    switch (DirectiveKind) {
+    case OpenACCDirectiveKind::Loop:
+    case OpenACCDirectiveKind::ParallelLoop:
+    case OpenACCDirectiveKind::SerialLoop:
+    case OpenACCDirectiveKind::KernelsLoop:
+      return true;
+    default:
+      return false;
+    }
+
   case OpenACCClauseKind::Reduction:
     switch (DirectiveKind) {
     case OpenACCDirectiveKind::Parallel:
@@ -866,6 +890,102 @@ SemaOpenACC::ActOnClause(ArrayRef<const OpenACCClause *> ExistingClauses,
         Clause.getLParenLoc(), Clause.getDeviceTypeArchitectures(),
         Clause.getEndLoc());
   }
+  case OpenACCClauseKind::Auto: {
+    // Restrictions only properly implemented on 'loop' constructs, and it is
+    // the only construct that can do anything with this, so skip/treat as
+    // unimplemented for the combined constructs.
+    if (Clause.getDirectiveKind() != OpenACCDirectiveKind::Loop)
+      break;
+
+    // OpenACC 3.3 2.9:
+    // Only one of the seq, independent, and auto clauses may appear.
+    const auto *Itr = llvm::find_if(
+        ExistingClauses,
+        llvm::IsaPred<OpenACCIndependentClause, OpenACCSeqClause>);
+    if (Itr != ExistingClauses.end()) {
+      Diag(Clause.getBeginLoc(), diag::err_acc_loop_spec_conflict)
+          << Clause.getClauseKind() << Clause.getDirectiveKind();
+      Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
+    }
+
+    return OpenACCAutoClause::Create(getASTContext(), Clause.getBeginLoc(),
+                                     Clause.getEndLoc());
+  }
+  case OpenACCClauseKind::Independent: {
+    // Restrictions only properly implemented on 'loop' constructs, and it is
+    // the only construct that can do anything with this, so skip/treat as
+    // unimplemented for the combined constructs.
+    if (Clause.getDirectiveKind() != OpenACCDirectiveKind::Loop)
+      break;
+
+    // OpenACC 3.3 2.9:
+    // Only one of the seq, independent, and auto clauses may appear.
+    const auto *Itr = llvm::find_if(
+        ExistingClauses, llvm::IsaPred<OpenACCAutoClause, OpenACCSeqClause>);
+    if (Itr != ExistingClauses.end()) {
+      Diag(Clause.getBeginLoc(), diag::err_acc_loop_spec_conflict)
+          << Clause.getClauseKind() << Clause.getDirectiveKind();
+      Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
+    }
+
+    return OpenACCIndependentClause::Create(
+        getASTContext(), Clause.getBeginLoc(), Clause.getEndLoc());
+  }
+  case OpenACCClauseKind::Seq: {
+    // Restrictions only properly implemented on 'loop' constructs, and it is
+    // the only construct that can do anything with this, so skip/treat as
+    // unimplemented for the combined constructs.
+    if (Clause.getDirectiveKind() != OpenACCDirectiveKind::Loop)
+      break;
+
+    // OpenACC 3.3 2.9:
+    // Only one of the seq, independent, and auto clauses may appear.
+    const auto *Itr = llvm::find_if(
+        ExistingClauses,
+        llvm::IsaPred<OpenACCAutoClause, OpenACCIndependentClause>);
+    if (Itr != ExistingClauses.end()) {
+      Diag(Clause.getBeginLoc(), diag::err_acc_loop_spec_conflict)
+          << Clause.getClauseKind() << Clause.getDirectiveKind();
+      Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
+    }
+
+    // OpenACC 3.3 2.9:
+    // A 'gang', 'worker', or 'vector' clause may not appear if a 'seq' clause
+    // appears.
+    Itr = llvm::find_if(ExistingClauses,
+                        llvm::IsaPred<OpenACCGangClause, OpenACCWorkerClause,
+                                      OpenACCVectorClause>);
+
+    if (Itr != ExistingClauses.end()) {
+      Diag(Clause.getBeginLoc(), diag::err_acc_clause_cannot_combine)
+          << Clause.getClauseKind() << (*Itr)->getClauseKind();
+      Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
+    }
+
+    // TODO OpenACC: 2.9 ~ line 2010 specifies that the associated loop has some
+    // restrictions when there is a 'seq' clause in place. We probably need to
+    // implement that.
+    return OpenACCSeqClause::Create(getASTContext(), Clause.getBeginLoc(),
+                                    Clause.getEndLoc());
+  }
+  case OpenACCClauseKind::Gang:
+  case OpenACCClauseKind::Worker:
+  case OpenACCClauseKind::Vector: {
+    // OpenACC 3.3 2.9:
+    // A 'gang', 'worker', or 'vector' clause may not appear if a 'seq' clause
+    // appears.
+    const auto *Itr =
+        llvm::find_if(ExistingClauses, llvm::IsaPred<OpenACCSeqClause>);
+
+    if (Itr != ExistingClauses.end()) {
+      Diag(Clause.getBeginLoc(), diag::err_acc_clause_cannot_combine)
+          << Clause.getClauseKind() << (*Itr)->getClauseKind();
+      Diag((*Itr)->getBeginLoc(), diag::note_acc_previous_clause_here);
+    }
+    // Not yet implemented, so immediately drop to the 'not yet implemented'
+    // diagnostic.
+    break;
+  }
   case OpenACCClauseKind::Reduction: {
     // Restrictions only properly implemented on 'compute' constructs, and
     // 'compute' constructs are the only construct that can do anything with
@@ -1461,6 +1581,9 @@ StmtResult SemaOpenACC::ActOnAssociatedStmt(SourceLocation DirectiveLoc,
       Diag(DirectiveLoc, diag::note_acc_construct_here) << K;
       return StmtError();
     }
+    // TODO OpenACC: 2.9 ~ line 2010 specifies that the associated loop has some
+    // restrictions when there is a 'seq' clause in place. We probably need to
+    // implement that, including piping in the clauses here.
     return AssocStmt;
   }
   llvm_unreachable("Invalid associated statement application");

diff  --git a/clang/lib/Sema/TreeTransform.h b/clang/lib/Sema/TreeTransform.h
index 07f995edaf3d4..95dd356d48bed 100644
--- a/clang/lib/Sema/TreeTransform.h
+++ b/clang/lib/Sema/TreeTransform.h
@@ -11496,6 +11496,31 @@ void OpenACCClauseTransform<Derived>::VisitDeviceTypeClause(
       C.getArchitectures(), ParsedClause.getEndLoc());
 }
 
+template <typename Derived>
+void OpenACCClauseTransform<Derived>::VisitAutoClause(
+    const OpenACCAutoClause &C) {
+  // Nothing to do, so just create a new node.
+  NewClause = OpenACCAutoClause::Create(Self.getSema().getASTContext(),
+                                        ParsedClause.getBeginLoc(),
+                                        ParsedClause.getEndLoc());
+}
+
+template <typename Derived>
+void OpenACCClauseTransform<Derived>::VisitIndependentClause(
+    const OpenACCIndependentClause &C) {
+  NewClause = OpenACCIndependentClause::Create(Self.getSema().getASTContext(),
+                                               ParsedClause.getBeginLoc(),
+                                               ParsedClause.getEndLoc());
+}
+
+template <typename Derived>
+void OpenACCClauseTransform<Derived>::VisitSeqClause(
+    const OpenACCSeqClause &C) {
+  NewClause = OpenACCSeqClause::Create(Self.getSema().getASTContext(),
+                                       ParsedClause.getBeginLoc(),
+                                       ParsedClause.getEndLoc());
+}
+
 template <typename Derived>
 void OpenACCClauseTransform<Derived>::VisitReductionClause(
     const OpenACCReductionClause &C) {

diff  --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 2bc00e1bb3e38..33cea32c3be61 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -11944,12 +11944,15 @@ OpenACCClause *ASTRecordReader::readOpenACCClause() {
     return OpenACCReductionClause::Create(getContext(), BeginLoc, LParenLoc, Op,
                                           VarList, EndLoc);
   }
-
-  case OpenACCClauseKind::Finalize:
-  case OpenACCClauseKind::IfPresent:
   case OpenACCClauseKind::Seq:
+    return OpenACCSeqClause::Create(getContext(), BeginLoc, EndLoc);
   case OpenACCClauseKind::Independent:
+    return OpenACCIndependentClause::Create(getContext(), BeginLoc, EndLoc);
   case OpenACCClauseKind::Auto:
+    return OpenACCAutoClause::Create(getContext(), BeginLoc, EndLoc);
+
+  case OpenACCClauseKind::Finalize:
+  case OpenACCClauseKind::IfPresent:
   case OpenACCClauseKind::Worker:
   case OpenACCClauseKind::Vector:
   case OpenACCClauseKind::NoHost:

diff  --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index d18dbad983d75..953990a4aca6d 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -7975,12 +7975,15 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) {
     writeOpenACCVarList(RC);
     return;
   }
-
-  case OpenACCClauseKind::Finalize:
-  case OpenACCClauseKind::IfPresent:
   case OpenACCClauseKind::Seq:
   case OpenACCClauseKind::Independent:
   case OpenACCClauseKind::Auto:
+    // Nothing to do here, there is no additional information beyond the
+    // begin/end loc and clause kind.
+    return;
+
+  case OpenACCClauseKind::Finalize:
+  case OpenACCClauseKind::IfPresent:
   case OpenACCClauseKind::Worker:
   case OpenACCClauseKind::Vector:
   case OpenACCClauseKind::NoHost:

diff  --git a/clang/test/AST/ast-print-openacc-loop-construct.cpp b/clang/test/AST/ast-print-openacc-loop-construct.cpp
index f6d7b54251db0..519825b89e328 100644
--- a/clang/test/AST/ast-print-openacc-loop-construct.cpp
+++ b/clang/test/AST/ast-print-openacc-loop-construct.cpp
@@ -32,4 +32,20 @@ void foo() {
 // CHECK-NEXT: ;
 #pragma acc loop dtype(AnotherIdent)
   for(;;);
+
+// CHECK: #pragma acc loop independent
+// CHECK-NEXT: for (;;)
+// CHECK-NEXT: ;
+#pragma acc loop independent
+  for(;;);
+// CHECK: #pragma acc loop seq
+// CHECK-NEXT: for (;;)
+// CHECK-NEXT: ;
+#pragma acc loop seq
+  for(;;);
+// CHECK: #pragma acc loop auto
+// CHECK-NEXT: for (;;)
+// CHECK-NEXT: ;
+#pragma acc loop auto
+  for(;;);
 }

diff  --git a/clang/test/ParserOpenACC/parse-clauses.c b/clang/test/ParserOpenACC/parse-clauses.c
index cb118f69fb447..15c4554a31922 100644
--- a/clang/test/ParserOpenACC/parse-clauses.c
+++ b/clang/test/ParserOpenACC/parse-clauses.c
@@ -23,10 +23,10 @@ void func() {
   // expected-warning at +1{{OpenACC construct 'enter data' not yet implemented, pragma ignored}}
 #pragma acc enter data finalize invalid invalid finalize
 
-  // expected-warning at +3{{OpenACC clause 'seq' not yet implemented, clause ignored}}
+  // expected-warning at +3{{OpenACC clause 'wait' not yet implemented, clause ignored}}
   // expected-warning at +2{{OpenACC clause 'finalize' not yet implemented, clause ignored}}
   // expected-warning at +1{{OpenACC construct 'enter data' not yet implemented, pragma ignored}}
-#pragma acc enter data seq finalize
+#pragma acc enter data wait finalize
 
   // expected-warning at +2{{OpenACC clause 'if_present' not yet implemented, clause ignored}}
   // expected-warning at +1{{OpenACC construct 'host_data' not yet implemented, pragma ignored}}
@@ -37,21 +37,24 @@ void func() {
   // expected-warning at +1{{OpenACC construct 'host_data' not yet implemented, pragma ignored}}
 #pragma acc host_data if_present, if_present
 
-  // expected-warning at +3{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-  // expected-warning at +2{{OpenACC clause 'independent' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'auto' not yet implemented, clause ignored}}
+  // expected-error at +4{{OpenACC clause 'independent' on 'loop' construct conflicts with previous data dependence clause}}
+  // expected-note at +3{{previous clause is here}}
+  // expected-error at +2{{OpenACC clause 'auto' on 'loop' construct conflicts with previous data dependence clause}}
+  // expected-note at +1{{previous clause is here}}
 #pragma acc loop seq independent auto
   for(;;){}
 
-  // expected-warning at +3{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-  // expected-warning at +2{{OpenACC clause 'independent' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'auto' not yet implemented, clause ignored}}
+  // expected-error at +4{{OpenACC clause 'independent' on 'loop' construct conflicts with previous data dependence clause}}
+  // expected-note at +3{{previous clause is here}}
+  // expected-error at +2{{OpenACC clause 'auto' on 'loop' construct conflicts with previous data dependence clause}}
+  // expected-note at +1{{previous clause is here}}
 #pragma acc loop seq, independent auto
   for(;;){}
 
-  // expected-warning at +3{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-  // expected-warning at +2{{OpenACC clause 'independent' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'auto' not yet implemented, clause ignored}}
+  // expected-error at +4{{OpenACC clause 'independent' on 'loop' construct conflicts with previous data dependence clause}}
+  // expected-note at +3{{previous clause is here}}
+  // expected-error at +2{{OpenACC clause 'auto' on 'loop' construct conflicts with previous data dependence clause}}
+  // expected-note at +1{{previous clause is here}}
 #pragma acc loop seq independent, auto
   for(;;){}
 
@@ -81,8 +84,7 @@ void func() {
 #pragma acc loop , seq
   for(;;){}
 
-  // expected-error at +2{{expected identifier}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
+  // expected-error at +1{{expected identifier}}
 #pragma acc loop seq,
   for(;;){}
 
@@ -129,12 +131,11 @@ void DefaultClause() {
   for(;;){}
 
   // expected-error at +1{{expected '('}}
-#pragma acc serial default seq
+#pragma acc serial default self
   for(;;){}
 
-  // expected-error at +2{{expected '('}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial default, seq
+  // expected-error at +1{{expected '('}}
+#pragma acc serial default, self
   for(;;){}
 
   // expected-error at +3{{expected identifier}}
@@ -146,13 +147,13 @@ void DefaultClause() {
   // expected-error at +3{{invalid value for 'default' clause; expected 'present' or 'none'}}
   // expected-error at +2{{expected ')'}}
   // expected-note at +1{{to match this '('}}
-#pragma acc serial default( seq
+#pragma acc serial default( self
   for(;;){}
 
   // expected-error at +3{{expected identifier}}
   // expected-error at +2{{expected ')'}}
   // expected-note at +1{{to match this '('}}
-#pragma acc serial default(, seq
+#pragma acc serial default(, self
   for(;;){}
 
   // expected-error at +2{{expected '('}}
@@ -162,58 +163,53 @@ void DefaultClause() {
 
   // expected-error at +2{{expected '('}}
   // expected-error at +1{{expected identifier}}
-#pragma acc serial default), seq
+#pragma acc serial default), self
   for(;;){}
 
   // expected-error at +1{{expected identifier}}
 #pragma acc serial default()
   for(;;){}
 
-  // expected-error at +2{{expected identifier}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial default() seq
+  // expected-error at +1{{expected identifier}}
+#pragma acc serial default() self
   for(;;){}
 
-  // expected-error at +2{{expected identifier}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial default(), seq
+  // expected-error at +1{{expected identifier}}
+#pragma acc serial default(), self
   for(;;){}
 
   // expected-error at +1{{invalid value for 'default' clause; expected 'present' or 'none'}}
 #pragma acc serial default(invalid)
   for(;;){}
 
-  // expected-error at +2{{invalid value for 'default' clause; expected 'present' or 'none'}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial default(auto) seq
+  // expected-error at +1{{invalid value for 'default' clause; expected 'present' or 'none'}}
+#pragma acc serial default(auto) self
   for(;;){}
 
-  // expected-error at +2{{invalid value for 'default' clause; expected 'present' or 'none'}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial default(invalid), seq
+  // expected-error at +1{{invalid value for 'default' clause; expected 'present' or 'none'}}
+#pragma acc serial default(invalid), self
   for(;;){}
 
 #pragma acc serial default(none)
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial default(present), seq
+#pragma acc serial default(present), self
   for(;;){}
 }
 
 void IfClause() {
+  int i, j;
   // expected-error at +2{{expected '('}}
   // expected-warning at +1{{OpenACC construct 'serial loop' not yet implemented, pragma ignored}}
 #pragma acc serial loop if
   for(;;){}
 
   // expected-error at +1{{expected '('}}
-#pragma acc serial if seq
+#pragma acc serial if private(i)
   for(;;){}
 
-  // expected-error at +2{{expected '('}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial if, seq
+  // expected-error at +1{{expected '('}}
+#pragma acc serial if, private(i)
   for(;;){}
 
   // expected-error at +3{{expected expression}}
@@ -222,17 +218,17 @@ void IfClause() {
 #pragma acc serial if(
   for(;;){}
 
-  // expected-error at +3{{use of undeclared identifier 'seq'}}
+  // expected-error at +3{{use of undeclared identifier 'self'}}
   // expected-error at +2{{expected ')'}}
   // expected-note at +1{{to match this '('}}
-#pragma acc serial if( seq
+#pragma acc serial if( self
   for(;;){}
 
   // expected-error at +4{{expected expression}}
-  // expected-error at +3{{use of undeclared identifier 'seq'}}
+  // expected-error at +3{{use of undeclared identifier 'self'}}
   // expected-error at +2{{expected ')'}}
   // expected-note at +1{{to match this '('}}
-#pragma acc serial if(, seq
+#pragma acc serial if(, self
   for(;;){}
 
   // expected-error at +2{{expected '('}}
@@ -242,44 +238,38 @@ void IfClause() {
 
   // expected-error at +2{{expected '('}}
   // expected-error at +1{{expected identifier}}
-#pragma acc serial if) seq
+#pragma acc serial if) private(i)
   for(;;){}
 
   // expected-error at +2{{expected '('}}
   // expected-error at +1{{expected identifier}}
-#pragma acc serial if), seq
+#pragma acc serial if), private(i)
   for(;;){}
 
   // expected-error at +1{{expected expression}}
 #pragma acc serial if()
   for(;;){}
 
-  // expected-error at +2{{expected expression}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial if() seq
+  // expected-error at +1{{expected expression}}
+#pragma acc serial if() private(i)
   for(;;){}
 
-  // expected-error at +2{{expected expression}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial if(), seq
+  // expected-error at +1{{expected expression}}
+#pragma acc serial if(), private(i)
   for(;;){}
 
   // expected-error at +1{{use of undeclared identifier 'invalid_expr'}}
 #pragma acc serial if(invalid_expr)
   for(;;){}
 
-  // expected-error at +2{{expected expression}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial if() seq
+  // expected-error at +1{{expected expression}}
+#pragma acc serial if() private(i)
   for(;;){}
 
-  int i, j;
-
 #pragma acc serial if(i > j)
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial if(1+5>3), seq
+#pragma acc serial if(1+5>3), private(i)
   for(;;){}
 }
 
@@ -290,8 +280,8 @@ void SelfClause() {
   for(;;){}
 
   // expected-warning at +3{{OpenACC clause 'self' not yet implemented, clause ignored}}
-  // expected-warning at +2{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC construct 'serial loop' not yet implemented, pragma ignored}}
+  // expected-warning at +2{{OpenACC construct 'serial loop' not yet implemented, pragma ignored}}
+  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
 #pragma acc serial loop self, seq
   for(;;){}
 
@@ -337,21 +327,21 @@ void SelfClause() {
 
 
   // expected-error at +3{{expected expression}}
-  // expected-warning at +2{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC construct 'serial loop' not yet implemented, pragma ignored}}
+  // expected-warning at +2{{OpenACC construct 'serial loop' not yet implemented, pragma ignored}}
+  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
 #pragma acc serial loop self(), seq
   for(;;){}
 
   // expected-error at +4{{expected expression}}
   // expected-error at +3{{expected expression}}
-  // expected-warning at +2{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC construct 'serial loop' not yet implemented, pragma ignored}}
+  // expected-warning at +2{{OpenACC construct 'serial loop' not yet implemented, pragma ignored}}
+  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
 #pragma acc serial loop self(,), seq
   for(;;){}
 
   // expected-error at +3{{use of undeclared identifier 'invalid_expr'}}
-  // expected-warning at +2{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC construct 'serial loop' not yet implemented, pragma ignored}}
+  // expected-warning at +2{{OpenACC construct 'serial loop' not yet implemented, pragma ignored}}
+  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
 #pragma acc serial loop self(invalid_expr), seq
   for(;;){}
 
@@ -375,8 +365,7 @@ void SelfClause() {
 #pragma acc serial self(i > j)
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial self(1+5>3), seq
+#pragma acc serial self(1+5>3), private(i)
   for(;;){}
 }
 
@@ -401,15 +390,15 @@ void SelfUpdate() {
   // expected-error at +5{{expected ','}}
   // expected-error at +4{{expected expression}}
   // expected-warning at +3{{OpenACC clause 'self' not yet implemented, clause ignored}}
-  // expected-warning at +2{{OpenACC clause 'seq' not yet implemented, clause ignored}}
+  // expected-warning at +2{{OpenACC clause 'if_present' not yet implemented, clause ignored}}
   // expected-warning at +1{{OpenACC construct 'update' not yet implemented, pragma ignored}}
-#pragma acc update self(zero : s.array[s.value : 5], s.value), seq
+#pragma acc update self(zero : s.array[s.value : 5], s.value), if_present
   for(;;){}
 
   // expected-warning at +3{{OpenACC clause 'self' not yet implemented, clause ignored}}
-  // expected-warning at +2{{OpenACC clause 'seq' not yet implemented, clause ignored}}
+  // expected-warning at +2{{OpenACC clause 'if_present' not yet implemented, clause ignored}}
   // expected-warning at +1{{OpenACC construct 'update' not yet implemented, pragma ignored}}
-#pragma acc update self(s.array[s.value : 5], s.value), seq
+#pragma acc update self(s.array[s.value : 5], s.value), if_present
   for(;;){}
 }
 
@@ -418,9 +407,8 @@ void VarListClauses() {
 #pragma acc serial copy
   for(;;){}
 
-  // expected-error at +2{{expected '('}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copy, seq
+  // expected-error at +1{{expected '('}}
+#pragma acc serial copy, self
   for(;;){}
 
   // expected-error at +2{{expected '('}}
@@ -430,7 +418,7 @@ void VarListClauses() {
 
   // expected-error at +2{{expected '('}}
   // expected-error at +1{{expected identifier}}
-#pragma acc serial copy), seq
+#pragma acc serial copy), self
   for(;;){}
 
   // expected-error at +3{{expected expression}}
@@ -442,65 +430,54 @@ void VarListClauses() {
   // expected-error at +3{{expected expression}}
   // expected-error at +2{{expected ')'}}
   // expected-note at +1{{to match this '('}}
-#pragma acc serial copy(, seq
+#pragma acc serial copy(, self
   for(;;){}
 
   // expected-error at +1{{expected expression}}
 #pragma acc serial copy()
   for(;;){}
 
-  // expected-error at +2{{expected expression}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copy(), seq
+  // expected-error at +1{{expected expression}}
+#pragma acc serial copy(), self
   for(;;){}
 
   struct Members s;
   struct HasMembersArray HasMem;
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copy(s.array[s.value]), seq
+#pragma acc serial copy(s.array[s.value]), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copy(s.array[s.value], s.array[s.value :5] ), seq
+#pragma acc serial copy(s.array[s.value], s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copy(HasMem.MemArr[3].array[1]), seq
+#pragma acc serial copy(HasMem.MemArr[3].array[1]), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copy(HasMem.MemArr[3].array[1:4]), seq
+#pragma acc serial copy(HasMem.MemArr[3].array[1:4]), self
   for(;;){}
 
-  // expected-error at +2{{OpenACC sub-array is not allowed here}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copy(HasMem.MemArr[1:3].array[1]), seq
+  // expected-error at +1{{OpenACC sub-array is not allowed here}}
+#pragma acc serial copy(HasMem.MemArr[1:3].array[1]), self
   for(;;){}
 
-  // expected-error at +2{{OpenACC sub-array is not allowed here}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copy(HasMem.MemArr[1:3].array[1:2]), seq
+  // expected-error at +1{{OpenACC sub-array is not allowed here}}
+#pragma acc serial copy(HasMem.MemArr[1:3].array[1:2]), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copy(HasMem.MemArr[:]), seq
+#pragma acc serial copy(HasMem.MemArr[:]), self
   for(;;){}
 
-  // expected-error at +2{{expected expression}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copy(HasMem.MemArr[::]), seq
+  // expected-error at +1{{expected expression}}
+#pragma acc serial copy(HasMem.MemArr[::]), self
   for(;;){}
 
-  // expected-error at +4{{expected expression}}
-  // expected-error at +3{{expected ']'}}
-  // expected-note at +2{{to match this '['}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copy(HasMem.MemArr[: :]), seq
+  // expected-error at +3{{expected expression}}
+  // expected-error at +2{{expected ']'}}
+  // expected-note at +1{{to match this '['}}
+#pragma acc serial copy(HasMem.MemArr[: :]), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copy(HasMem.MemArr[3:]), seq
+#pragma acc serial copy(HasMem.MemArr[3:]), self
   for(;;){}
 
   // expected-warning at +1{{OpenACC clause name 'pcopy' is a deprecated clause name and is now an alias for 'copy'}}
@@ -511,167 +488,136 @@ void VarListClauses() {
 #pragma acc serial present_or_copy(HasMem.MemArr[3:])
   for(;;){}
 
-  // expected-error at +3{{expected ','}}
-  // expected-warning at +2{{OpenACC clause 'use_device' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial use_device(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +2{{expected ','}}
+  // expected-warning at +1{{OpenACC clause 'use_device' not yet implemented, clause ignored}}
+#pragma acc serial use_device(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +2{{OpenACC clause 'use_device' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial use_device(s.array[s.value : 5]), seq
+  // expected-warning at +1{{OpenACC clause 'use_device' not yet implemented, clause ignored}}
+#pragma acc serial use_device(s.array[s.value : 5]), self
   for(;;){}
 
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial no_create(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +1{{expected ','}}
+#pragma acc serial no_create(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial no_create(s.array[s.value : 5], s.value), seq
+#pragma acc serial no_create(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial present(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +1{{expected ','}}
+#pragma acc serial present(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial present(s.array[s.value : 5], s.value), seq
+#pragma acc serial present(s.array[s.value : 5], s.value), self
   for(;;){}
 
 
   void *IsPointer;
-  // expected-error at +5{{expected ','}}
-  // expected-error at +4{{expected pointer in 'deviceptr' clause, type is 'char'}}
-  // expected-error at +3{{OpenACC sub-array is not allowed here}}
-  // expected-note at +2{{expected variable of pointer type}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial deviceptr(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +4{{expected ','}}
+  // expected-error at +3{{expected pointer in 'deviceptr' clause, type is 'char'}}
+  // expected-error at +2{{OpenACC sub-array is not allowed here}}
+  // expected-note at +1{{expected variable of pointer type}}
+#pragma acc serial deviceptr(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial deviceptr(IsPointer), seq
+#pragma acc serial deviceptr(IsPointer), self
   for(;;){}
 
-  // expected-error at +5{{expected ','}}
-  // expected-error at +4{{expected pointer in 'attach' clause, type is 'char'}}
-  // expected-error at +3{{OpenACC sub-array is not allowed here}}
-  // expected-note at +2{{expected variable of pointer type}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial attach(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +4{{expected ','}}
+  // expected-error at +3{{expected pointer in 'attach' clause, type is 'char'}}
+  // expected-error at +2{{OpenACC sub-array is not allowed here}}
+  // expected-note at +1{{expected variable of pointer type}}
+#pragma acc serial attach(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial attach(IsPointer), seq
+#pragma acc serial attach(IsPointer), self
   for(;;){}
 
-  // expected-error at +3{{expected ','}}
-  // expected-warning at +2{{OpenACC clause 'detach' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial detach(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +2{{expected ','}}
+  // expected-warning at +1{{OpenACC clause 'detach' not yet implemented, clause ignored}}
+#pragma acc serial detach(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +2{{OpenACC clause 'detach' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial detach(s.array[s.value : 5], s.value), seq
+  // expected-warning at +1{{OpenACC clause 'detach' not yet implemented, clause ignored}}
+#pragma acc serial detach(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial private(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +1{{expected ','}}
+#pragma acc serial private(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial private(s.array[s.value : 5], s.value), seq
+#pragma acc serial private(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial firstprivate(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +1{{expected ','}}
+#pragma acc serial firstprivate(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial firstprivate(s.array[s.value : 5], s.value), seq
+#pragma acc serial firstprivate(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +3{{expected ','}}
-  // expected-warning at +2{{OpenACC clause 'delete' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial delete(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +2{{expected ','}}
+  // expected-warning at +1{{OpenACC clause 'delete' not yet implemented, clause ignored}}
+#pragma acc serial delete(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +2{{OpenACC clause 'delete' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial delete(s.array[s.value : 5], s.value), seq
+  // expected-warning at +1{{OpenACC clause 'delete' not yet implemented, clause ignored}}
+#pragma acc serial delete(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +3{{expected ','}}
-  // expected-warning at +2{{OpenACC clause 'use_device' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial use_device(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +2{{expected ','}}
+  // expected-warning at +1{{OpenACC clause 'use_device' not yet implemented, clause ignored}}
+#pragma acc serial use_device(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +2{{OpenACC clause 'use_device' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial use_device(s.array[s.value : 5], s.value), seq
+  // expected-warning at +1{{OpenACC clause 'use_device' not yet implemented, clause ignored}}
+#pragma acc serial use_device(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +3{{expected ','}}
-  // expected-warning at +2{{OpenACC clause 'device_resident' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial device_resident(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +2{{expected ','}}
+  // expected-warning at +1{{OpenACC clause 'device_resident' not yet implemented, clause ignored}}
+#pragma acc serial device_resident(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +2{{OpenACC clause 'device_resident' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial device_resident(s.array[s.value : 5], s.value), seq
+  // expected-warning at +1{{OpenACC clause 'device_resident' not yet implemented, clause ignored}}
+#pragma acc serial device_resident(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +3{{expected ','}}
-  // expected-warning at +2{{OpenACC clause 'link' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial link(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +2{{expected ','}}
+  // expected-warning at +1{{OpenACC clause 'link' not yet implemented, clause ignored}}
+#pragma acc serial link(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +2{{OpenACC clause 'link' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial link(s.array[s.value : 5], s.value), seq
+  // expected-warning at +1{{OpenACC clause 'link' not yet implemented, clause ignored}}
+#pragma acc serial link(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +3{{expected ','}}
-  // expected-warning at +2{{OpenACC clause 'host' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial host(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +2{{expected ','}}
+  // expected-warning at +1{{OpenACC clause 'host' not yet implemented, clause ignored}}
+#pragma acc serial host(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +2{{OpenACC clause 'host' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial host(s.array[s.value : 5], s.value), seq
+  // expected-warning at +1{{OpenACC clause 'host' not yet implemented, clause ignored}}
+#pragma acc serial host(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +3{{expected ','}}
-  // expected-warning at +2{{OpenACC clause 'device' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial device(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +2{{expected ','}}
+  // expected-warning at +1{{OpenACC clause 'device' not yet implemented, clause ignored}}
+#pragma acc serial device(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +2{{OpenACC clause 'device' not yet implemented, clause ignored}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial device(s.array[s.value : 5], s.value), seq
+  // expected-warning at +1{{OpenACC clause 'device' not yet implemented, clause ignored}}
+#pragma acc serial device(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyout(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +1{{expected ','}}
+#pragma acc serial copyout(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyout(s.array[s.value : 5], s.value), seq
+#pragma acc serial copyout(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyout(zero:s.array[s.value : 5], s.value), seq
+#pragma acc serial copyout(zero:s.array[s.value : 5], s.value), self
   for(;;){}
 
   // expected-warning at +1{{OpenACC clause name 'pcopyout' is a deprecated clause name and is now an alias for 'copyout'}}
@@ -682,48 +628,39 @@ void VarListClauses() {
 #pragma acc serial present_or_copyout(zero:s.array[s.value : 5], s.value)
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyout(zero : s.array[s.value : 5], s.value), seq
+#pragma acc serial copyout(zero : s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +3{{use of undeclared identifier 'zero'}}
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyout(zero s.array[s.value : 5], s.value), seq
+  // expected-error at +2{{use of undeclared identifier 'zero'}}
+  // expected-error at +1{{expected ','}}
+#pragma acc serial copyout(zero s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{invalid tag 'readonly' on 'copyout' clause}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyout(readonly:s.array[s.value : 5], s.value), seq
+  // expected-error at +1{{invalid tag 'readonly' on 'copyout' clause}}
+#pragma acc serial copyout(readonly:s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{invalid tag 'invalid' on 'copyout' clause}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyout(invalid:s.array[s.value : 5], s.value), seq
+  // expected-error at +1{{invalid tag 'invalid' on 'copyout' clause}}
+#pragma acc serial copyout(invalid:s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{invalid tag 'invalid' on 'copyout' clause}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyout(invalid:s.array[s.value : 5], s.value), seq
+  // expected-error at +1{{invalid tag 'invalid' on 'copyout' clause}}
+#pragma acc serial copyout(invalid:s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +3{{use of undeclared identifier 'invalid'}}
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyout(invalid s.array[s.value : 5], s.value), seq
+  // expected-error at +2{{use of undeclared identifier 'invalid'}}
+  // expected-error at +1{{expected ','}}
+#pragma acc serial copyout(invalid s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial create(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +1{{expected ','}}
+#pragma acc serial create(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial create(s.array[s.value : 5], s.value), seq
+#pragma acc serial create(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial create(zero:s.array[s.value : 5], s.value), seq
+#pragma acc serial create(zero:s.array[s.value : 5], s.value), self
   for(;;){}
 
   // expected-warning at +1{{OpenACC clause name 'pcreate' is a deprecated clause name and is now an alias for 'create'}}
@@ -734,48 +671,39 @@ void VarListClauses() {
 #pragma acc serial present_or_create(zero:s.array[s.value : 5], s.value)
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial create(zero : s.array[s.value : 5], s.value), seq
+#pragma acc serial create(zero : s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +3{{use of undeclared identifier 'zero'}}
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial create(zero s.array[s.value : 5], s.value), seq
+  // expected-error at +2{{use of undeclared identifier 'zero'}}
+  // expected-error at +1{{expected ','}}
+#pragma acc serial create(zero s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{invalid tag 'readonly' on 'create' clause}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial create(readonly:s.array[s.value : 5], s.value), seq
+  // expected-error at +1{{invalid tag 'readonly' on 'create' clause}}
+#pragma acc serial create(readonly:s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{invalid tag 'invalid' on 'create' clause}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial create(invalid:s.array[s.value : 5], s.value), seq
+  // expected-error at +1{{invalid tag 'invalid' on 'create' clause}}
+#pragma acc serial create(invalid:s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{invalid tag 'invalid' on 'create' clause}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial create(invalid:s.array[s.value : 5], s.value), seq
+  // expected-error at +1{{invalid tag 'invalid' on 'create' clause}}
+#pragma acc serial create(invalid:s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +3{{use of undeclared identifier 'invalid'}}
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial create(invalid s.array[s.value : 5], s.value), seq
+  // expected-error at +2{{use of undeclared identifier 'invalid'}}
+  // expected-error at +1{{expected ','}}
+#pragma acc serial create(invalid s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyin(s.array[s.value] s.array[s.value :5] ), seq
+  // expected-error at +1{{expected ','}}
+#pragma acc serial copyin(s.array[s.value] s.array[s.value :5] ), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyin(s.array[s.value : 5], s.value), seq
+#pragma acc serial copyin(s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyin(readonly:s.array[s.value : 5], s.value), seq
+#pragma acc serial copyin(readonly:s.array[s.value : 5], s.value), self
   for(;;){}
 
   // expected-warning at +1{{OpenACC clause name 'pcopyin' is a deprecated clause name and is now an alias for 'copyin'}}
@@ -786,35 +714,29 @@ void VarListClauses() {
 #pragma acc serial present_or_copyin(readonly:s.array[s.value : 5], s.value)
   for(;;){}
 
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyin(readonly : s.array[s.value : 5], s.value), seq
+#pragma acc serial copyin(readonly : s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +3{{use of undeclared identifier 'readonly'}}
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyin(readonly s.array[s.value : 5], s.value), seq
+  // expected-error at +2{{use of undeclared identifier 'readonly'}}
+  // expected-error at +1{{expected ','}}
+#pragma acc serial copyin(readonly s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{invalid tag 'zero' on 'copyin' clause}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyin(zero :s.array[s.value : 5], s.value), seq
+  // expected-error at +1{{invalid tag 'zero' on 'copyin' clause}}
+#pragma acc serial copyin(zero :s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{invalid tag 'invalid' on 'copyin' clause}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyin(invalid:s.array[s.value : 5], s.value), seq
+  // expected-error at +1{{invalid tag 'invalid' on 'copyin' clause}}
+#pragma acc serial copyin(invalid:s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +2{{invalid tag 'invalid' on 'copyin' clause}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyin(invalid:s.array[s.value : 5], s.value), seq
+  // expected-error at +1{{invalid tag 'invalid' on 'copyin' clause}}
+#pragma acc serial copyin(invalid:s.array[s.value : 5], s.value), self
   for(;;){}
 
-  // expected-error at +3{{use of undeclared identifier 'invalid'}}
-  // expected-error at +2{{expected ','}}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial copyin(invalid s.array[s.value : 5], s.value), seq
+  // expected-error at +2{{use of undeclared identifier 'invalid'}}
+  // expected-error at +1{{expected ','}}
+#pragma acc serial copyin(invalid s.array[s.value : 5], s.value), self
   for(;;){}
 }
 
@@ -852,11 +774,9 @@ void ReductionClauseParsing() {
   for(;;){}
 #pragma acc serial reduction(^: Begin, End)
   for(;;){}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial seq, reduction(&&: Begin, End)
+#pragma acc serial self, reduction(&&: Begin, End)
   for(;;){}
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
-#pragma acc serial reduction(||: Begin, End), seq
+#pragma acc serial reduction(||: Begin, End), self
   for(;;){}
 }
 

diff  --git a/clang/test/SemaOpenACC/compute-construct-default-clause.c b/clang/test/SemaOpenACC/compute-construct-default-clause.c
index 93e8f7c2a6b18..1fecc3cd830d1 100644
--- a/clang/test/SemaOpenACC/compute-construct-default-clause.c
+++ b/clang/test/SemaOpenACC/compute-construct-default-clause.c
@@ -4,33 +4,31 @@ void SingleOnly() {
   #pragma acc parallel default(none)
   while(0);
 
-  // expected-warning at +3{{OpenACC clause 'seq' not yet implemented}}
   // expected-error at +2{{OpenACC 'default' clause cannot appear more than once on a 'serial' directive}}
   // expected-note at +1{{previous clause is here}}
-  #pragma acc serial default(present) seq default(none)
+  #pragma acc serial default(present) self default(none)
   while(0);
 
-  // expected-warning at +5{{OpenACC clause 'seq' not yet implemented}}
-  // expected-warning at +4{{OpenACC clause 'seq' not yet implemented}}
-  // expected-warning at +3{{OpenACC clause 'seq' not yet implemented}}
+  int i;
+
   // expected-error at +2{{OpenACC 'default' clause cannot appear more than once on a 'kernels' directive}}
   // expected-note at +1{{previous clause is here}}
-  #pragma acc kernels seq default(present) seq default(none) seq
+  #pragma acc kernels self default(present) present(i) default(none) copy(i)
   while(0);
 
   // expected-warning at +6{{OpenACC construct 'parallel loop' not yet implemented}}
-  // expected-warning at +5{{OpenACC clause 'seq' not yet implemented}}
-  // expected-warning at +4{{OpenACC clause 'seq' not yet implemented}}
-  // expected-warning at +3{{OpenACC clause 'seq' not yet implemented}}
+  // expected-warning at +5{{OpenACC clause 'self' not yet implemented}}
+  // expected-warning at +4{{OpenACC clause 'default' not yet implemented}}
+  // expected-warning at +3{{OpenACC clause 'private' not yet implemented}}
   // expected-warning at +2{{OpenACC clause 'default' not yet implemented}}
-  // expected-warning at +1{{OpenACC clause 'default' not yet implemented}}
-  #pragma acc parallel loop seq default(present) seq default(none) seq
+  // expected-warning at +1{{OpenACC clause 'copy' not yet implemented}}
+  #pragma acc parallel loop self default(present) private(i) default(none) copy(i)
   while(0);
 
-  // expected-warning at +3{{OpenACC construct 'serial loop' not yet implemented}}
-  // expected-warning at +2{{OpenACC clause 'seq' not yet implemented}}
+  // expected-warning at +3{{OpenACC clause 'self' not yet implemented, clause ignored}}
+  // expected-warning at +2{{OpenACC construct 'serial loop' not yet implemented}}
   // expected-error at +1{{expected '('}}
-  #pragma acc serial loop seq default seq default(none) seq
+  #pragma acc serial loop self default private(i) default(none) if(i)
   while(0);
 
   // expected-warning at +2{{OpenACC construct 'kernels loop' not yet implemented}}

diff  --git a/clang/test/SemaOpenACC/compute-construct-default-clause.cpp b/clang/test/SemaOpenACC/compute-construct-default-clause.cpp
index 2c3e711ffd085..8a4a79d0eb2dc 100644
--- a/clang/test/SemaOpenACC/compute-construct-default-clause.cpp
+++ b/clang/test/SemaOpenACC/compute-construct-default-clause.cpp
@@ -5,32 +5,25 @@ void SingleOnly() {
   #pragma acc parallel default(none)
   while(false);
 
-  // expected-warning at +3{{OpenACC clause 'seq' not yet implemented}}
+  int i;
+
   // expected-error at +2{{OpenACC 'default' clause cannot appear more than once on a 'parallel' directive}}
   // expected-note at +1{{previous clause is here}}
-  #pragma acc parallel default(present) seq default(none)
+  #pragma acc parallel default(present) async default(none)
   while(false);
 
-  // expected-warning at +5{{OpenACC clause 'seq' not yet implemented}}
-  // expected-warning at +4{{OpenACC clause 'seq' not yet implemented}}
-  // expected-warning at +3{{OpenACC clause 'seq' not yet implemented}}
   // expected-error at +2{{OpenACC 'default' clause cannot appear more than once on a 'serial' directive}}
   // expected-note at +1{{previous clause is here}}
-  #pragma acc serial seq default(present) seq default(none) seq
+  #pragma acc serial async default(present) copy(i) default(none) self
   while(false);
 
-  // expected-warning at +5{{OpenACC clause 'seq' not yet implemented}}
-  // expected-warning at +4{{OpenACC clause 'seq' not yet implemented}}
-  // expected-warning at +3{{OpenACC clause 'seq' not yet implemented}}
   // expected-error at +2{{OpenACC 'default' clause cannot appear more than once on a 'kernels' directive}}
   // expected-note at +1{{previous clause is here}}
-  #pragma acc kernels seq default(present) seq default(none) seq
+  #pragma acc kernels async default(present) copy(i) default(none) self
   while(false);
 
-  // expected-warning at +3{{OpenACC clause 'seq' not yet implemented}}
-  // expected-warning at +2{{OpenACC clause 'seq' not yet implemented}}
   // expected-error at +1{{expected '('}}
-  #pragma acc parallel seq default(none) seq default seq
+  #pragma acc parallel async default(none) copy(i) default self
   while(false);
 }
 

diff  --git a/clang/test/SemaOpenACC/compute-construct-device_type-clause.c b/clang/test/SemaOpenACC/compute-construct-device_type-clause.c
index 376a741a2a6b9..b300abe577801 100644
--- a/clang/test/SemaOpenACC/compute-construct-device_type-clause.c
+++ b/clang/test/SemaOpenACC/compute-construct-device_type-clause.c
@@ -52,16 +52,13 @@ void uses() {
   // expected-note at +1{{previous clause is here}}
 #pragma acc kernels device_type(*) if_present
   while(1);
-  // expected-error at +2{{OpenACC clause 'seq' may not follow a 'device_type' clause in a compute construct}}
-  // expected-note at +1{{previous clause is here}}
+  // expected-error at +1{{OpenACC 'seq' clause is not valid on 'kernels' directive}}
 #pragma acc kernels device_type(*) seq
   while(1);
-  // expected-error at +2{{OpenACC clause 'independent' may not follow a 'device_type' clause in a compute construct}}
-  // expected-note at +1{{previous clause is here}}
+  // expected-error at +1{{OpenACC 'independent' clause is not valid on 'kernels' directive}}
 #pragma acc kernels device_type(*) independent
   while(1);
-  // expected-error at +2{{OpenACC clause 'auto' may not follow a 'device_type' clause in a compute construct}}
-  // expected-note at +1{{previous clause is here}}
+  // expected-error at +1{{OpenACC 'auto' clause is not valid on 'kernels' directive}}
 #pragma acc kernels device_type(*) auto
   while(1);
   // expected-error at +2{{OpenACC clause 'worker' may not follow a 'device_type' clause in a compute construct}}

diff  --git a/clang/test/SemaOpenACC/loop-construct-auto_seq_independent-ast.cpp b/clang/test/SemaOpenACC/loop-construct-auto_seq_independent-ast.cpp
new file mode 100644
index 0000000000000..3c8f313df5eb2
--- /dev/null
+++ b/clang/test/SemaOpenACC/loop-construct-auto_seq_independent-ast.cpp
@@ -0,0 +1,124 @@
+// RUN: %clang_cc1 %s -fopenacc -ast-dump | FileCheck %s
+
+// Test this with PCH.
+// RUN: %clang_cc1 %s -fopenacc -emit-pch -o %t %s
+// RUN: %clang_cc1 %s -fopenacc -include-pch %t -ast-dump-all | FileCheck %s
+#ifndef PCH_HELPER
+#define PCH_HELPER
+
+void NormalUses() {
+  // CHECK: FunctionDecl{{.*}}NormalUses
+  // CHECK-NEXT: CompoundStmt
+
+#pragma acc loop auto
+  for(;;){}
+  // CHECK-NEXT: OpenACCLoopConstruct{{.*}}
+  // CHECK-NEXT: auto clause
+  // CHECK-NEXT: ForStmt
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: CompoundStmt
+
+#pragma acc loop seq
+  for(;;){}
+  // CHECK-NEXT: OpenACCLoopConstruct{{.*}}
+  // CHECK-NEXT: seq clause
+  // CHECK-NEXT: ForStmt
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: CompoundStmt
+
+#pragma acc loop independent
+  for(;;){}
+  // CHECK-NEXT: OpenACCLoopConstruct{{.*}}
+  // CHECK-NEXT: independent clause
+  // CHECK-NEXT: ForStmt
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: CompoundStmt
+}
+
+template<typename T>
+void TemplUses() {
+  // CHECK: FunctionTemplateDecl{{.*}}TemplUses
+  // CHECK-NEXT: TemplateTypeParmDecl
+  // CHECK-NEXT: FunctionDecl{{.*}} TemplUses
+  // CHECK-NEXT: CompoundStmt
+
+#pragma acc loop auto
+  for(;;){}
+  // CHECK-NEXT: OpenACCLoopConstruct{{.*}}
+  // CHECK-NEXT: auto clause
+  // CHECK-NEXT: ForStmt
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: CompoundStmt
+
+#pragma acc loop seq
+  for(;;){}
+  // CHECK-NEXT: OpenACCLoopConstruct{{.*}}
+  // CHECK-NEXT: seq clause
+  // CHECK-NEXT: ForStmt
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: CompoundStmt
+
+#pragma acc loop independent
+  for(;;){}
+  // CHECK-NEXT: OpenACCLoopConstruct{{.*}}
+  // CHECK-NEXT: independent clause
+  // CHECK-NEXT: ForStmt
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: CompoundStmt
+
+  // Instantiations.
+  // CHECK-NEXT: FunctionDecl{{.*}}TemplUses 'void ()' implicit_instantiation
+  // CHECK-NEXT: TemplateArgument
+  // CHECK-NEXT: BuiltinType
+  // CHECK-NEXT: CompoundStmt
+
+  // CHECK-NEXT: OpenACCLoopConstruct{{.*}}
+  // CHECK-NEXT: auto clause
+  // CHECK-NEXT: ForStmt
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: CompoundStmt
+
+  // CHECK-NEXT: OpenACCLoopConstruct{{.*}}
+  // CHECK-NEXT: seq clause
+  // CHECK-NEXT: ForStmt
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: CompoundStmt
+
+  // CHECK-NEXT: OpenACCLoopConstruct{{.*}}
+  // CHECK-NEXT: independent clause
+  // CHECK-NEXT: ForStmt
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: <<<NULL>>>
+  // CHECK-NEXT: CompoundStmt
+}
+
+void Inst() {
+  TemplUses<int>();
+}
+#endif // PCH_HELPER

diff  --git a/clang/test/SemaOpenACC/loop-construct-auto_seq_independent-clauses.c b/clang/test/SemaOpenACC/loop-construct-auto_seq_independent-clauses.c
new file mode 100644
index 0000000000000..23f852ec68700
--- /dev/null
+++ b/clang/test/SemaOpenACC/loop-construct-auto_seq_independent-clauses.c
@@ -0,0 +1,896 @@
+// RUN: %clang_cc1 %s -fopenacc -verify
+
+void uses() {
+#pragma acc loop auto
+  for(;;);
+#pragma acc loop seq
+  for(;;);
+#pragma acc loop independent
+  for(;;);
+
+  // expected-error at +2{{OpenACC clause 'seq' on 'loop' construct conflicts with previous data dependence clause}}
+  // expected-note at +1{{previous clause is here}}
+#pragma acc loop auto seq
+  for(;;);
+  // expected-error at +2{{OpenACC clause 'independent' on 'loop' construct conflicts with previous data dependence clause}}
+  // expected-note at +1{{previous clause is here}}
+#pragma acc loop auto independent
+  for(;;);
+  // expected-error at +2{{OpenACC clause 'auto' on 'loop' construct conflicts with previous data dependence clause}}
+  // expected-note at +1{{previous clause is here}}
+#pragma acc loop seq auto
+  for(;;);
+  // expected-error at +2{{OpenACC clause 'independent' on 'loop' construct conflicts with previous data dependence clause}}
+  // expected-note at +1{{previous clause is here}}
+#pragma acc loop seq independent
+  for(;;);
+  // expected-error at +2{{OpenACC clause 'auto' on 'loop' construct conflicts with previous data dependence clause}}
+  // expected-note at +1{{previous clause is here}}
+#pragma acc loop independent auto
+  for(;;);
+  // expected-error at +2{{OpenACC clause 'seq' on 'loop' construct conflicts with previous data dependence clause}}
+  // expected-note at +1{{previous clause is here}}
+#pragma acc loop independent seq
+  for(;;);
+
+  int Var;
+  int *VarPtr;
+
+  // 'auto' can combine with any other clause.
+  // expected-warning at +1{{OpenACC clause 'finalize' not yet implemented}}
+#pragma acc loop auto finalize
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'if_present' not yet implemented}}
+#pragma acc loop auto if_present
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'worker' not yet implemented}}
+#pragma acc loop auto worker
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'vector' not yet implemented}}
+#pragma acc loop auto vector
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'nohost' not yet implemented}}
+#pragma acc loop auto nohost
+  for(;;);
+  // expected-error at +1{{OpenACC 'default' clause is not valid on 'loop' directive}}
+#pragma acc loop auto default(none)
+  for(;;);
+  // expected-error at +1{{OpenACC 'if' clause is not valid on 'loop' directive}}
+#pragma acc loop auto if(1)
+  for(;;);
+  // expected-error at +1{{OpenACC 'self' clause is not valid on 'loop' directive}}
+#pragma acc loop auto self
+  for(;;);
+  // expected-error at +1{{OpenACC 'copy' clause is not valid on 'loop' directive}}
+#pragma acc loop auto copy(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopy' clause is not valid on 'loop' directive}}
+#pragma acc loop auto pcopy(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copy' clause is not valid on 'loop' directive}}
+#pragma acc loop auto present_or_copy(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'use_device' not yet implemented}}
+#pragma acc loop auto use_device(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'attach' clause is not valid on 'loop' directive}}
+#pragma acc loop auto attach(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'delete' not yet implemented}}
+#pragma acc loop auto delete(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'detach' not yet implemented}}
+#pragma acc loop auto detach(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device' not yet implemented}}
+#pragma acc loop auto device(VarPtr)
+  for(;;);
+  // expected-error at +1{{OpenACC 'deviceptr' clause is not valid on 'loop' directive}}
+#pragma acc loop auto deviceptr(VarPtr)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device_resident' not yet implemented}}
+#pragma acc loop auto device_resident(VarPtr)
+  for(;;);
+  // expected-error at +1{{OpenACC 'firstprivate' clause is not valid on 'loop' directive}}
+#pragma acc loop auto firstprivate(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'host' not yet implemented}}
+#pragma acc loop auto host(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'link' not yet implemented}}
+#pragma acc loop auto link(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'no_create' clause is not valid on 'loop' directive}}
+#pragma acc loop auto no_create(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present' clause is not valid on 'loop' directive}}
+#pragma acc loop auto present(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'private' not yet implemented}}
+#pragma acc loop auto private(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'copyout' clause is not valid on 'loop' directive}}
+#pragma acc loop auto copyout(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopyout' clause is not valid on 'loop' directive}}
+#pragma acc loop auto pcopyout(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copyout' clause is not valid on 'loop' directive}}
+#pragma acc loop auto present_or_copyout(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'copyin' clause is not valid on 'loop' directive}}
+#pragma acc loop auto copyin(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopyin' clause is not valid on 'loop' directive}}
+#pragma acc loop auto pcopyin(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copyin' clause is not valid on 'loop' directive}}
+#pragma acc loop auto present_or_copyin(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'create' clause is not valid on 'loop' directive}}
+#pragma acc loop auto create(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcreate' clause is not valid on 'loop' directive}}
+#pragma acc loop auto pcreate(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_create' clause is not valid on 'loop' directive}}
+#pragma acc loop auto present_or_create(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'reduction' not yet implemented}}
+#pragma acc loop auto reduction(+:Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'collapse' not yet implemented}}
+#pragma acc loop auto collapse(1)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'bind' not yet implemented}}
+#pragma acc loop auto bind(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'vector_length' clause is not valid on 'loop' directive}}
+#pragma acc loop auto vector_length(1)
+  for(;;);
+  // expected-error at +1{{OpenACC 'num_gangs' clause is not valid on 'loop' directive}}
+#pragma acc loop auto num_gangs(1)
+  for(;;);
+  // expected-error at +1{{OpenACC 'num_workers' clause is not valid on 'loop' directive}}
+#pragma acc loop auto num_workers(1)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device_num' not yet implemented}}
+#pragma acc loop auto device_num(1)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'default_async' not yet implemented}}
+#pragma acc loop auto default_async(1)
+  for(;;);
+#pragma acc loop auto device_type(*)
+  for(;;);
+#pragma acc loop auto dtype(*)
+  for(;;);
+  // expected-error at +1{{OpenACC 'async' clause is not valid on 'loop' directive}}
+#pragma acc loop auto async
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'tile' not yet implemented}}
+#pragma acc loop auto tile(Var, 1)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'gang' not yet implemented}}
+#pragma acc loop auto gang
+  for(;;);
+  // expected-error at +1{{OpenACC 'wait' clause is not valid on 'loop' directive}}
+#pragma acc loop auto wait
+  for(;;);
+
+  // expected-warning at +1{{OpenACC clause 'finalize' not yet implemented}}
+#pragma acc loop finalize auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'if_present' not yet implemented}}
+#pragma acc loop if_present auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'worker' not yet implemented}}
+#pragma acc loop worker auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'vector' not yet implemented}}
+#pragma acc loop vector auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'nohost' not yet implemented}}
+#pragma acc loop nohost auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'default' clause is not valid on 'loop' directive}}
+#pragma acc loop default(none) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'if' clause is not valid on 'loop' directive}}
+#pragma acc loop if(1) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'self' clause is not valid on 'loop' directive}}
+#pragma acc loop self auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'copy' clause is not valid on 'loop' directive}}
+#pragma acc loop copy(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopy' clause is not valid on 'loop' directive}}
+#pragma acc loop pcopy(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copy' clause is not valid on 'loop' directive}}
+#pragma acc loop present_or_copy(Var) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'use_device' not yet implemented}}
+#pragma acc loop use_device(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'attach' clause is not valid on 'loop' directive}}
+#pragma acc loop attach(Var) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'delete' not yet implemented}}
+#pragma acc loop delete(Var) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'detach' not yet implemented}}
+#pragma acc loop detach(Var) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device' not yet implemented}}
+#pragma acc loop device(VarPtr) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'deviceptr' clause is not valid on 'loop' directive}}
+#pragma acc loop deviceptr(VarPtr) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device_resident' not yet implemented}}
+#pragma acc loop device_resident(VarPtr) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'firstprivate' clause is not valid on 'loop' directive}}
+#pragma acc loop firstprivate(Var) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'host' not yet implemented}}
+#pragma acc loop host(Var) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'link' not yet implemented}}
+#pragma acc loop link(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'no_create' clause is not valid on 'loop' directive}}
+#pragma acc loop no_create(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'present' clause is not valid on 'loop' directive}}
+#pragma acc loop present(Var) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'private' not yet implemented}}
+#pragma acc loop private(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'copyout' clause is not valid on 'loop' directive}}
+#pragma acc loop copyout(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopyout' clause is not valid on 'loop' directive}}
+#pragma acc loop pcopyout(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copyout' clause is not valid on 'loop' directive}}
+#pragma acc loop present_or_copyout(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'copyin' clause is not valid on 'loop' directive}}
+#pragma acc loop copyin(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopyin' clause is not valid on 'loop' directive}}
+#pragma acc loop pcopyin(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copyin' clause is not valid on 'loop' directive}}
+#pragma acc loop present_or_copyin(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'create' clause is not valid on 'loop' directive}}
+#pragma acc loop create(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcreate' clause is not valid on 'loop' directive}}
+#pragma acc loop pcreate(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_create' clause is not valid on 'loop' directive}}
+#pragma acc loop present_or_create(Var) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'reduction' not yet implemented}}
+#pragma acc loop reduction(+:Var) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'collapse' not yet implemented}}
+#pragma acc loop collapse(1) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'bind' not yet implemented}}
+#pragma acc loop bind(Var) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'vector_length' clause is not valid on 'loop' directive}}
+#pragma acc loop vector_length(1) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'num_gangs' clause is not valid on 'loop' directive}}
+#pragma acc loop num_gangs(1) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'num_workers' clause is not valid on 'loop' directive}}
+#pragma acc loop num_workers(1) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device_num' not yet implemented}}
+#pragma acc loop device_num(1) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'default_async' not yet implemented}}
+#pragma acc loop default_async(1) auto
+  for(;;);
+#pragma acc loop device_type(*) auto
+  for(;;);
+#pragma acc loop dtype(*) auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'async' clause is not valid on 'loop' directive}}
+#pragma acc loop async auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'tile' not yet implemented}}
+#pragma acc loop tile(Var, 1) auto
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'gang' not yet implemented}}
+#pragma acc loop gang auto
+  for(;;);
+  // expected-error at +1{{OpenACC 'wait' clause is not valid on 'loop' directive}}
+#pragma acc loop wait auto
+  for(;;);
+
+  // 'independent' can also be combined with any clauses
+  // expected-warning at +1{{OpenACC clause 'finalize' not yet implemented}}
+#pragma acc loop independent finalize
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'if_present' not yet implemented}}
+#pragma acc loop independent if_present
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'worker' not yet implemented}}
+#pragma acc loop independent worker
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'vector' not yet implemented}}
+#pragma acc loop independent vector
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'nohost' not yet implemented}}
+#pragma acc loop independent nohost
+  for(;;);
+  // expected-error at +1{{OpenACC 'default' clause is not valid on 'loop' directive}}
+#pragma acc loop independent default(none)
+  for(;;);
+  // expected-error at +1{{OpenACC 'if' clause is not valid on 'loop' directive}}
+#pragma acc loop independent if(1)
+  for(;;);
+  // expected-error at +1{{OpenACC 'self' clause is not valid on 'loop' directive}}
+#pragma acc loop independent self
+  for(;;);
+  // expected-error at +1{{OpenACC 'copy' clause is not valid on 'loop' directive}}
+#pragma acc loop independent copy(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopy' clause is not valid on 'loop' directive}}
+#pragma acc loop independent pcopy(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copy' clause is not valid on 'loop' directive}}
+#pragma acc loop independent present_or_copy(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'use_device' not yet implemented}}
+#pragma acc loop independent use_device(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'attach' clause is not valid on 'loop' directive}}
+#pragma acc loop independent attach(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'delete' not yet implemented}}
+#pragma acc loop independent delete(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'detach' not yet implemented}}
+#pragma acc loop independent detach(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device' not yet implemented}}
+#pragma acc loop independent device(VarPtr)
+  for(;;);
+  // expected-error at +1{{OpenACC 'deviceptr' clause is not valid on 'loop' directive}}
+#pragma acc loop independent deviceptr(VarPtr)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device_resident' not yet implemented}}
+#pragma acc loop independent device_resident(VarPtr)
+  for(;;);
+  // expected-error at +1{{OpenACC 'firstprivate' clause is not valid on 'loop' directive}}
+#pragma acc loop independent firstprivate(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'host' not yet implemented}}
+#pragma acc loop independent host(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'link' not yet implemented}}
+#pragma acc loop independent link(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'no_create' clause is not valid on 'loop' directive}}
+#pragma acc loop independent no_create(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present' clause is not valid on 'loop' directive}}
+#pragma acc loop independent present(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'private' not yet implemented}}
+#pragma acc loop independent private(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'copyout' clause is not valid on 'loop' directive}}
+#pragma acc loop independent copyout(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopyout' clause is not valid on 'loop' directive}}
+#pragma acc loop independent pcopyout(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copyout' clause is not valid on 'loop' directive}}
+#pragma acc loop independent present_or_copyout(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'copyin' clause is not valid on 'loop' directive}}
+#pragma acc loop independent copyin(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopyin' clause is not valid on 'loop' directive}}
+#pragma acc loop independent pcopyin(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copyin' clause is not valid on 'loop' directive}}
+#pragma acc loop independent present_or_copyin(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'create' clause is not valid on 'loop' directive}}
+#pragma acc loop independent create(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcreate' clause is not valid on 'loop' directive}}
+#pragma acc loop independent pcreate(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_create' clause is not valid on 'loop' directive}}
+#pragma acc loop independent present_or_create(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'reduction' not yet implemented}}
+#pragma acc loop independent reduction(+:Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'collapse' not yet implemented}}
+#pragma acc loop independent collapse(1)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'bind' not yet implemented}}
+#pragma acc loop independent bind(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'vector_length' clause is not valid on 'loop' directive}}
+#pragma acc loop independent vector_length(1)
+  for(;;);
+  // expected-error at +1{{OpenACC 'num_gangs' clause is not valid on 'loop' directive}}
+#pragma acc loop independent num_gangs(1)
+  for(;;);
+  // expected-error at +1{{OpenACC 'num_workers' clause is not valid on 'loop' directive}}
+#pragma acc loop independent num_workers(1)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device_num' not yet implemented}}
+#pragma acc loop independent device_num(1)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'default_async' not yet implemented}}
+#pragma acc loop independent default_async(1)
+  for(;;);
+#pragma acc loop independent device_type(*)
+  for(;;);
+#pragma acc loop independent dtype(*)
+  for(;;);
+  // expected-error at +1{{OpenACC 'async' clause is not valid on 'loop' directive}}
+#pragma acc loop independent async
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'tile' not yet implemented}}
+#pragma acc loop independent tile(Var, 1)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'gang' not yet implemented}}
+#pragma acc loop independent gang
+  for(;;);
+  // expected-error at +1{{OpenACC 'wait' clause is not valid on 'loop' directive}}
+#pragma acc loop independent wait
+  for(;;);
+
+  // expected-warning at +1{{OpenACC clause 'finalize' not yet implemented}}
+#pragma acc loop finalize independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'if_present' not yet implemented}}
+#pragma acc loop if_present independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'worker' not yet implemented}}
+#pragma acc loop worker independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'vector' not yet implemented}}
+#pragma acc loop vector independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'nohost' not yet implemented}}
+#pragma acc loop nohost independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'default' clause is not valid on 'loop' directive}}
+#pragma acc loop default(none) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'if' clause is not valid on 'loop' directive}}
+#pragma acc loop if(1) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'self' clause is not valid on 'loop' directive}}
+#pragma acc loop self independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'copy' clause is not valid on 'loop' directive}}
+#pragma acc loop copy(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopy' clause is not valid on 'loop' directive}}
+#pragma acc loop pcopy(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copy' clause is not valid on 'loop' directive}}
+#pragma acc loop present_or_copy(Var) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'use_device' not yet implemented}}
+#pragma acc loop use_device(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'attach' clause is not valid on 'loop' directive}}
+#pragma acc loop attach(Var) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'delete' not yet implemented}}
+#pragma acc loop delete(Var) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'detach' not yet implemented}}
+#pragma acc loop detach(Var) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device' not yet implemented}}
+#pragma acc loop device(VarPtr) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'deviceptr' clause is not valid on 'loop' directive}}
+#pragma acc loop deviceptr(VarPtr) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device_resident' not yet implemented}}
+#pragma acc loop device_resident(VarPtr) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'firstprivate' clause is not valid on 'loop' directive}}
+#pragma acc loop firstprivate(Var) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'host' not yet implemented}}
+#pragma acc loop host(Var) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'link' not yet implemented}}
+#pragma acc loop link(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'no_create' clause is not valid on 'loop' directive}}
+#pragma acc loop no_create(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'present' clause is not valid on 'loop' directive}}
+#pragma acc loop present(Var) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'private' not yet implemented}}
+#pragma acc loop private(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'copyout' clause is not valid on 'loop' directive}}
+#pragma acc loop copyout(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopyout' clause is not valid on 'loop' directive}}
+#pragma acc loop pcopyout(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copyout' clause is not valid on 'loop' directive}}
+#pragma acc loop present_or_copyout(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'copyin' clause is not valid on 'loop' directive}}
+#pragma acc loop copyin(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopyin' clause is not valid on 'loop' directive}}
+#pragma acc loop pcopyin(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copyin' clause is not valid on 'loop' directive}}
+#pragma acc loop present_or_copyin(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'create' clause is not valid on 'loop' directive}}
+#pragma acc loop create(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcreate' clause is not valid on 'loop' directive}}
+#pragma acc loop pcreate(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_create' clause is not valid on 'loop' directive}}
+#pragma acc loop present_or_create(Var) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'reduction' not yet implemented}}
+#pragma acc loop reduction(+:Var) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'collapse' not yet implemented}}
+#pragma acc loop collapse(1) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'bind' not yet implemented}}
+#pragma acc loop bind(Var) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'vector_length' clause is not valid on 'loop' directive}}
+#pragma acc loop vector_length(1) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'num_gangs' clause is not valid on 'loop' directive}}
+#pragma acc loop num_gangs(1) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'num_workers' clause is not valid on 'loop' directive}}
+#pragma acc loop num_workers(1) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device_num' not yet implemented}}
+#pragma acc loop device_num(1) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'default_async' not yet implemented}}
+#pragma acc loop default_async(1) independent
+  for(;;);
+#pragma acc loop device_type(*) independent
+  for(;;);
+#pragma acc loop dtype(*) independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'async' clause is not valid on 'loop' directive}}
+#pragma acc loop async independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'tile' not yet implemented}}
+#pragma acc loop tile(Var, 1) independent
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'gang' not yet implemented}}
+#pragma acc loop gang independent
+  for(;;);
+  // expected-error at +1{{OpenACC 'wait' clause is not valid on 'loop' directive}}
+#pragma acc loop wait independent
+  for(;;);
+
+  // 'seq' cannot be combined with 'gang', 'worker' or 'vector'
+  // expected-error at +3{{OpenACC clause 'gang' may not appear on the same construct as a 'seq' clause on a 'loop' construct}}
+  // expected-note at +2{{previous clause is here}}
+  // expected-warning at +1{{OpenACC clause 'gang' not yet implemented}}
+#pragma acc loop seq gang
+  for(;;);
+  // expected-error at +3{{OpenACC clause 'worker' may not appear on the same construct as a 'seq' clause on a 'loop' construct}}
+  // expected-note at +2{{previous clause is here}}
+  // expected-warning at +1{{OpenACC clause 'worker' not yet implemented}}
+#pragma acc loop seq worker
+  for(;;);
+  // expected-error at +3{{OpenACC clause 'vector' may not appear on the same construct as a 'seq' clause on a 'loop' construct}}
+  // expected-note at +2{{previous clause is here}}
+  // expected-warning at +1{{OpenACC clause 'vector' not yet implemented}}
+#pragma acc loop seq vector
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'finalize' not yet implemented}}
+#pragma acc loop seq finalize
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'if_present' not yet implemented}}
+#pragma acc loop seq if_present
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'nohost' not yet implemented}}
+#pragma acc loop seq nohost
+  for(;;);
+  // expected-error at +1{{OpenACC 'default' clause is not valid on 'loop' directive}}
+#pragma acc loop seq default(none)
+  for(;;);
+  // expected-error at +1{{OpenACC 'if' clause is not valid on 'loop' directive}}
+#pragma acc loop seq if(1)
+  for(;;);
+  // expected-error at +1{{OpenACC 'self' clause is not valid on 'loop' directive}}
+#pragma acc loop seq self
+  for(;;);
+  // expected-error at +1{{OpenACC 'copy' clause is not valid on 'loop' directive}}
+#pragma acc loop seq copy(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopy' clause is not valid on 'loop' directive}}
+#pragma acc loop seq pcopy(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copy' clause is not valid on 'loop' directive}}
+#pragma acc loop seq present_or_copy(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'use_device' not yet implemented}}
+#pragma acc loop seq use_device(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'attach' clause is not valid on 'loop' directive}}
+#pragma acc loop seq attach(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'delete' not yet implemented}}
+#pragma acc loop seq delete(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'detach' not yet implemented}}
+#pragma acc loop seq detach(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device' not yet implemented}}
+#pragma acc loop seq device(VarPtr)
+  for(;;);
+  // expected-error at +1{{OpenACC 'deviceptr' clause is not valid on 'loop' directive}}
+#pragma acc loop seq deviceptr(VarPtr)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device_resident' not yet implemented}}
+#pragma acc loop seq device_resident(VarPtr)
+  for(;;);
+  // expected-error at +1{{OpenACC 'firstprivate' clause is not valid on 'loop' directive}}
+#pragma acc loop seq firstprivate(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'host' not yet implemented}}
+#pragma acc loop seq host(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'link' not yet implemented}}
+#pragma acc loop seq link(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'no_create' clause is not valid on 'loop' directive}}
+#pragma acc loop seq no_create(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present' clause is not valid on 'loop' directive}}
+#pragma acc loop seq present(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'private' not yet implemented}}
+#pragma acc loop seq private(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'copyout' clause is not valid on 'loop' directive}}
+#pragma acc loop seq copyout(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopyout' clause is not valid on 'loop' directive}}
+#pragma acc loop seq pcopyout(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copyout' clause is not valid on 'loop' directive}}
+#pragma acc loop seq present_or_copyout(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'copyin' clause is not valid on 'loop' directive}}
+#pragma acc loop seq copyin(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopyin' clause is not valid on 'loop' directive}}
+#pragma acc loop seq pcopyin(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copyin' clause is not valid on 'loop' directive}}
+#pragma acc loop seq present_or_copyin(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'create' clause is not valid on 'loop' directive}}
+#pragma acc loop seq create(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcreate' clause is not valid on 'loop' directive}}
+#pragma acc loop seq pcreate(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_create' clause is not valid on 'loop' directive}}
+#pragma acc loop seq present_or_create(Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'reduction' not yet implemented}}
+#pragma acc loop seq reduction(+:Var)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'collapse' not yet implemented}}
+#pragma acc loop seq collapse(1)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'bind' not yet implemented}}
+#pragma acc loop seq bind(Var)
+  for(;;);
+  // expected-error at +1{{OpenACC 'vector_length' clause is not valid on 'loop' directive}}
+#pragma acc loop seq vector_length(1)
+  for(;;);
+  // expected-error at +1{{OpenACC 'num_gangs' clause is not valid on 'loop' directive}}
+#pragma acc loop seq num_gangs(1)
+  for(;;);
+  // expected-error at +1{{OpenACC 'num_workers' clause is not valid on 'loop' directive}}
+#pragma acc loop seq num_workers(1)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device_num' not yet implemented}}
+#pragma acc loop seq device_num(1)
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'default_async' not yet implemented}}
+#pragma acc loop seq default_async(1)
+  for(;;);
+#pragma acc loop seq device_type(*)
+  for(;;);
+#pragma acc loop seq dtype(*)
+  for(;;);
+  // expected-error at +1{{OpenACC 'async' clause is not valid on 'loop' directive}}
+#pragma acc loop seq async
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'tile' not yet implemented}}
+#pragma acc loop seq tile(Var, 1)
+  for(;;);
+  // expected-error at +1{{OpenACC 'wait' clause is not valid on 'loop' directive}}
+#pragma acc loop seq wait
+  for(;;);
+
+  // TODO OpenACC: when 'gang' is implemented and makes it to the AST, this should diagnose because of a conflict with 'seq'.
+  // TODOexpected-error at +3{{OpenACC clause 'gang' may not appear on the same construct as a 'seq' clause on a 'loop' construct}}
+  // TODOexpected-note at +2{{previous clause is here}}
+  // expected-warning at +1{{OpenACC clause 'gang' not yet implemented}}
+#pragma acc loop gang seq
+  for(;;);
+  // TODO OpenACC: when 'worker' is implemented and makes it to the AST, this should diagnose because of a conflict with 'seq'.
+  // TODOexpected-error at +3{{OpenACC clause 'worker' may not appear on the same construct as a 'seq' clause on a 'loop' construct}}
+  // TODOexpected-note at +2{{previous clause is here}}
+  // expected-warning at +1{{OpenACC clause 'worker' not yet implemented}}
+#pragma acc loop worker seq
+  for(;;);
+  // TODO OpenACC: when 'vector' is implemented and makes it to the AST, this should diagnose because of a conflict with 'seq'.
+  // TODOexpected-error at +3{{OpenACC clause 'vector' may not appear on the same construct as a 'seq' clause on a 'loop' construct}}
+  // TODOexpected-note at +2{{previous clause is here}}
+  // expected-warning at +1{{OpenACC clause 'vector' not yet implemented}}
+#pragma acc loop vector seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'finalize' not yet implemented}}
+#pragma acc loop finalize seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'if_present' not yet implemented}}
+#pragma acc loop if_present seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'nohost' not yet implemented}}
+#pragma acc loop nohost seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'default' clause is not valid on 'loop' directive}}
+#pragma acc loop default(none) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'if' clause is not valid on 'loop' directive}}
+#pragma acc loop if(1) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'self' clause is not valid on 'loop' directive}}
+#pragma acc loop self seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'copy' clause is not valid on 'loop' directive}}
+#pragma acc loop copy(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopy' clause is not valid on 'loop' directive}}
+#pragma acc loop pcopy(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copy' clause is not valid on 'loop' directive}}
+#pragma acc loop present_or_copy(Var) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'use_device' not yet implemented}}
+#pragma acc loop use_device(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'attach' clause is not valid on 'loop' directive}}
+#pragma acc loop attach(Var) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'delete' not yet implemented}}
+#pragma acc loop delete(Var) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'detach' not yet implemented}}
+#pragma acc loop detach(Var) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device' not yet implemented}}
+#pragma acc loop device(VarPtr) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'deviceptr' clause is not valid on 'loop' directive}}
+#pragma acc loop deviceptr(VarPtr) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device_resident' not yet implemented}}
+#pragma acc loop device_resident(VarPtr) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'firstprivate' clause is not valid on 'loop' directive}}
+#pragma acc loop firstprivate(Var) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'host' not yet implemented}}
+#pragma acc loop host(Var) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'link' not yet implemented}}
+#pragma acc loop link(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'no_create' clause is not valid on 'loop' directive}}
+#pragma acc loop no_create(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'present' clause is not valid on 'loop' directive}}
+#pragma acc loop present(Var) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'private' not yet implemented}}
+#pragma acc loop private(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'copyout' clause is not valid on 'loop' directive}}
+#pragma acc loop copyout(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopyout' clause is not valid on 'loop' directive}}
+#pragma acc loop pcopyout(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copyout' clause is not valid on 'loop' directive}}
+#pragma acc loop present_or_copyout(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'copyin' clause is not valid on 'loop' directive}}
+#pragma acc loop copyin(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcopyin' clause is not valid on 'loop' directive}}
+#pragma acc loop pcopyin(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_copyin' clause is not valid on 'loop' directive}}
+#pragma acc loop present_or_copyin(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'create' clause is not valid on 'loop' directive}}
+#pragma acc loop create(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'pcreate' clause is not valid on 'loop' directive}}
+#pragma acc loop pcreate(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'present_or_create' clause is not valid on 'loop' directive}}
+#pragma acc loop present_or_create(Var) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'reduction' not yet implemented}}
+#pragma acc loop reduction(+:Var) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'collapse' not yet implemented}}
+#pragma acc loop collapse(1) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'bind' not yet implemented}}
+#pragma acc loop bind(Var) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'vector_length' clause is not valid on 'loop' directive}}
+#pragma acc loop vector_length(1) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'num_gangs' clause is not valid on 'loop' directive}}
+#pragma acc loop num_gangs(1) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'num_workers' clause is not valid on 'loop' directive}}
+#pragma acc loop num_workers(1) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'device_num' not yet implemented}}
+#pragma acc loop device_num(1) seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'default_async' not yet implemented}}
+#pragma acc loop default_async(1) seq
+  for(;;);
+#pragma acc loop device_type(*) seq
+  for(;;);
+#pragma acc loop dtype(*) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'async' clause is not valid on 'loop' directive}}
+#pragma acc loop async seq
+  for(;;);
+  // expected-warning at +1{{OpenACC clause 'tile' not yet implemented}}
+#pragma acc loop tile(Var, 1) seq
+  for(;;);
+  // expected-error at +1{{OpenACC 'wait' clause is not valid on 'loop' directive}}
+#pragma acc loop wait seq
+  for(;;);
+}

diff  --git a/clang/test/SemaOpenACC/loop-construct-device_type-clause.c b/clang/test/SemaOpenACC/loop-construct-device_type-clause.c
index 3e3a85e4498b7..520ba45aaebf4 100644
--- a/clang/test/SemaOpenACC/loop-construct-device_type-clause.c
+++ b/clang/test/SemaOpenACC/loop-construct-device_type-clause.c
@@ -50,13 +50,10 @@ void uses() {
   // expected-note at +1{{previous clause is here}}
 #pragma acc loop device_type(*) if_present
   for(;;);
-  // expected-warning at +1{{OpenACC clause 'seq' not yet implemented, clause ignored}}
 #pragma acc loop device_type(*) seq
   for(;;);
-  // expected-warning at +1{{OpenACC clause 'independent' not yet implemented, clause ignored}}
 #pragma acc loop device_type(*) independent
   for(;;);
-  // expected-warning at +1{{OpenACC clause 'auto' not yet implemented, clause ignored}}
 #pragma acc loop device_type(*) auto
   for(;;);
   // expected-warning at +1{{OpenACC clause 'worker' not yet implemented, clause ignored}}

diff  --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 916e941cfbde1..dcd9555e1bfcc 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -2860,6 +2860,10 @@ void OpenACCClauseEnqueue::VisitReductionClause(
     const OpenACCReductionClause &C) {
   VisitVarList(C);
 }
+void OpenACCClauseEnqueue::VisitAutoClause(const OpenACCAutoClause &C) {}
+void OpenACCClauseEnqueue::VisitIndependentClause(
+    const OpenACCIndependentClause &C) {}
+void OpenACCClauseEnqueue::VisitSeqClause(const OpenACCSeqClause &C) {}
 } // namespace
 
 void EnqueueVisitor::EnqueueChildren(const OpenACCClause *C) {


        


More information about the cfe-commits mailing list