[llvm-branch-commits] [clang] 7d29ad3 - [OpenMP] Try to find an existing base for `omp begin/end declare variant`
Johannes Doerfert via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Apr 3 23:58:42 PDT 2020
Author: Johannes Doerfert
Date: 2020-04-04T01:56:15-05:00
New Revision: 7d29ad378f36284da426cc3c7d775bc208748bf4
URL: https://github.com/llvm/llvm-project/commit/7d29ad378f36284da426cc3c7d775bc208748bf4
DIFF: https://github.com/llvm/llvm-project/commit/7d29ad378f36284da426cc3c7d775bc208748bf4.diff
LOG: [OpenMP] Try to find an existing base for `omp begin/end declare variant`
Summary:
If we have a function definition in `omp begin/end declare variant` it
is a specialization of a base function with the same name and
"compatible" type. Before, we just created a declaration for the base.
With this patch we try to find an existing declaration first and only
create a new one if we did not find any with a compatible type. This is
preferable as we can tolerate slight mismatches, especially if the
specialized version is "more constrained", e.g., constexpr.
Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim, aaron.ballman
Subscribers: yaxunl, bollu, guansong, openmp-commits, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D77252
Added:
clang/test/AST/ast-dump-openmp-begin-declare-variant_10.c
clang/test/AST/ast-dump-openmp-begin-declare-variant_11.c
clang/test/AST/ast-dump-openmp-begin-declare-variant_12.c
clang/test/AST/ast-dump-openmp-begin-declare-variant_namespace_1.cpp
Modified:
clang/include/clang/AST/ASTContext.h
clang/include/clang/Sema/Sema.h
clang/lib/AST/ASTContext.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaOpenMP.cpp
clang/test/AST/ast-dump-openmp-begin-declare-variant_2.c
clang/test/AST/ast-dump-openmp-begin-declare-variant_3.c
clang/test/AST/ast-dump-openmp-begin-declare-variant_4.c
clang/test/AST/ast-dump-openmp-begin-declare-variant_5.c
clang/test/AST/ast-dump-openmp-begin-declare-variant_6.c
clang/test/AST/ast-dump-openmp-begin-declare-variant_7.c
clang/test/AST/ast-dump-openmp-begin-declare-variant_8.c
clang/test/AST/ast-dump-openmp-begin-declare-variant_9.c
clang/test/AST/ast-dump-openmp-begin-declare-variant_addr_1.c
Removed:
################################################################################
diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h
index 6360f18217c7..5e9f46046411 100644
--- a/clang/include/clang/AST/ASTContext.h
+++ b/clang/include/clang/AST/ASTContext.h
@@ -2537,7 +2537,7 @@ class ASTContext : public RefCountedBase<ASTContext> {
QualType mergeTypes(QualType, QualType, bool OfBlockPointer=false,
bool Unqualified = false, bool BlockReturnType = false);
QualType mergeFunctionTypes(QualType, QualType, bool OfBlockPointer=false,
- bool Unqualified = false);
+ bool Unqualified = false, bool AllowCXX = false);
QualType mergeFunctionParameterTypes(QualType, QualType,
bool OfBlockPointer = false,
bool Unqualified = false);
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 10e2d69f3d9e..99c11eac6e66 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -9868,18 +9868,22 @@ class Sema final {
/// The current `omp begin/end declare variant` scopes.
SmallVector<OMPDeclareVariantScope, 4> OMPDeclareVariantScopes;
- /// The declarator \p D defines a function in the scope \p S which is nested
- /// in an `omp begin/end declare variant` scope. In this method we create a
- /// declaration for \p D and rename \p D according to the OpenMP context
- /// selector of the surrounding scope.
- FunctionDecl *
- ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(Scope *S,
- Declarator &D);
+ /// The declarator \p D defines a function definition in an `omp begin/end
+ /// declare variant` scope. In this method we rename \p D according to the
+ /// OpenMP context selector of the surrounding scope which makes it a
+ /// specialization. ActOnFinishedFunctionDefinitionInOpenMPDeclareVariantScope
+ /// will attach that specialization to a base function of the original name.
+ ///
+ /// \return The original identifier info of \p D (= the name of the base
+ /// function for which \p D is a specialization).
+ IdentifierInfo *
+ ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(Declarator &D);
- /// Register \p FD as specialization of \p BaseFD in the current `omp
- /// begin/end declare variant` scope.
+ /// Register \p FD as specialization of the function with name \p BaseII in
+ /// the current `omp begin/end declare variant` scope. \p FD was declared in
+ /// the scope \p S with declarator \p D (which was renamed!).
void ActOnFinishedFunctionDefinitionInOpenMPDeclareVariantScope(
- FunctionDecl *FD, FunctionDecl *BaseFD);
+ IdentifierInfo &BaseII, FunctionDecl *FD, Scope *S, Declarator &D);
public:
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index 06dcb6fa0580..06513fc4b234 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -8867,8 +8867,8 @@ QualType ASTContext::mergeFunctionParameterTypes(QualType lhs, QualType rhs,
}
QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs,
- bool OfBlockPointer,
- bool Unqualified) {
+ bool OfBlockPointer, bool Unqualified,
+ bool AllowCXX) {
const auto *lbase = lhs->castAs<FunctionType>();
const auto *rbase = rhs->castAs<FunctionType>();
const auto *lproto = dyn_cast<FunctionProtoType>(lbase);
@@ -8942,7 +8942,8 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs,
FunctionType::ExtInfo einfo = lbaseInfo.withNoReturn(NoReturn);
if (lproto && rproto) { // two C99 style function prototypes
- assert(!lproto->hasExceptionSpec() && !rproto->hasExceptionSpec() &&
+ assert((AllowCXX ||
+ (!lproto->hasExceptionSpec() && !rproto->hasExceptionSpec())) &&
"C++ shouldn't be here");
// Compatible functions must have the same number of parameters
if (lproto->getNumParams() != rproto->getNumParams())
@@ -9006,7 +9007,7 @@ QualType ASTContext::mergeFunctionTypes(QualType lhs, QualType rhs,
const FunctionProtoType *proto = lproto ? lproto : rproto;
if (proto) {
- assert(!proto->hasExceptionSpec() && "C++ shouldn't be here");
+ assert((AllowCXX || !proto->hasExceptionSpec()) && "C++ shouldn't be here");
if (proto->isVariadic())
return {};
// Check that the types are compatible with the types that
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 494a1cd1a685..cd6cf94278dd 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -13575,25 +13575,24 @@ Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D,
Scope *ParentScope = FnBodyScope->getParent();
// Check if we are in an `omp begin/end declare variant` scope. If we are, and
- // we define a non-templated function definition, we will create a declaration
- // instead (=BaseFD), and emit the definition with a mangled name afterwards.
- // The base function declaration will have the equivalent of an `omp declare
- // variant` annotation which specifies the mangled definition as a
+ // we define a non-templated function definition, we will emit the definition
+ // with a mangled name instead. Afterwards, we'll look for an existing base
+ // function declaration or create one. It will have the equivalent of an `omp
+ // declare variant` annotation which specifies the mangled definition as a
// specialization function under the OpenMP context defined as part of the
// `omp begin declare variant`.
- FunctionDecl *BaseFD = nullptr;
+ IdentifierInfo *BaseII = nullptr;
if (LangOpts.OpenMP && isInOpenMPDeclareVariantScope() &&
TemplateParameterLists.empty())
- BaseFD = ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(
- ParentScope, D);
+ BaseII = ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(D);
D.setFunctionDefinitionKind(FDK_Definition);
Decl *DP = HandleDeclarator(ParentScope, D, TemplateParameterLists);
Decl *Dcl = ActOnStartOfFunctionDef(FnBodyScope, DP, SkipBody);
- if (BaseFD)
+ if (BaseII)
ActOnFinishedFunctionDefinitionInOpenMPDeclareVariantScope(
- cast<FunctionDecl>(Dcl), BaseFD);
+ *BaseII, cast<FunctionDecl>(Dcl), ParentScope, D);
return Dcl;
}
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index dfb809e0aaa1..52687888af2d 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -5548,10 +5548,10 @@ static void setPrototype(Sema &S, FunctionDecl *FD, FunctionDecl *FDWithProto,
Sema::OMPDeclareVariantScope::OMPDeclareVariantScope(OMPTraitInfo &TI)
: TI(&TI), NameSuffix(TI.getMangledName()) {}
-FunctionDecl *
-Sema::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(Scope *S,
- Declarator &D) {
- auto *BaseFD = cast<FunctionDecl>(ActOnDeclarator(S, D));
+IdentifierInfo *
+Sema::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(Declarator &D) {
+ IdentifierInfo *BaseII = D.getIdentifier();
+
OMPDeclareVariantScope &DVScope = OMPDeclareVariantScopes.back();
std::string MangledName;
MangledName += D.getIdentifier()->getName();
@@ -5560,27 +5560,87 @@ Sema::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(Scope *S,
IdentifierInfo &VariantII = Context.Idents.get(MangledName);
VariantII.setMangledOpenMPVariantName(true);
- D.SetIdentifier(&VariantII, D.getBeginLoc());
- return BaseFD;
+ D.SetIdentifier(&VariantII, D.getIdentifierLoc());
+ return BaseII;
}
void Sema::ActOnFinishedFunctionDefinitionInOpenMPDeclareVariantScope(
- FunctionDecl *FD, FunctionDecl *BaseFD) {
- // Do not mark function as is used to prevent its emission if this is the
- // only place where it is used.
- EnterExpressionEvaluationContext Unevaluated(
- *this, Sema::ExpressionEvaluationContext::Unevaluated);
+ IdentifierInfo &BaseII, FunctionDecl *FD, Scope *S, Declarator &D) {
+
+ // Lookup the base name in order to find an existing, compatible, base
+ // declaration. If none was found we create one matching the type of the
+ // specialization FD.
+ LookupResult Lookup(*this, DeclarationName(&BaseII), FD->getLocation(),
+ LookupOrdinaryName);
+ LookupParsedName(Lookup, S, &D.getCXXScopeSpec());
+
+ // Scan the candidates we found for one that has a type "compatible" with the
+ // type of FD.
+ // TODO: Investigate if we can merge this with the declare variant checks,
+ // this will require some refactoring but should be possible.
+ FunctionDecl *BaseFD = nullptr;
+ for (auto *Candidate : Lookup) {
+ auto *UDecl = dyn_cast<FunctionDecl>(Candidate->getUnderlyingDecl());
+ if (!UDecl)
+ continue;
+
+ // Don't specialize constexpr/consteval functions with
+ // non-constexpr/consteval functions.
+ if (UDecl->isConstexpr() && !FD->isConstexpr())
+ continue;
+ if (UDecl->isConsteval() && !FD->isConsteval())
+ continue;
- Expr *VariantFuncRef = DeclRefExpr::Create(
- Context, NestedNameSpecifierLoc(), SourceLocation(), FD,
- /* RefersToEnclosingVariableOrCapture */ false,
- /* NameLoc */ FD->getLocation(), FD->getType(), ExprValueKind::VK_RValue);
+ QualType NewType = Context.mergeFunctionTypes(
+ FD->getType(), UDecl->getType(), /* OfBlockPointer */ false,
+ /* Unqualified */ false, /* AllowCXX */ true);
+ if (NewType.isNull())
+ continue;
+
+ // Found a base!
+ BaseFD = UDecl;
+ break;
+ }
+
+ if (!BaseFD) {
+ // TODO: Determine if we can reuse the declarator to create a declaration
+ // but with the BaseII name. For some reason this did not work immediatly.
+ BaseFD =
+ cast<FunctionDecl>(DeclClonePragmaWeak(FD, &BaseII, FD->getLocation()));
+ BaseFD->setConstexprKind(FD->getConstexprKind());
+ // Copied from DeclApplyPragmaWeak:
+ // FIXME: "hideous" code from Sema::LazilyCreateBuiltin
+ // to insert Decl at TU scope, sorry.
+ DeclContext *SavedContext = CurContext;
+ CurContext = FD->getLexicalDeclContext();
+ BaseFD->setDeclContext(CurContext);
+ BaseFD->setLexicalDeclContext(CurContext);
+ PushOnScopeChains(BaseFD, S);
+ CurContext = SavedContext;
+ }
+
+ // We need a expression that references the base for the OMPDeclareVariantAttr
+ // below. For `omp declare variant` we parse them, for scoped declare variants
+ // we need to create them.
+ Expr *VariantFuncRef;
+ {
+ // Do not mark function as is used to prevent its emission if this is the
+ // only place where it is used.
+ EnterExpressionEvaluationContext Unevaluated(
+ *this, Sema::ExpressionEvaluationContext::Unevaluated);
+
+ VariantFuncRef = DeclRefExpr::Create(
+ Context, NestedNameSpecifierLoc(), SourceLocation(), FD,
+ /* RefersToEnclosingVariableOrCapture */ false,
+ /* NameLoc */ FD->getLocation(), FD->getType(),
+ ExprValueKind::VK_RValue);
+ }
OMPDeclareVariantScope &DVScope = OMPDeclareVariantScopes.back();
auto *OMPDeclareVariantA = OMPDeclareVariantAttr::CreateImplicit(
Context, VariantFuncRef, DVScope.TI);
- BaseFD->addAttr(OMPDeclareVariantA);
+ BaseFD->addAttr(OMPDeclareVariantA);
BaseFD->setImplicit(true);
}
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_10.c b/clang/test/AST/ast-dump-openmp-begin-declare-variant_10.c
new file mode 100644
index 000000000000..9c8d8dc31eb4
--- /dev/null
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_10.c
@@ -0,0 +1,203 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s | FileCheck %s --check-prefix=C
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s -x c++| FileCheck %s --check-prefix=CXX
+// expected-no-diagnostics
+
+#ifdef __cplusplus
+#define CONST constexpr
+#else
+#define CONST __attribute__((const))
+#endif
+
+int also_before1(void) {
+ return 1;
+}
+int also_before2(void) {
+ return 2;
+}
+int also_before3(void) {
+ return 3;
+}
+int also_before4(void) {
+ return 4;
+}
+
+#pragma omp begin declare variant match(implementation = {vendor(llvm)})
+CONST int also_before1(void) {
+ return 0;
+}
+static int also_before2(void) {
+ return 0;
+}
+__attribute__((nothrow)) int also_before3(void) {
+ return 0;
+}
+static CONST __attribute__((nothrow, always_inline)) __inline__ int also_before4(void) {
+ return 0;
+}
+#pragma omp end declare variant
+
+
+int main() {
+ // Should return 0.
+ return also_before1() + also_before2() + also_before3() + also_before4();
+}
+
+// Make sure:
+// - we see the specialization in the AST
+// - we pick the right callees
+
+// C: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:13:1> line:11:5 implicit used also_before1 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:24, line:13:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:12:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 1
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] <line:25:11> 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before1[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:14:1, line:16:1> line:14:5 implicit used also_before2 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:24, line:16:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:15:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] <col:10> 'int' 2
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_11:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_12:0x[a-z0-9]*]] <line:28:12> 'int ({{.*}})' Function [[ADDR_13:0x[a-z0-9]*]] 'also_before2[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] <line:17:1, line:19:1> line:17:5 implicit used also_before3 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] <col:24, line:19:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] <line:18:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] <col:10> 'int' 3
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_18:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_19:0x[a-z0-9]*]] <line:31:30> 'int ({{.*}})' Function [[ADDR_20:0x[a-z0-9]*]] 'also_before3[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_21:0x[a-z0-9]*]] <line:20:1, line:22:1> line:20:5 implicit used also_before4 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_22:0x[a-z0-9]*]] <col:24, line:22:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_23:0x[a-z0-9]*]] <line:21:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_24:0x[a-z0-9]*]] <col:10> 'int' 4
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_25:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_26:0x[a-z0-9]*]] <line:34:69> 'int ({{.*}})' Function [[ADDR_27:0x[a-z0-9]*]] 'also_before4[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_6]] <line:8:15, line:27:1> line:25:11 also_before1[implementation={vendor(llvm)}] 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_28:0x[a-z0-9]*]] <col:30, line:27:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_29:0x[a-z0-9]*]] <line:26:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_30:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-ConstAttr [[ADDR_31:0x[a-z0-9]*]] <line:8:30>
+// C-NEXT: |-FunctionDecl [[ADDR_13]] <line:28:1, line:30:1> line:28:12 also_before2[implementation={vendor(llvm)}] 'int ({{.*}})' static
+// C-NEXT: | `-CompoundStmt [[ADDR_32:0x[a-z0-9]*]] <col:31, line:30:1>
+// C-NEXT: | `-ReturnStmt [[ADDR_33:0x[a-z0-9]*]] <line:29:3, col:10>
+// C-NEXT: | `-IntegerLiteral [[ADDR_34:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: |-FunctionDecl [[ADDR_20]] <line:31:1, line:33:1> line:31:30 also_before3[implementation={vendor(llvm)}] 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_35:0x[a-z0-9]*]] <col:49, line:33:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_36:0x[a-z0-9]*]] <line:32:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_37:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-NoThrowAttr [[ADDR_38:0x[a-z0-9]*]] <line:31:16>
+// C-NEXT: |-FunctionDecl [[ADDR_27]] <line:34:1, line:36:1> line:34:69 also_before4[implementation={vendor(llvm)}] 'int ({{.*}})' static inline
+// C-NEXT: | |-CompoundStmt [[ADDR_39:0x[a-z0-9]*]] <col:88, line:36:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_40:0x[a-z0-9]*]] <line:35:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_41:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | |-ConstAttr [[ADDR_42:0x[a-z0-9]*]] <line:8:30>
+// C-NEXT: | |-NoThrowAttr [[ADDR_43:0x[a-z0-9]*]] <line:34:29>
+// C-NEXT: | `-AlwaysInlineAttr [[ADDR_44:0x[a-z0-9]*]] <col:38> always_inline
+// C-NEXT: `-FunctionDecl [[ADDR_45:0x[a-z0-9]*]] <line:40:1, line:43:1> line:40:5 main 'int ({{.*}})'
+// C-NEXT: `-CompoundStmt [[ADDR_46:0x[a-z0-9]*]] <col:12, line:43:1>
+// C-NEXT: `-ReturnStmt [[ADDR_47:0x[a-z0-9]*]] <line:42:3, col:74>
+// C-NEXT: `-BinaryOperator [[ADDR_48:0x[a-z0-9]*]] <col:10, col:74> 'int' '+'
+// C-NEXT: |-BinaryOperator [[ADDR_49:0x[a-z0-9]*]] <col:10, col:57> 'int' '+'
+// C-NEXT: | |-BinaryOperator [[ADDR_50:0x[a-z0-9]*]] <col:10, col:40> 'int' '+'
+// C-NEXT: | | |-PseudoObjectExpr [[ADDR_51:0x[a-z0-9]*]] <col:10, col:23> 'int'
+// C-NEXT: | | | |-CallExpr [[ADDR_52:0x[a-z0-9]*]] <col:10, col:23> 'int'
+// C-NEXT: | | | | `-ImplicitCastExpr [[ADDR_53:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | | `-DeclRefExpr [[ADDR_54:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' Function [[ADDR_0]] 'also_before1' 'int ({{.*}})'
+// C-NEXT: | | | `-CallExpr [[ADDR_55:0x[a-z0-9]*]] <line:25:11, line:42:23> 'int'
+// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_56:0x[a-z0-9]*]] <line:25:11> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_5]] <col:11> 'int ({{.*}})' Function [[ADDR_6]] 'also_before1[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: | | `-PseudoObjectExpr [[ADDR_57:0x[a-z0-9]*]] <line:42:27, col:40> 'int'
+// C-NEXT: | | |-CallExpr [[ADDR_58:0x[a-z0-9]*]] <col:27, col:40> 'int'
+// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_59:0x[a-z0-9]*]] <col:27> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_60:0x[a-z0-9]*]] <col:27> 'int ({{.*}})' Function [[ADDR_7]] 'also_before2' 'int ({{.*}})'
+// C-NEXT: | | `-CallExpr [[ADDR_61:0x[a-z0-9]*]] <line:28:12, line:42:40> 'int'
+// C-NEXT: | | `-ImplicitCastExpr [[ADDR_62:0x[a-z0-9]*]] <line:28:12> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | `-DeclRefExpr [[ADDR_12]] <col:12> 'int ({{.*}})' Function [[ADDR_13]] 'also_before2[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: | `-PseudoObjectExpr [[ADDR_63:0x[a-z0-9]*]] <line:42:44, col:57> 'int'
+// C-NEXT: | |-CallExpr [[ADDR_64:0x[a-z0-9]*]] <col:44, col:57> 'int'
+// C-NEXT: | | `-ImplicitCastExpr [[ADDR_65:0x[a-z0-9]*]] <col:44> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | `-DeclRefExpr [[ADDR_66:0x[a-z0-9]*]] <col:44> 'int ({{.*}})' Function [[ADDR_14]] 'also_before3' 'int ({{.*}})'
+// C-NEXT: | `-CallExpr [[ADDR_67:0x[a-z0-9]*]] <line:31:30, line:42:57> 'int'
+// C-NEXT: | `-ImplicitCastExpr [[ADDR_68:0x[a-z0-9]*]] <line:31:30> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | `-DeclRefExpr [[ADDR_19]] <col:30> 'int ({{.*}})' Function [[ADDR_20]] 'also_before3[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: `-PseudoObjectExpr [[ADDR_69:0x[a-z0-9]*]] <line:42:61, col:74> 'int'
+// C-NEXT: |-CallExpr [[ADDR_70:0x[a-z0-9]*]] <col:61, col:74> 'int'
+// C-NEXT: | `-ImplicitCastExpr [[ADDR_71:0x[a-z0-9]*]] <col:61> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | `-DeclRefExpr [[ADDR_72:0x[a-z0-9]*]] <col:61> 'int ({{.*}})' Function [[ADDR_21]] 'also_before4' 'int ({{.*}})'
+// C-NEXT: `-CallExpr [[ADDR_73:0x[a-z0-9]*]] <line:34:69, line:42:74> 'int'
+// C-NEXT: `-ImplicitCastExpr [[ADDR_74:0x[a-z0-9]*]] <line:34:69> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: `-DeclRefExpr [[ADDR_26]] <col:69> 'int ({{.*}})' Function [[ADDR_27]] 'also_before4[implementation={vendor(llvm)}]' 'int ({{.*}})'
+
+// CXX: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:13:1> line:11:5 implicit used also_before1 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:24, line:13:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:12:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 1
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] <line:25:11> 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before1[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:14:1, line:16:1> line:14:5 implicit used also_before2 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:24, line:16:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:15:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] <col:10> 'int' 2
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_11:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_12:0x[a-z0-9]*]] <line:28:12> 'int ({{.*}})' Function [[ADDR_13:0x[a-z0-9]*]] 'also_before2[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] <line:17:1, line:19:1> line:17:5 implicit used also_before3 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] <col:24, line:19:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] <line:18:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] <col:10> 'int' 3
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_18:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_19:0x[a-z0-9]*]] <line:31:30> 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_20:0x[a-z0-9]*]] 'also_before3[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: |-FunctionDecl [[ADDR_21:0x[a-z0-9]*]] <line:20:1, line:22:1> line:20:5 implicit used also_before4 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_22:0x[a-z0-9]*]] <col:24, line:22:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_23:0x[a-z0-9]*]] <line:21:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_24:0x[a-z0-9]*]] <col:10> 'int' 4
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_25:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_26:0x[a-z0-9]*]] <line:34:69> 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_27:0x[a-z0-9]*]] 'also_before4[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: |-FunctionDecl [[ADDR_6]] <line:6:15, line:27:1> line:25:11 constexpr also_before1[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_28:0x[a-z0-9]*]] <col:30, line:27:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_29:0x[a-z0-9]*]] <line:26:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_30:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: |-FunctionDecl [[ADDR_13]] <line:28:1, line:30:1> line:28:12 also_before2[implementation={vendor(llvm)}] 'int ({{.*}})' static
+// CXX-NEXT: | `-CompoundStmt [[ADDR_31:0x[a-z0-9]*]] <col:31, line:30:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_32:0x[a-z0-9]*]] <line:29:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_33:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: |-FunctionDecl [[ADDR_20]] <line:31:1, line:33:1> line:31:30 also_before3[implementation={vendor(llvm)}] 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_34:0x[a-z0-9]*]] <col:49, line:33:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_35:0x[a-z0-9]*]] <line:32:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_36:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: |-FunctionDecl [[ADDR_27]] <line:34:1, line:36:1> line:34:69 constexpr also_before4[implementation={vendor(llvm)}] 'int ({{.*}}) __attribute__((nothrow))' static inline
+// CXX-NEXT: | |-CompoundStmt [[ADDR_37:0x[a-z0-9]*]] <col:88, line:36:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_38:0x[a-z0-9]*]] <line:35:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_39:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: | `-AlwaysInlineAttr [[ADDR_40:0x[a-z0-9]*]] <line:34:38> always_inline
+// CXX-NEXT: `-FunctionDecl [[ADDR_41:0x[a-z0-9]*]] <line:40:1, line:43:1> line:40:5 main 'int ({{.*}})'
+// CXX-NEXT: `-CompoundStmt [[ADDR_42:0x[a-z0-9]*]] <col:12, line:43:1>
+// CXX-NEXT: `-ReturnStmt [[ADDR_43:0x[a-z0-9]*]] <line:42:3, col:74>
+// CXX-NEXT: `-BinaryOperator [[ADDR_44:0x[a-z0-9]*]] <col:10, col:74> 'int' '+'
+// CXX-NEXT: |-BinaryOperator [[ADDR_45:0x[a-z0-9]*]] <col:10, col:57> 'int' '+'
+// CXX-NEXT: | |-BinaryOperator [[ADDR_46:0x[a-z0-9]*]] <col:10, col:40> 'int' '+'
+// CXX-NEXT: | | |-PseudoObjectExpr [[ADDR_47:0x[a-z0-9]*]] <col:10, col:23> 'int'
+// CXX-NEXT: | | | |-CallExpr [[ADDR_48:0x[a-z0-9]*]] <col:10, col:23> 'int'
+// CXX-NEXT: | | | | `-ImplicitCastExpr [[ADDR_49:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_50:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before1' 'int ({{.*}})'
+// CXX-NEXT: | | | `-CallExpr [[ADDR_51:0x[a-z0-9]*]] <line:25:11, line:42:23> 'int'
+// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_52:0x[a-z0-9]*]] <line:25:11> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_5]] <col:11> 'int ({{.*}})' Function [[ADDR_6]] 'also_before1[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: | | `-PseudoObjectExpr [[ADDR_53:0x[a-z0-9]*]] <line:42:27, col:40> 'int'
+// CXX-NEXT: | | |-CallExpr [[ADDR_54:0x[a-z0-9]*]] <col:27, col:40> 'int'
+// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_55:0x[a-z0-9]*]] <col:27> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_56:0x[a-z0-9]*]] <col:27> 'int ({{.*}})' {{.*}}Function [[ADDR_7]] 'also_before2' 'int ({{.*}})'
+// CXX-NEXT: | | `-CallExpr [[ADDR_57:0x[a-z0-9]*]] <line:28:12, line:42:40> 'int'
+// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_58:0x[a-z0-9]*]] <line:28:12> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | `-DeclRefExpr [[ADDR_12]] <col:12> 'int ({{.*}})' Function [[ADDR_13]] 'also_before2[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: | `-PseudoObjectExpr [[ADDR_59:0x[a-z0-9]*]] <line:42:44, col:57> 'int'
+// CXX-NEXT: | |-CallExpr [[ADDR_60:0x[a-z0-9]*]] <col:44, col:57> 'int'
+// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_61:0x[a-z0-9]*]] <col:44> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | `-DeclRefExpr [[ADDR_62:0x[a-z0-9]*]] <col:44> 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'also_before3' 'int ({{.*}})'
+// CXX-NEXT: | `-CallExpr [[ADDR_63:0x[a-z0-9]*]] <line:31:30, line:42:57> 'int'
+// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_64:0x[a-z0-9]*]] <line:31:30> 'int (*)({{.*}}) __attribute__((nothrow))' <FunctionToPointerDecay>
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_19]] <col:30> 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_20]] 'also_before3[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: `-PseudoObjectExpr [[ADDR_65:0x[a-z0-9]*]] <line:42:61, col:74> 'int'
+// CXX-NEXT: |-CallExpr [[ADDR_66:0x[a-z0-9]*]] <col:61, col:74> 'int'
+// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_67:0x[a-z0-9]*]] <col:61> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_68:0x[a-z0-9]*]] <col:61> 'int ({{.*}})' {{.*}}Function [[ADDR_21]] 'also_before4' 'int ({{.*}})'
+// CXX-NEXT: `-CallExpr [[ADDR_69:0x[a-z0-9]*]] <line:34:69, line:42:74> 'int'
+// CXX-NEXT: `-ImplicitCastExpr [[ADDR_70:0x[a-z0-9]*]] <line:34:69> 'int (*)({{.*}}) __attribute__((nothrow))' <FunctionToPointerDecay>
+// CXX-NEXT: `-DeclRefExpr [[ADDR_26]] <col:69> 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_27]] 'also_before4[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))'
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_11.c b/clang/test/AST/ast-dump-openmp-begin-declare-variant_11.c
new file mode 100644
index 000000000000..cdc1d78a8fd0
--- /dev/null
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_11.c
@@ -0,0 +1,228 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify=c_mode -ast-dump %s | FileCheck %s --check-prefix=C
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify=cxx_mode -ast-dump %s -x c++| FileCheck %s --check-prefix=CXX
+
+// c_mode-no-diagnostics
+
+#ifdef __cplusplus
+#define CONST constexpr
+#else
+#define CONST __attribute__((const))
+#endif
+
+#pragma omp begin declare variant match(implementation = {vendor(llvm)})
+CONST int also_after1(void) { // cxx_mode-note {{previous declaration is here}}
+ return 0;
+}
+static int also_after2(void) {
+ return 0;
+}
+__attribute__((nothrow)) int also_after3(void) {
+ return 0;
+}
+static CONST __attribute__((nothrow, always_inline)) __inline__ int also_after4(void) { // cxx_mode-note {{previous declaration is here}}
+ return 0;
+}
+#pragma omp end declare variant
+
+int also_after1(void) { // cxx_mode-error {{non-constexpr declaration of 'also_after1' follows constexpr declaration}}
+ return 1;
+}
+int also_after2(void) {
+ return 2;
+}
+int also_after3(void) {
+ return 3;
+}
+int also_after4(void) { // cxx_mode-error {{non-constexpr declaration of 'also_after4' follows constexpr declaration}}
+ return 4;
+}
+
+
+int main() {
+ // Should return 0.
+ return also_after1() + also_after2() + also_after3() + also_after4();
+}
+
+// Make sure:
+// - we see the specialization in the AST
+// - we pick the right callees
+
+// C: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:15:1> line:13:11 also_after1[implementation={vendor(llvm)}] 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:29, line:15:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:14:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-ConstAttr [[ADDR_4:0x[a-z0-9]*]] <line:9:30>
+// C-NEXT: |-FunctionDecl [[ADDR_5:0x[a-z0-9]*]] <line:13:11> col:11 implicit used also_after1 'int ({{.*}})'
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_6:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_7:0x[a-z0-9]*]] <col:11> 'int ({{.*}})' Function [[ADDR_0]] 'also_after1[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_8:0x[a-z0-9]*]] <line:16:1, line:18:1> line:16:12 also_after2[implementation={vendor(llvm)}] 'int ({{.*}})' static
+// C-NEXT: | `-CompoundStmt [[ADDR_9:0x[a-z0-9]*]] <col:30, line:18:1>
+// C-NEXT: | `-ReturnStmt [[ADDR_10:0x[a-z0-9]*]] <line:17:3, col:10>
+// C-NEXT: | `-IntegerLiteral [[ADDR_11:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: |-FunctionDecl [[ADDR_12:0x[a-z0-9]*]] <line:16:12> col:12 implicit used also_after2 'int ({{.*}})'
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_13:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_14:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' Function [[ADDR_8]] 'also_after2[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_15:0x[a-z0-9]*]] <line:19:1, line:21:1> line:19:30 also_after3[implementation={vendor(llvm)}] 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_16:0x[a-z0-9]*]] <col:48, line:21:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_17:0x[a-z0-9]*]] <line:20:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_18:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-NoThrowAttr [[ADDR_19:0x[a-z0-9]*]] <line:19:16>
+// C-NEXT: |-FunctionDecl [[ADDR_20:0x[a-z0-9]*]] <col:30> col:30 implicit used also_after3 'int ({{.*}})'
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_22:0x[a-z0-9]*]] <col:30> 'int ({{.*}})' Function [[ADDR_15]] 'also_after3[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] <line:22:1, line:24:1> line:22:69 also_after4[implementation={vendor(llvm)}] 'int ({{.*}})' static inline
+// C-NEXT: | |-CompoundStmt [[ADDR_24:0x[a-z0-9]*]] <col:87, line:24:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_25:0x[a-z0-9]*]] <line:23:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_26:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | |-ConstAttr [[ADDR_27:0x[a-z0-9]*]] <line:9:30>
+// C-NEXT: | |-NoThrowAttr [[ADDR_28:0x[a-z0-9]*]] <line:22:29>
+// C-NEXT: | `-AlwaysInlineAttr [[ADDR_29:0x[a-z0-9]*]] <col:38> always_inline
+// C-NEXT: |-FunctionDecl [[ADDR_30:0x[a-z0-9]*]] <col:69> col:69 implicit used also_after4 'int ({{.*}})'
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_31:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] <col:69> 'int ({{.*}})' Function [[ADDR_23]] 'also_after4[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_33:0x[a-z0-9]*]] prev [[ADDR_5]] <line:27:1, line:29:1> line:27:5 used also_after1 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_34:0x[a-z0-9]*]] <col:23, line:29:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_35:0x[a-z0-9]*]] <line:28:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_36:0x[a-z0-9]*]] <col:10> 'int' 1
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_37:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_7]] <line:13:11> 'int ({{.*}})' Function [[ADDR_0]] 'also_after1[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_38:0x[a-z0-9]*]] prev [[ADDR_12]] <line:30:1, line:32:1> line:30:5 used also_after2 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_39:0x[a-z0-9]*]] <col:23, line:32:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_40:0x[a-z0-9]*]] <line:31:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_41:0x[a-z0-9]*]] <col:10> 'int' 2
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_42:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_14]] <line:16:12> 'int ({{.*}})' Function [[ADDR_8]] 'also_after2[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_43:0x[a-z0-9]*]] prev [[ADDR_20]] <line:33:1, line:35:1> line:33:5 used also_after3 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_44:0x[a-z0-9]*]] <col:23, line:35:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_45:0x[a-z0-9]*]] <line:34:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_46:0x[a-z0-9]*]] <col:10> 'int' 3
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_47:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_22]] <line:19:30> 'int ({{.*}})' Function [[ADDR_15]] 'also_after3[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_48:0x[a-z0-9]*]] prev [[ADDR_30]] <line:36:1, line:38:1> line:36:5 used also_after4 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_49:0x[a-z0-9]*]] <col:23, line:38:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_50:0x[a-z0-9]*]] <line:37:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_51:0x[a-z0-9]*]] <col:10> 'int' 4
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_52:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_32]] <line:22:69> 'int ({{.*}})' Function [[ADDR_23]] 'also_after4[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: `-FunctionDecl [[ADDR_53:0x[a-z0-9]*]] <line:41:1, line:44:1> line:41:5 main 'int ({{.*}})'
+// C-NEXT: `-CompoundStmt [[ADDR_54:0x[a-z0-9]*]] <col:12, line:44:1>
+// C-NEXT: `-ReturnStmt [[ADDR_55:0x[a-z0-9]*]] <line:43:3, col:70>
+// C-NEXT: `-BinaryOperator [[ADDR_56:0x[a-z0-9]*]] <col:10, col:70> 'int' '+'
+// C-NEXT: |-BinaryOperator [[ADDR_57:0x[a-z0-9]*]] <col:10, col:54> 'int' '+'
+// C-NEXT: | |-BinaryOperator [[ADDR_58:0x[a-z0-9]*]] <col:10, col:38> 'int' '+'
+// C-NEXT: | | |-PseudoObjectExpr [[ADDR_59:0x[a-z0-9]*]] <col:10, col:22> 'int'
+// C-NEXT: | | | |-CallExpr [[ADDR_60:0x[a-z0-9]*]] <col:10, col:22> 'int'
+// C-NEXT: | | | | `-ImplicitCastExpr [[ADDR_61:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | | `-DeclRefExpr [[ADDR_62:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' Function [[ADDR_33]] 'also_after1' 'int ({{.*}})'
+// C-NEXT: | | | `-CallExpr [[ADDR_63:0x[a-z0-9]*]] <line:13:11, line:43:22> 'int'
+// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_64:0x[a-z0-9]*]] <line:13:11> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_7]] <col:11> 'int ({{.*}})' Function [[ADDR_0]] 'also_after1[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: | | `-PseudoObjectExpr [[ADDR_65:0x[a-z0-9]*]] <line:43:26, col:38> 'int'
+// C-NEXT: | | |-CallExpr [[ADDR_66:0x[a-z0-9]*]] <col:26, col:38> 'int'
+// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_67:0x[a-z0-9]*]] <col:26> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_68:0x[a-z0-9]*]] <col:26> 'int ({{.*}})' Function [[ADDR_38]] 'also_after2' 'int ({{.*}})'
+// C-NEXT: | | `-CallExpr [[ADDR_69:0x[a-z0-9]*]] <line:16:12, line:43:38> 'int'
+// C-NEXT: | | `-ImplicitCastExpr [[ADDR_70:0x[a-z0-9]*]] <line:16:12> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | `-DeclRefExpr [[ADDR_14]] <col:12> 'int ({{.*}})' Function [[ADDR_8]] 'also_after2[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: | `-PseudoObjectExpr [[ADDR_71:0x[a-z0-9]*]] <line:43:42, col:54> 'int'
+// C-NEXT: | |-CallExpr [[ADDR_72:0x[a-z0-9]*]] <col:42, col:54> 'int'
+// C-NEXT: | | `-ImplicitCastExpr [[ADDR_73:0x[a-z0-9]*]] <col:42> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | `-DeclRefExpr [[ADDR_74:0x[a-z0-9]*]] <col:42> 'int ({{.*}})' Function [[ADDR_43]] 'also_after3' 'int ({{.*}})'
+// C-NEXT: | `-CallExpr [[ADDR_75:0x[a-z0-9]*]] <line:19:30, line:43:54> 'int'
+// C-NEXT: | `-ImplicitCastExpr [[ADDR_76:0x[a-z0-9]*]] <line:19:30> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | `-DeclRefExpr [[ADDR_22]] <col:30> 'int ({{.*}})' Function [[ADDR_15]] 'also_after3[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: `-PseudoObjectExpr [[ADDR_77:0x[a-z0-9]*]] <line:43:58, col:70> 'int'
+// C-NEXT: |-CallExpr [[ADDR_78:0x[a-z0-9]*]] <col:58, col:70> 'int'
+// C-NEXT: | `-ImplicitCastExpr [[ADDR_79:0x[a-z0-9]*]] <col:58> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | `-DeclRefExpr [[ADDR_80:0x[a-z0-9]*]] <col:58> 'int ({{.*}})' Function [[ADDR_48]] 'also_after4' 'int ({{.*}})'
+// C-NEXT: `-CallExpr [[ADDR_81:0x[a-z0-9]*]] <line:22:69, line:43:70> 'int'
+// C-NEXT: `-ImplicitCastExpr [[ADDR_82:0x[a-z0-9]*]] <line:22:69> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: `-DeclRefExpr [[ADDR_32]] <col:69> 'int ({{.*}})' Function [[ADDR_23]] 'also_after4[implementation={vendor(llvm)}]' 'int ({{.*}})'
+
+// CXX: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:15:1> line:13:11 constexpr also_after1[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:29, line:15:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:14:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:13:11> col:11 implicit used constexpr also_after1 'int ({{.*}})'
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <col:11> 'int ({{.*}})' Function [[ADDR_0]] 'also_after1[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:16:1, line:18:1> line:16:12 also_after2[implementation={vendor(llvm)}] 'int ({{.*}})' static
+// CXX-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:30, line:18:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:17:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] <line:16:12> col:12 implicit used also_after2 'int ({{.*}})'
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' Function [[ADDR_7]] 'also_after2[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] <line:19:1, line:21:1> line:19:30 also_after3[implementation={vendor(llvm)}] 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] <col:48, line:21:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] <line:20:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] <line:19:30> col:30 implicit used also_after3 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_19:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_20:0x[a-z0-9]*]] <col:30> 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_14]] 'also_after3[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: |-FunctionDecl [[ADDR_21:0x[a-z0-9]*]] <line:22:1, line:24:1> line:22:69 constexpr also_after4[implementation={vendor(llvm)}] 'int ({{.*}}) __attribute__((nothrow))' static inline
+// CXX-NEXT: | |-CompoundStmt [[ADDR_22:0x[a-z0-9]*]] <col:87, line:24:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_23:0x[a-z0-9]*]] <line:23:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_24:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: | `-AlwaysInlineAttr [[ADDR_25:0x[a-z0-9]*]] <line:22:38> always_inline
+// CXX-NEXT: |-FunctionDecl [[ADDR_26:0x[a-z0-9]*]] <col:69> col:69 implicit used constexpr also_after4 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_27:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_28:0x[a-z0-9]*]] <col:69> 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_21]] 'also_after4[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: |-FunctionDecl [[ADDR_29:0x[a-z0-9]*]] <line:27:1, line:29:1> line:27:5 invalid also_after1 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_30:0x[a-z0-9]*]] <col:23, line:29:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_31:0x[a-z0-9]*]] <line:28:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_32:0x[a-z0-9]*]] <col:10> 'int' 1
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_33:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_6]] <line:13:11> 'int ({{.*}})' Function [[ADDR_0]] 'also_after1[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_34:0x[a-z0-9]*]] prev [[ADDR_11]] <line:30:1, line:32:1> line:30:5 used also_after2 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_35:0x[a-z0-9]*]] <col:23, line:32:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_36:0x[a-z0-9]*]] <line:31:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_37:0x[a-z0-9]*]] <col:10> 'int' 2
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_38:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_13]] <line:16:12> 'int ({{.*}})' Function [[ADDR_7]] 'also_after2[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_39:0x[a-z0-9]*]] prev [[ADDR_18]] <line:33:1, line:35:1> line:33:5 used also_after3 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_40:0x[a-z0-9]*]] <col:23, line:35:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_41:0x[a-z0-9]*]] <line:34:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_42:0x[a-z0-9]*]] <col:10> 'int' 3
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_43:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_20]] <line:19:30> 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_14]] 'also_after3[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: |-FunctionDecl [[ADDR_44:0x[a-z0-9]*]] <line:36:1, line:38:1> line:36:5 invalid also_after4 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_45:0x[a-z0-9]*]] <col:23, line:38:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_46:0x[a-z0-9]*]] <line:37:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_47:0x[a-z0-9]*]] <col:10> 'int' 4
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_48:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_28]] <line:22:69> 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_21]] 'also_after4[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: `-FunctionDecl [[ADDR_49:0x[a-z0-9]*]] <line:41:1, line:44:1> line:41:5 main 'int ({{.*}})'
+// CXX-NEXT: `-CompoundStmt [[ADDR_50:0x[a-z0-9]*]] <col:12, line:44:1>
+// CXX-NEXT: `-ReturnStmt [[ADDR_51:0x[a-z0-9]*]] <line:43:3, col:70>
+// CXX-NEXT: `-BinaryOperator [[ADDR_52:0x[a-z0-9]*]] <col:10, col:70> 'int' '+'
+// CXX-NEXT: |-BinaryOperator [[ADDR_53:0x[a-z0-9]*]] <col:10, col:54> 'int' '+'
+// CXX-NEXT: | |-BinaryOperator [[ADDR_54:0x[a-z0-9]*]] <col:10, col:38> 'int' '+'
+// CXX-NEXT: | | |-PseudoObjectExpr [[ADDR_55:0x[a-z0-9]*]] <col:10, col:22> 'int'
+// CXX-NEXT: | | | |-CallExpr [[ADDR_56:0x[a-z0-9]*]] <col:10, col:22> 'int'
+// CXX-NEXT: | | | | `-ImplicitCastExpr [[ADDR_57:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_58:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_4]] 'also_after1' 'int ({{.*}})'
+// CXX-NEXT: | | | `-CallExpr [[ADDR_59:0x[a-z0-9]*]] <line:13:11, line:43:22> 'int'
+// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_60:0x[a-z0-9]*]] <line:13:11> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_6]] <col:11> 'int ({{.*}})' Function [[ADDR_0]] 'also_after1[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: | | `-PseudoObjectExpr [[ADDR_61:0x[a-z0-9]*]] <line:43:26, col:38> 'int'
+// CXX-NEXT: | | |-CallExpr [[ADDR_62:0x[a-z0-9]*]] <col:26, col:38> 'int'
+// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_63:0x[a-z0-9]*]] <col:26> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_64:0x[a-z0-9]*]] <col:26> 'int ({{.*}})' {{.*}}Function [[ADDR_34]] 'also_after2' 'int ({{.*}})'
+// CXX-NEXT: | | `-CallExpr [[ADDR_65:0x[a-z0-9]*]] <line:16:12, line:43:38> 'int'
+// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_66:0x[a-z0-9]*]] <line:16:12> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | `-DeclRefExpr [[ADDR_13]] <col:12> 'int ({{.*}})' Function [[ADDR_7]] 'also_after2[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: | `-PseudoObjectExpr [[ADDR_67:0x[a-z0-9]*]] <line:43:42, col:54> 'int'
+// CXX-NEXT: | |-CallExpr [[ADDR_68:0x[a-z0-9]*]] <col:42, col:54> 'int'
+// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_69:0x[a-z0-9]*]] <col:42> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | `-DeclRefExpr [[ADDR_70:0x[a-z0-9]*]] <col:42> 'int ({{.*}})' {{.*}}Function [[ADDR_39]] 'also_after3' 'int ({{.*}})'
+// CXX-NEXT: | `-CallExpr [[ADDR_71:0x[a-z0-9]*]] <line:19:30, line:43:54> 'int'
+// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_72:0x[a-z0-9]*]] <line:19:30> 'int (*)({{.*}}) __attribute__((nothrow))' <FunctionToPointerDecay>
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_20]] <col:30> 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'also_after3[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: `-PseudoObjectExpr [[ADDR_73:0x[a-z0-9]*]] <line:43:58, col:70> 'int'
+// CXX-NEXT: |-CallExpr [[ADDR_74:0x[a-z0-9]*]] <col:58, col:70> 'int'
+// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_75:0x[a-z0-9]*]] <col:58> 'int (*)({{.*}}) __attribute__((nothrow))' <FunctionToPointerDecay>
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_76:0x[a-z0-9]*]] <col:58> 'int ({{.*}}) __attribute__((nothrow))' {{.*}}Function [[ADDR_26]] 'also_after4' 'int ({{.*}}) __attribute__((nothrow))'
+// CXX-NEXT: `-CallExpr [[ADDR_77:0x[a-z0-9]*]] <line:22:69, line:43:70> 'int'
+// CXX-NEXT: `-ImplicitCastExpr [[ADDR_78:0x[a-z0-9]*]] <line:22:69> 'int (*)({{.*}}) __attribute__((nothrow))' <FunctionToPointerDecay>
+// CXX-NEXT: `-DeclRefExpr [[ADDR_28]] <col:69> 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_21]] 'also_after4[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))'
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_12.c b/clang/test/AST/ast-dump-openmp-begin-declare-variant_12.c
new file mode 100644
index 000000000000..e59091431ba9
--- /dev/null
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_12.c
@@ -0,0 +1,263 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s | FileCheck %s --check-prefix=C
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s -x c++| FileCheck %s --check-prefix=CXX
+// expected-no-diagnostics
+
+#ifdef __cplusplus
+#define OVERLOADABLE
+#else
+#define OVERLOADABLE __attribute__((overloadable))
+#endif
+
+OVERLOADABLE
+int also_before(void) {
+ return 1;
+}
+OVERLOADABLE
+int also_before(int i) {
+ return 2;
+}
+OVERLOADABLE
+int also_before(float f) {
+ return 0;
+}
+OVERLOADABLE
+int also_before(double d) {
+ return 3;
+}
+OVERLOADABLE
+int also_before(long l) {
+ return 4;
+}
+
+#pragma omp begin declare variant match(implementation = {vendor(llvm)})
+OVERLOADABLE
+int also_before(void) {
+ return 0;
+}
+OVERLOADABLE
+int also_before(int i) {
+ return 0;
+}
+// No float!
+OVERLOADABLE
+int also_before(double d) {
+ return 0;
+}
+OVERLOADABLE
+int also_before(long l) {
+ return 0;
+}
+#pragma omp end declare variant
+
+
+int main() {
+ // Should return 0.
+ return also_before() + also_before(1) + also_before(2.0f) + also_before(3.0) + also_before(4L);
+}
+
+// Make sure:
+// - we see the specialization in the AST
+// - we pick the right callees
+
+// C: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:14:1> line:12:5 implicit used also_before 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:14:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:13:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 1
+// C-NEXT: | |-OverloadableAttr [[ADDR_4:0x[a-z0-9]*]] <line:8:37>
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <line:34:5> 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_8:0x[a-z0-9]*]] <line:8:22, line:18:1> line:16:5 implicit used also_before 'int (int)'
+// C-NEXT: | |-ParmVarDecl [[ADDR_9:0x[a-z0-9]*]] <col:17, col:21> col:21 i 'int'
+// C-NEXT: | |-CompoundStmt [[ADDR_10:0x[a-z0-9]*]] <col:24, line:18:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_11:0x[a-z0-9]*]] <line:17:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_12:0x[a-z0-9]*]] <col:10> 'int' 2
+// C-NEXT: | |-OverloadableAttr [[ADDR_13:0x[a-z0-9]*]] <line:8:37>
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_14:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_15:0x[a-z0-9]*]] <line:38:5> 'int (int)' Function [[ADDR_16:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int (int)'
+// C-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] <line:8:22, line:22:1> line:20:5 used also_before 'int (float)'
+// C-NEXT: | |-ParmVarDecl [[ADDR_18:0x[a-z0-9]*]] <col:17, col:23> col:23 f 'float'
+// C-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] <col:26, line:22:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] <line:21:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-OverloadableAttr [[ADDR_22:0x[a-z0-9]*]] <line:8:37>
+// C-NEXT: |-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] <col:22, line:26:1> line:24:5 implicit used also_before 'int (double)'
+// C-NEXT: | |-ParmVarDecl [[ADDR_24:0x[a-z0-9]*]] <col:17, col:24> col:24 d 'double'
+// C-NEXT: | |-CompoundStmt [[ADDR_25:0x[a-z0-9]*]] <col:27, line:26:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_26:0x[a-z0-9]*]] <line:25:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_27:0x[a-z0-9]*]] <col:10> 'int' 3
+// C-NEXT: | |-OverloadableAttr [[ADDR_28:0x[a-z0-9]*]] <line:8:37>
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_29:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_30:0x[a-z0-9]*]] <line:43:5> 'int (double)' Function [[ADDR_31:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int (double)'
+// C-NEXT: |-FunctionDecl [[ADDR_32:0x[a-z0-9]*]] <line:8:22, line:30:1> line:28:5 implicit used also_before 'int (long)'
+// C-NEXT: | |-ParmVarDecl [[ADDR_33:0x[a-z0-9]*]] <col:17, col:22> col:22 l 'long'
+// C-NEXT: | |-CompoundStmt [[ADDR_34:0x[a-z0-9]*]] <col:25, line:30:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_35:0x[a-z0-9]*]] <line:29:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_36:0x[a-z0-9]*]] <col:10> 'int' 4
+// C-NEXT: | |-OverloadableAttr [[ADDR_37:0x[a-z0-9]*]] <line:8:37>
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_38:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] <line:47:5> 'int (long)' Function [[ADDR_40:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int (long)'
+// C-NEXT: |-FunctionDecl [[ADDR_7]] <line:8:22, line:36:1> line:34:5 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_41:0x[a-z0-9]*]] <col:23, line:36:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_42:0x[a-z0-9]*]] <line:35:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_43:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-OverloadableAttr [[ADDR_44:0x[a-z0-9]*]] <line:8:37>
+// C-NEXT: |-FunctionDecl [[ADDR_16]] <col:22, line:40:1> line:38:5 also_before[implementation={vendor(llvm)}] 'int (int)'
+// C-NEXT: | |-ParmVarDecl [[ADDR_45:0x[a-z0-9]*]] <col:17, col:21> col:21 i 'int'
+// C-NEXT: | |-CompoundStmt [[ADDR_46:0x[a-z0-9]*]] <col:24, line:40:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_47:0x[a-z0-9]*]] <line:39:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_48:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-OverloadableAttr [[ADDR_49:0x[a-z0-9]*]] <line:8:37>
+// C-NEXT: |-FunctionDecl [[ADDR_31]] <col:22, line:45:1> line:43:5 also_before[implementation={vendor(llvm)}] 'int (double)'
+// C-NEXT: | |-ParmVarDecl [[ADDR_50:0x[a-z0-9]*]] <col:17, col:24> col:24 d 'double'
+// C-NEXT: | |-CompoundStmt [[ADDR_51:0x[a-z0-9]*]] <col:27, line:45:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_52:0x[a-z0-9]*]] <line:44:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_53:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-OverloadableAttr [[ADDR_54:0x[a-z0-9]*]] <line:8:37>
+// C-NEXT: |-FunctionDecl [[ADDR_40]] <col:22, line:49:1> line:47:5 also_before[implementation={vendor(llvm)}] 'int (long)'
+// C-NEXT: | |-ParmVarDecl [[ADDR_55:0x[a-z0-9]*]] <col:17, col:22> col:22 l 'long'
+// C-NEXT: | |-CompoundStmt [[ADDR_56:0x[a-z0-9]*]] <col:25, line:49:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_57:0x[a-z0-9]*]] <line:48:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_58:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-OverloadableAttr [[ADDR_59:0x[a-z0-9]*]] <line:8:37>
+// C-NEXT: `-FunctionDecl [[ADDR_60:0x[a-z0-9]*]] <line:53:1, line:56:1> line:53:5 main 'int ({{.*}})'
+// C-NEXT: `-CompoundStmt [[ADDR_61:0x[a-z0-9]*]] <col:12, line:56:1>
+// C-NEXT: `-ReturnStmt [[ADDR_62:0x[a-z0-9]*]] <line:55:3, col:96>
+// C-NEXT: `-BinaryOperator [[ADDR_63:0x[a-z0-9]*]] <col:10, col:96> 'int' '+'
+// C-NEXT: |-BinaryOperator [[ADDR_64:0x[a-z0-9]*]] <col:10, col:78> 'int' '+'
+// C-NEXT: | |-BinaryOperator [[ADDR_65:0x[a-z0-9]*]] <col:10, col:59> 'int' '+'
+// C-NEXT: | | |-BinaryOperator [[ADDR_66:0x[a-z0-9]*]] <col:10, col:39> 'int' '+'
+// C-NEXT: | | | |-PseudoObjectExpr [[ADDR_67:0x[a-z0-9]*]] <col:10, col:22> 'int'
+// C-NEXT: | | | | |-CallExpr [[ADDR_68:0x[a-z0-9]*]] <col:10, col:22> 'int'
+// C-NEXT: | | | | | `-ImplicitCastExpr [[ADDR_69:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | | | `-DeclRefExpr [[ADDR_70:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
+// C-NEXT: | | | | `-CallExpr [[ADDR_71:0x[a-z0-9]*]] <line:34:5, line:55:22> 'int'
+// C-NEXT: | | | | `-ImplicitCastExpr [[ADDR_72:0x[a-z0-9]*]] <line:34:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | | `-DeclRefExpr [[ADDR_6]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: | | | `-PseudoObjectExpr [[ADDR_73:0x[a-z0-9]*]] <line:55:26, col:39> 'int'
+// C-NEXT: | | | |-CallExpr [[ADDR_74:0x[a-z0-9]*]] <col:26, col:39> 'int'
+// C-NEXT: | | | | |-ImplicitCastExpr [[ADDR_75:0x[a-z0-9]*]] <col:26> 'int (*)(int)' <FunctionToPointerDecay>
+// C-NEXT: | | | | | `-DeclRefExpr [[ADDR_76:0x[a-z0-9]*]] <col:26> 'int (int)' {{.*}}Function [[ADDR_8]] 'also_before' 'int (int)'
+// C-NEXT: | | | | `-IntegerLiteral [[ADDR_77:0x[a-z0-9]*]] <col:38> 'int' 1
+// C-NEXT: | | | `-CallExpr [[ADDR_78:0x[a-z0-9]*]] <line:38:5, line:55:39> 'int'
+// C-NEXT: | | | |-ImplicitCastExpr [[ADDR_79:0x[a-z0-9]*]] <line:38:5> 'int (*)(int)' <FunctionToPointerDecay>
+// C-NEXT: | | | | `-DeclRefExpr [[ADDR_15]] <col:5> 'int (int)' Function [[ADDR_16]] 'also_before[implementation={vendor(llvm)}]' 'int (int)'
+// C-NEXT: | | | `-IntegerLiteral [[ADDR_77]] <line:55:38> 'int' 1
+// C-NEXT: | | `-CallExpr [[ADDR_80:0x[a-z0-9]*]] <col:43, col:59> 'int'
+// C-NEXT: | | |-ImplicitCastExpr [[ADDR_81:0x[a-z0-9]*]] <col:43> 'int (*)(float)' <FunctionToPointerDecay>
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_82:0x[a-z0-9]*]] <col:43> 'int (float)' {{.*}}Function [[ADDR_17]] 'also_before' 'int (float)'
+// C-NEXT: | | `-FloatingLiteral [[ADDR_83:0x[a-z0-9]*]] <col:55> 'float' 2.000000e+00
+// C-NEXT: | `-PseudoObjectExpr [[ADDR_84:0x[a-z0-9]*]] <col:63, col:78> 'int'
+// C-NEXT: | |-CallExpr [[ADDR_85:0x[a-z0-9]*]] <col:63, col:78> 'int'
+// C-NEXT: | | |-ImplicitCastExpr [[ADDR_86:0x[a-z0-9]*]] <col:63> 'int (*)(double)' <FunctionToPointerDecay>
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_87:0x[a-z0-9]*]] <col:63> 'int (double)' {{.*}}Function [[ADDR_23]] 'also_before' 'int (double)'
+// C-NEXT: | | `-FloatingLiteral [[ADDR_88:0x[a-z0-9]*]] <col:75> 'double' 3.000000e+00
+// C-NEXT: | `-CallExpr [[ADDR_89:0x[a-z0-9]*]] <line:43:5, line:55:78> 'int'
+// C-NEXT: | |-ImplicitCastExpr [[ADDR_90:0x[a-z0-9]*]] <line:43:5> 'int (*)(double)' <FunctionToPointerDecay>
+// C-NEXT: | | `-DeclRefExpr [[ADDR_30]] <col:5> 'int (double)' Function [[ADDR_31]] 'also_before[implementation={vendor(llvm)}]' 'int (double)'
+// C-NEXT: | `-FloatingLiteral [[ADDR_88]] <line:55:75> 'double' 3.000000e+00
+// C-NEXT: `-PseudoObjectExpr [[ADDR_91:0x[a-z0-9]*]] <col:82, col:96> 'int'
+// C-NEXT: |-CallExpr [[ADDR_92:0x[a-z0-9]*]] <col:82, col:96> 'int'
+// C-NEXT: | |-ImplicitCastExpr [[ADDR_93:0x[a-z0-9]*]] <col:82> 'int (*)(long)' <FunctionToPointerDecay>
+// C-NEXT: | | `-DeclRefExpr [[ADDR_94:0x[a-z0-9]*]] <col:82> 'int (long)' {{.*}}Function [[ADDR_32]] 'also_before' 'int (long)'
+// C-NEXT: | `-IntegerLiteral [[ADDR_95:0x[a-z0-9]*]] <col:94> 'long' 4
+// C-NEXT: `-CallExpr [[ADDR_96:0x[a-z0-9]*]] <line:47:5, line:55:96> 'int'
+// C-NEXT: |-ImplicitCastExpr [[ADDR_97:0x[a-z0-9]*]] <line:47:5> 'int (*)(long)' <FunctionToPointerDecay>
+// C-NEXT: | `-DeclRefExpr [[ADDR_39]] <col:5> 'int (long)' Function [[ADDR_40]] 'also_before[implementation={vendor(llvm)}]' 'int (long)'
+// C-NEXT: `-IntegerLiteral [[ADDR_95]] <line:55:94> 'long' 4
+
+// CXX: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:14:1> line:12:5 implicit used also_before 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:14:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:13:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 1
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] <line:34:5> 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:16:1, line:18:1> line:16:5 implicit used also_before 'int (int)'
+// CXX-NEXT: | |-ParmVarDecl [[ADDR_8:0x[a-z0-9]*]] <col:17, col:21> col:21 i 'int'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_9:0x[a-z0-9]*]] <col:24, line:18:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_10:0x[a-z0-9]*]] <line:17:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_11:0x[a-z0-9]*]] <col:10> 'int' 2
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <line:38:5> 'int (int)' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int (int)'
+// CXX-NEXT: |-FunctionDecl [[ADDR_15:0x[a-z0-9]*]] <line:20:1, line:22:1> line:20:5 used also_before 'int (float)'
+// CXX-NEXT: | |-ParmVarDecl [[ADDR_16:0x[a-z0-9]*]] <col:17, col:23> col:23 f 'float'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_17:0x[a-z0-9]*]] <col:26, line:22:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_18:0x[a-z0-9]*]] <line:21:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_19:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: |-FunctionDecl [[ADDR_20:0x[a-z0-9]*]] <line:24:1, line:26:1> line:24:5 implicit used also_before 'int (double)'
+// CXX-NEXT: | |-ParmVarDecl [[ADDR_21:0x[a-z0-9]*]] <col:17, col:24> col:24 d 'double'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_22:0x[a-z0-9]*]] <col:27, line:26:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_23:0x[a-z0-9]*]] <line:25:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_24:0x[a-z0-9]*]] <col:10> 'int' 3
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_25:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_26:0x[a-z0-9]*]] <line:43:5> 'int (double)' Function [[ADDR_27:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int (double)'
+// CXX-NEXT: |-FunctionDecl [[ADDR_28:0x[a-z0-9]*]] <line:28:1, line:30:1> line:28:5 implicit used also_before 'int (long)'
+// CXX-NEXT: | |-ParmVarDecl [[ADDR_29:0x[a-z0-9]*]] <col:17, col:22> col:22 l 'long'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_30:0x[a-z0-9]*]] <col:25, line:30:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_31:0x[a-z0-9]*]] <line:29:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_32:0x[a-z0-9]*]] <col:10> 'int' 4
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_33:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_34:0x[a-z0-9]*]] <line:47:5> 'int (long)' Function [[ADDR_35:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int (long)'
+// CXX-NEXT: |-FunctionDecl [[ADDR_6]] <line:34:1, line:36:1> line:34:5 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_36:0x[a-z0-9]*]] <col:23, line:36:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_37:0x[a-z0-9]*]] <line:35:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_38:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: |-FunctionDecl [[ADDR_14]] <line:38:1, line:40:1> line:38:5 also_before[implementation={vendor(llvm)}] 'int (int)'
+// CXX-NEXT: | |-ParmVarDecl [[ADDR_39:0x[a-z0-9]*]] <col:17, col:21> col:21 i 'int'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_40:0x[a-z0-9]*]] <col:24, line:40:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_41:0x[a-z0-9]*]] <line:39:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_42:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: |-FunctionDecl [[ADDR_27]] <line:43:1, line:45:1> line:43:5 also_before[implementation={vendor(llvm)}] 'int (double)'
+// CXX-NEXT: | |-ParmVarDecl [[ADDR_43:0x[a-z0-9]*]] <col:17, col:24> col:24 d 'double'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_44:0x[a-z0-9]*]] <col:27, line:45:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_45:0x[a-z0-9]*]] <line:44:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_46:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: |-FunctionDecl [[ADDR_35]] <line:47:1, line:49:1> line:47:5 also_before[implementation={vendor(llvm)}] 'int (long)'
+// CXX-NEXT: | |-ParmVarDecl [[ADDR_47:0x[a-z0-9]*]] <col:17, col:22> col:22 l 'long'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_48:0x[a-z0-9]*]] <col:25, line:49:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_49:0x[a-z0-9]*]] <line:48:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_50:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: `-FunctionDecl [[ADDR_51:0x[a-z0-9]*]] <line:53:1, line:56:1> line:53:5 main 'int ({{.*}})'
+// CXX-NEXT: `-CompoundStmt [[ADDR_52:0x[a-z0-9]*]] <col:12, line:56:1>
+// CXX-NEXT: `-ReturnStmt [[ADDR_53:0x[a-z0-9]*]] <line:55:3, col:96>
+// CXX-NEXT: `-BinaryOperator [[ADDR_54:0x[a-z0-9]*]] <col:10, col:96> 'int' '+'
+// CXX-NEXT: |-BinaryOperator [[ADDR_55:0x[a-z0-9]*]] <col:10, col:78> 'int' '+'
+// CXX-NEXT: | |-BinaryOperator [[ADDR_56:0x[a-z0-9]*]] <col:10, col:59> 'int' '+'
+// CXX-NEXT: | | |-BinaryOperator [[ADDR_57:0x[a-z0-9]*]] <col:10, col:39> 'int' '+'
+// CXX-NEXT: | | | |-PseudoObjectExpr [[ADDR_58:0x[a-z0-9]*]] <col:10, col:22> 'int'
+// CXX-NEXT: | | | | |-CallExpr [[ADDR_59:0x[a-z0-9]*]] <col:10, col:22> 'int'
+// CXX-NEXT: | | | | | `-ImplicitCastExpr [[ADDR_60:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | | | `-DeclRefExpr [[ADDR_61:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
+// CXX-NEXT: | | | | `-CallExpr [[ADDR_62:0x[a-z0-9]*]] <line:34:5, line:55:22> 'int'
+// CXX-NEXT: | | | | `-ImplicitCastExpr [[ADDR_63:0x[a-z0-9]*]] <line:34:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_5]] <col:5> 'int ({{.*}})' Function [[ADDR_6]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: | | | `-PseudoObjectExpr [[ADDR_64:0x[a-z0-9]*]] <line:55:26, col:39> 'int'
+// CXX-NEXT: | | | |-CallExpr [[ADDR_65:0x[a-z0-9]*]] <col:26, col:39> 'int'
+// CXX-NEXT: | | | | |-ImplicitCastExpr [[ADDR_66:0x[a-z0-9]*]] <col:26> 'int (*)(int)' <FunctionToPointerDecay>
+// CXX-NEXT: | | | | | `-DeclRefExpr [[ADDR_67:0x[a-z0-9]*]] <col:26> 'int (int)' {{.*}}Function [[ADDR_7]] 'also_before' 'int (int)'
+// CXX-NEXT: | | | | `-IntegerLiteral [[ADDR_68:0x[a-z0-9]*]] <col:38> 'int' 1
+// CXX-NEXT: | | | `-CallExpr [[ADDR_69:0x[a-z0-9]*]] <line:38:5, line:55:39> 'int'
+// CXX-NEXT: | | | |-ImplicitCastExpr [[ADDR_70:0x[a-z0-9]*]] <line:38:5> 'int (*)(int)' <FunctionToPointerDecay>
+// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_13]] <col:5> 'int (int)' Function [[ADDR_14]] 'also_before[implementation={vendor(llvm)}]' 'int (int)'
+// CXX-NEXT: | | | `-IntegerLiteral [[ADDR_68]] <line:55:38> 'int' 1
+// CXX-NEXT: | | `-CallExpr [[ADDR_71:0x[a-z0-9]*]] <col:43, col:59> 'int'
+// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_72:0x[a-z0-9]*]] <col:43> 'int (*)(float)' <FunctionToPointerDecay>
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_73:0x[a-z0-9]*]] <col:43> 'int (float)' {{.*}}Function [[ADDR_15]] 'also_before' 'int (float)'
+// CXX-NEXT: | | `-FloatingLiteral [[ADDR_74:0x[a-z0-9]*]] <col:55> 'float' 2.000000e+00
+// CXX-NEXT: | `-PseudoObjectExpr [[ADDR_75:0x[a-z0-9]*]] <col:63, col:78> 'int'
+// CXX-NEXT: | |-CallExpr [[ADDR_76:0x[a-z0-9]*]] <col:63, col:78> 'int'
+// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_77:0x[a-z0-9]*]] <col:63> 'int (*)(double)' <FunctionToPointerDecay>
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_78:0x[a-z0-9]*]] <col:63> 'int (double)' {{.*}}Function [[ADDR_20]] 'also_before' 'int (double)'
+// CXX-NEXT: | | `-FloatingLiteral [[ADDR_79:0x[a-z0-9]*]] <col:75> 'double' 3.000000e+00
+// CXX-NEXT: | `-CallExpr [[ADDR_80:0x[a-z0-9]*]] <line:43:5, line:55:78> 'int'
+// CXX-NEXT: | |-ImplicitCastExpr [[ADDR_81:0x[a-z0-9]*]] <line:43:5> 'int (*)(double)' <FunctionToPointerDecay>
+// CXX-NEXT: | | `-DeclRefExpr [[ADDR_26]] <col:5> 'int (double)' Function [[ADDR_27]] 'also_before[implementation={vendor(llvm)}]' 'int (double)'
+// CXX-NEXT: | `-FloatingLiteral [[ADDR_79]] <line:55:75> 'double' 3.000000e+00
+// CXX-NEXT: `-PseudoObjectExpr [[ADDR_82:0x[a-z0-9]*]] <col:82, col:96> 'int'
+// CXX-NEXT: |-CallExpr [[ADDR_83:0x[a-z0-9]*]] <col:82, col:96> 'int'
+// CXX-NEXT: | |-ImplicitCastExpr [[ADDR_84:0x[a-z0-9]*]] <col:82> 'int (*)(long)' <FunctionToPointerDecay>
+// CXX-NEXT: | | `-DeclRefExpr [[ADDR_85:0x[a-z0-9]*]] <col:82> 'int (long)' {{.*}}Function [[ADDR_28]] 'also_before' 'int (long)'
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_86:0x[a-z0-9]*]] <col:94> 'long' 4
+// CXX-NEXT: `-CallExpr [[ADDR_87:0x[a-z0-9]*]] <line:47:5, line:55:96> 'int'
+// CXX-NEXT: |-ImplicitCastExpr [[ADDR_88:0x[a-z0-9]*]] <line:47:5> 'int (*)(long)' <FunctionToPointerDecay>
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_34]] <col:5> 'int (long)' Function [[ADDR_35]] 'also_before[implementation={vendor(llvm)}]' 'int (long)'
+// CXX-NEXT: `-IntegerLiteral [[ADDR_86]] <line:55:94> 'long' 4
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_2.c b/clang/test/AST/ast-dump-openmp-begin-declare-variant_2.c
index fda973b1e6c4..497fc3da1efe 100644
--- a/clang/test/AST/ast-dump-openmp-begin-declare-variant_2.c
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_2.c
@@ -33,50 +33,47 @@ int test() {
// - we do see the ast nodes for the llvm vendor
// - we pick the right callees
-// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, col:21> col:5 implicit used also_before 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_1:0x[a-z0-9]*]] <<invalid sloc>> Implicit device={kind(cpu)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_3]] <col:1, line:8:1> line:6:1 also_before[device={kind(cpu)}] 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_4:0x[a-z0-9]*]] <col:23, line:8:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_5:0x[a-z0-9]*]] <line:7:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_6:0x[a-z0-9]*]] <col:10> 'int' 0
-// CHECK-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:12:1, col:20> col:5 implicit used also_after 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(score(100): llvm)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_10]] <col:1, line:14:1> line:12:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:8:1> line:6:5 also_before[device={kind(cpu)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:8:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:7:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
+// CHECK-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:6:5> col:5 implicit used also_before 'int ({{.*}})'
+// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit device={kind(cpu)}
+// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_0]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_7:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(score(0): llvm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_8:0x[a-z0-9]*]] <line:17:5> 'int ({{.*}})' Function [[ADDR_9:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_10:0x[a-z0-9]*]] <line:12:1, line:14:1> line:12:5 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
// CHECK-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] <col:22, line:14:1>
// CHECK-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] <line:13:3, col:10>
// CHECK-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] <col:10> 'int' 0
-// CHECK-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] prev [[ADDR_0]] <line:17:1, col:21> col:5 implicit used also_before 'int ({{.*}})'
-// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_15:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit device={kind(cpu)}
-// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_2]] <line:6:1> 'int ({{.*}})' Function [[ADDR_3]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_16:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(score(0): llvm)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_17:0x[a-z0-9]*]] <line:17:1> 'int ({{.*}})' Function [[ADDR_18:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_18]] <col:1, line:19:1> line:17:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] <col:23, line:19:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] <line:18:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] <col:10> 'int' 1
-// CHECK-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] prev [[ADDR_7]] <line:22:1, line:24:1> line:22:5 used also_after 'int ({{.*}})'
-// CHECK-NEXT: | |-CompoundStmt [[ADDR_23:0x[a-z0-9]*]] <col:22, line:24:1>
-// CHECK-NEXT: | | `-ReturnStmt [[ADDR_24:0x[a-z0-9]*]] <line:23:3, col:10>
-// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_25:0x[a-z0-9]*]] <col:10> 'int' 2
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_26:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(score(100): llvm)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] <line:12:1> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CHECK-NEXT: `-FunctionDecl [[ADDR_27:0x[a-z0-9]*]] <line:26:1, line:29:1> line:26:5 test 'int ({{.*}})'
-// CHECK-NEXT: `-CompoundStmt [[ADDR_28:0x[a-z0-9]*]] <col:12, line:29:1>
-// CHECK-NEXT: `-ReturnStmt [[ADDR_29:0x[a-z0-9]*]] <line:28:3, col:37>
-// CHECK-NEXT: `-BinaryOperator [[ADDR_30:0x[a-z0-9]*]] <col:10, col:37> 'int' '+'
-// CHECK-NEXT: |-PseudoObjectExpr [[ADDR_31:0x[a-z0-9]*]] <col:10, col:21> 'int'
-// CHECK-NEXT: | |-CallExpr [[ADDR_32:0x[a-z0-9]*]] <col:10, col:21> 'int'
-// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_33:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_34:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_22]] 'also_after' 'int ({{.*}})'
-// CHECK-NEXT: | `-CallExpr [[ADDR_35:0x[a-z0-9]*]] <line:12:1, line:28:21> 'int'
-// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_36:0x[a-z0-9]*]] <line:12:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] <col:1> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_37:0x[a-z0-9]*]] <line:28:25, col:37> 'int'
-// CHECK-NEXT: |-CallExpr [[ADDR_38:0x[a-z0-9]*]] <col:25, col:37> 'int'
-// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_39:0x[a-z0-9]*]] <col:25> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] <col:25> 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'also_before' 'int ({{.*}})'
-// CHECK-NEXT: `-CallExpr [[ADDR_41:0x[a-z0-9]*]] <line:6:1, line:28:37> 'int'
-// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] <line:6:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: `-DeclRefExpr [[ADDR_2]] <col:1> 'int ({{.*}})' Function [[ADDR_3]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] <line:12:5> col:5 implicit used also_after 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_15:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(score(100): llvm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_16:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_9]] <line:17:1, line:19:1> line:17:5 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_17:0x[a-z0-9]*]] <col:23, line:19:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_18:0x[a-z0-9]*]] <line:18:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_19:0x[a-z0-9]*]] <col:10> 'int' 1
+// CHECK-NEXT: |-FunctionDecl [[ADDR_20:0x[a-z0-9]*]] prev [[ADDR_14]] <line:22:1, line:24:1> line:22:5 used also_after 'int ({{.*}})'
+// CHECK-NEXT: | |-CompoundStmt [[ADDR_21:0x[a-z0-9]*]] <col:22, line:24:1>
+// CHECK-NEXT: | | `-ReturnStmt [[ADDR_22:0x[a-z0-9]*]] <line:23:3, col:10>
+// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_23:0x[a-z0-9]*]] <col:10> 'int' 2
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_24:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(score(100): llvm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_16]] <line:12:5> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: `-FunctionDecl [[ADDR_25:0x[a-z0-9]*]] <line:26:1, line:29:1> line:26:5 test 'int ({{.*}})'
+// CHECK-NEXT: `-CompoundStmt [[ADDR_26:0x[a-z0-9]*]] <col:12, line:29:1>
+// CHECK-NEXT: `-ReturnStmt [[ADDR_27:0x[a-z0-9]*]] <line:28:3, col:37>
+// CHECK-NEXT: `-BinaryOperator [[ADDR_28:0x[a-z0-9]*]] <col:10, col:37> 'int' '+'
+// CHECK-NEXT: |-PseudoObjectExpr [[ADDR_29:0x[a-z0-9]*]] <col:10, col:21> 'int'
+// CHECK-NEXT: | |-CallExpr [[ADDR_30:0x[a-z0-9]*]] <col:10, col:21> 'int'
+// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_31:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_20]] 'also_after' 'int ({{.*}})'
+// CHECK-NEXT: | `-CallExpr [[ADDR_33:0x[a-z0-9]*]] <line:12:5, line:28:21> 'int'
+// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] <line:12:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_16]] <col:5> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_35:0x[a-z0-9]*]] <line:28:25, col:37> 'int'
+// CHECK-NEXT: |-CallExpr [[ADDR_36:0x[a-z0-9]*]] <col:25, col:37> 'int'
+// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] <col:25> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] <col:25> 'int ({{.*}})' {{.*}}Function [[ADDR_4]] 'also_before' 'int ({{.*}})'
+// CHECK-NEXT: `-CallExpr [[ADDR_39:0x[a-z0-9]*]] <line:6:5, line:28:37> 'int'
+// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_40:0x[a-z0-9]*]] <line:6:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: `-DeclRefExpr [[ADDR_6]] <col:5> 'int ({{.*}})' Function [[ADDR_0]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_3.c b/clang/test/AST/ast-dump-openmp-begin-declare-variant_3.c
index efedd2f9bb74..68ebf896a44e 100644
--- a/clang/test/AST/ast-dump-openmp-begin-declare-variant_3.c
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_3.c
@@ -33,50 +33,47 @@ int test() {
// - we do see the ast nodes for the llvm vendor
// - we pick the right callees
-// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, col:21> col:5 implicit used also_before 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_1:0x[a-z0-9]*]] <<invalid sloc>> Implicit device={kind(cpu)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_3]] <col:1, line:8:1> line:6:1 also_before[device={kind(cpu)}] 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_4:0x[a-z0-9]*]] <col:23, line:8:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_5:0x[a-z0-9]*]] <line:7:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_6:0x[a-z0-9]*]] <col:10> 'int' 1
-// CHECK-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:12:1, col:20> col:5 implicit used also_after 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(score(0): llvm)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_10]] <col:1, line:14:1> line:12:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:8:1> line:6:5 also_before[device={kind(cpu)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:8:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:7:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 1
+// CHECK-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:6:5> col:5 implicit used also_before 'int ({{.*}})'
+// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit device={kind(cpu)}
+// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_0]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_7:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(score(100): llvm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_8:0x[a-z0-9]*]] <line:17:5> 'int ({{.*}})' Function [[ADDR_9:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_10:0x[a-z0-9]*]] <line:12:1, line:14:1> line:12:5 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
// CHECK-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] <col:22, line:14:1>
// CHECK-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] <line:13:3, col:10>
// CHECK-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] <col:10> 'int' 0
-// CHECK-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] prev [[ADDR_0]] <line:17:1, col:21> col:5 implicit used also_before 'int ({{.*}})'
-// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_15:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit device={kind(cpu)}
-// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_2]] <line:6:1> 'int ({{.*}})' Function [[ADDR_3]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_16:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(score(100): llvm)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_17:0x[a-z0-9]*]] <line:17:1> 'int ({{.*}})' Function [[ADDR_18:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_18]] <col:1, line:19:1> line:17:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] <col:23, line:19:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] <line:18:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] <col:10> 'int' 0
-// CHECK-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] prev [[ADDR_7]] <line:22:1, line:24:1> line:22:5 used also_after 'int ({{.*}})'
-// CHECK-NEXT: | |-CompoundStmt [[ADDR_23:0x[a-z0-9]*]] <col:22, line:24:1>
-// CHECK-NEXT: | | `-ReturnStmt [[ADDR_24:0x[a-z0-9]*]] <line:23:3, col:10>
-// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_25:0x[a-z0-9]*]] <col:10> 'int' 2
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_26:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(score(0): llvm)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] <line:12:1> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CHECK-NEXT: `-FunctionDecl [[ADDR_27:0x[a-z0-9]*]] <line:26:1, line:29:1> line:26:5 test 'int ({{.*}})'
-// CHECK-NEXT: `-CompoundStmt [[ADDR_28:0x[a-z0-9]*]] <col:12, line:29:1>
-// CHECK-NEXT: `-ReturnStmt [[ADDR_29:0x[a-z0-9]*]] <line:28:3, col:37>
-// CHECK-NEXT: `-BinaryOperator [[ADDR_30:0x[a-z0-9]*]] <col:10, col:37> 'int' '+'
-// CHECK-NEXT: |-PseudoObjectExpr [[ADDR_31:0x[a-z0-9]*]] <col:10, col:21> 'int'
-// CHECK-NEXT: | |-CallExpr [[ADDR_32:0x[a-z0-9]*]] <col:10, col:21> 'int'
-// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_33:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_34:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_22]] 'also_after' 'int ({{.*}})'
-// CHECK-NEXT: | `-CallExpr [[ADDR_35:0x[a-z0-9]*]] <line:12:1, line:28:21> 'int'
-// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_36:0x[a-z0-9]*]] <line:12:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] <col:1> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_37:0x[a-z0-9]*]] <line:28:25, col:37> 'int'
-// CHECK-NEXT: |-CallExpr [[ADDR_38:0x[a-z0-9]*]] <col:25, col:37> 'int'
-// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_39:0x[a-z0-9]*]] <col:25> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] <col:25> 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'also_before' 'int ({{.*}})'
-// CHECK-NEXT: `-CallExpr [[ADDR_41:0x[a-z0-9]*]] <line:17:1, line:28:37> 'int'
-// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] <line:17:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: `-DeclRefExpr [[ADDR_17]] <col:1> 'int ({{.*}})' Function [[ADDR_18]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] <line:12:5> col:5 implicit used also_after 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_15:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(score(0): llvm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_16:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_9]] <line:17:1, line:19:1> line:17:5 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_17:0x[a-z0-9]*]] <col:23, line:19:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_18:0x[a-z0-9]*]] <line:18:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_19:0x[a-z0-9]*]] <col:10> 'int' 0
+// CHECK-NEXT: |-FunctionDecl [[ADDR_20:0x[a-z0-9]*]] prev [[ADDR_14]] <line:22:1, line:24:1> line:22:5 used also_after 'int ({{.*}})'
+// CHECK-NEXT: | |-CompoundStmt [[ADDR_21:0x[a-z0-9]*]] <col:22, line:24:1>
+// CHECK-NEXT: | | `-ReturnStmt [[ADDR_22:0x[a-z0-9]*]] <line:23:3, col:10>
+// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_23:0x[a-z0-9]*]] <col:10> 'int' 2
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_24:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(score(0): llvm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_16]] <line:12:5> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: `-FunctionDecl [[ADDR_25:0x[a-z0-9]*]] <line:26:1, line:29:1> line:26:5 test 'int ({{.*}})'
+// CHECK-NEXT: `-CompoundStmt [[ADDR_26:0x[a-z0-9]*]] <col:12, line:29:1>
+// CHECK-NEXT: `-ReturnStmt [[ADDR_27:0x[a-z0-9]*]] <line:28:3, col:37>
+// CHECK-NEXT: `-BinaryOperator [[ADDR_28:0x[a-z0-9]*]] <col:10, col:37> 'int' '+'
+// CHECK-NEXT: |-PseudoObjectExpr [[ADDR_29:0x[a-z0-9]*]] <col:10, col:21> 'int'
+// CHECK-NEXT: | |-CallExpr [[ADDR_30:0x[a-z0-9]*]] <col:10, col:21> 'int'
+// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_31:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_20]] 'also_after' 'int ({{.*}})'
+// CHECK-NEXT: | `-CallExpr [[ADDR_33:0x[a-z0-9]*]] <line:12:5, line:28:21> 'int'
+// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] <line:12:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_16]] <col:5> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_35:0x[a-z0-9]*]] <line:28:25, col:37> 'int'
+// CHECK-NEXT: |-CallExpr [[ADDR_36:0x[a-z0-9]*]] <col:25, col:37> 'int'
+// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] <col:25> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] <col:25> 'int ({{.*}})' {{.*}}Function [[ADDR_4]] 'also_before' 'int ({{.*}})'
+// CHECK-NEXT: `-CallExpr [[ADDR_39:0x[a-z0-9]*]] <line:17:5, line:28:37> 'int'
+// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_40:0x[a-z0-9]*]] <line:17:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: `-DeclRefExpr [[ADDR_8]] <col:5> 'int ({{.*}})' Function [[ADDR_9]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_4.c b/clang/test/AST/ast-dump-openmp-begin-declare-variant_4.c
index b35433478e49..01e97c2e3615 100644
--- a/clang/test/AST/ast-dump-openmp-begin-declare-variant_4.c
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_4.c
@@ -21,13 +21,13 @@ int test() {
// - we do see the ast nodes for the cpu kind
// - we pick the right callees
-// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, col:21> col:5 implicit used also_before 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_1:0x[a-z0-9]*]] <<invalid sloc>> Implicit device={kind(cpu)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_3]] <col:1, line:8:1> line:6:1 also_before[device={kind(cpu)}] 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_4:0x[a-z0-9]*]] <col:23, line:8:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_5:0x[a-z0-9]*]] <line:7:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_6:0x[a-z0-9]*]] <col:10> 'int' 0
+// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:8:1> line:6:5 also_before[device={kind(cpu)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:8:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:7:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
+// CHECK-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:6:5> col:5 implicit used also_before 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit device={kind(cpu)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_0]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
// CHECK-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:11:1, line:13:1> line:11:5 used also_after 'int ({{.*}})'
// CHECK-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:22, line:13:1>
// CHECK-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:12:3, col:10>
@@ -42,7 +42,7 @@ int test() {
// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_18:0x[a-z0-9]*]] <col:25, col:37> 'int'
// CHECK-NEXT: |-CallExpr [[ADDR_19:0x[a-z0-9]*]] <col:25, col:37> 'int'
// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_20:0x[a-z0-9]*]] <col:25> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_21:0x[a-z0-9]*]] <col:25> 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
-// CHECK-NEXT: `-CallExpr [[ADDR_22:0x[a-z0-9]*]] <line:6:1, line:17:37> 'int'
-// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_23:0x[a-z0-9]*]] <line:6:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: `-DeclRefExpr [[ADDR_2]] <col:1> 'int ({{.*}})' Function [[ADDR_3]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_21:0x[a-z0-9]*]] <col:25> 'int ({{.*}})' {{.*}}Function [[ADDR_4]] 'also_before' 'int ({{.*}})'
+// CHECK-NEXT: `-CallExpr [[ADDR_22:0x[a-z0-9]*]] <line:6:5, line:17:37> 'int'
+// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_23:0x[a-z0-9]*]] <line:6:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: `-DeclRefExpr [[ADDR_6]] <col:5> 'int ({{.*}})' Function [[ADDR_0]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_5.c b/clang/test/AST/ast-dump-openmp-begin-declare-variant_5.c
index b2a1cb0b3c86..cb01511d015c 100644
--- a/clang/test/AST/ast-dump-openmp-begin-declare-variant_5.c
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_5.c
@@ -31,128 +31,126 @@ int main() {
// - we see the specialization in the AST
// - we pick the right callees
-// C: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 used also_before 'int ({{.*}})'
-// C-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
-// C-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
-// C-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 1
-// C-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:10:1, col:20> col:5 implicit used also_after 'int ({{.*}})'
-// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
-// C-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// C-NEXT: |-FunctionDecl [[ADDR_7]] <col:1, line:12:1> line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
+// C: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 implicit used also_before 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 1
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] <line:13:5> 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:10:1, line:12:1> line:10:5 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
// C-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:22, line:12:1>
// C-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:11:3, col:10>
// C-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] <col:10> 'int' 0
-// C-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] <line:13:1, col:21> col:5 implicit used also_before 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] <line:10:5> col:5 implicit used also_after 'int ({{.*}})'
// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
-// C-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// C-NEXT: |-FunctionDecl [[ADDR_14]] <col:1, line:15:1> line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
-// C-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] <col:23, line:15:1>
-// C-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] <line:14:3, col:10>
-// C-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] <col:10> 'int' 0
-// C-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
-// C-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] <col:22, line:20:1>
-// C-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] <line:19:3, col:10>
-// C-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] <col:10> 'int' 2
-// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
-// C-NEXT: | `-DeclRefExpr [[ADDR_6]] <line:10:1> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// C-NEXT: `-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] <line:22:1, line:28:1> line:22:5 main 'int ({{.*}})'
-// C-NEXT: `-CompoundStmt [[ADDR_24:0x[a-z0-9]*]] <col:12, line:28:1>
-// C-NEXT: `-ReturnStmt [[ADDR_25:0x[a-z0-9]*]] <line:24:3, line:27:25>
-// C-NEXT: `-BinaryOperator [[ADDR_26:0x[a-z0-9]*]] <line:24:10, line:27:25> 'int' '+'
-// C-NEXT: |-BinaryOperator [[ADDR_27:0x[a-z0-9]*]] <line:24:10, line:26:24> 'int' '+'
-// C-NEXT: | |-BinaryOperator [[ADDR_28:0x[a-z0-9]*]] <line:24:10, line:25:24> 'int' '+'
-// C-NEXT: | | |-PseudoObjectExpr [[ADDR_29:0x[a-z0-9]*]] <line:24:10, col:23> 'int'
-// C-NEXT: | | | |-CallExpr [[ADDR_30:0x[a-z0-9]*]] <col:10, col:23> 'int'
-// C-NEXT: | | | | `-ImplicitCastExpr [[ADDR_31:0x[a-z0-9]*]] <col:10, col:21> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// C-NEXT: | | | | `-ParenExpr [[ADDR_32:0x[a-z0-9]*]] <col:10, col:21> 'int ({{.*}})'
-// C-NEXT: | | | | `-DeclRefExpr [[ADDR_33:0x[a-z0-9]*]] <col:11> 'int ({{.*}})' Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// C-NEXT: | | | `-CallExpr [[ADDR_34:0x[a-z0-9]*]] <line:10:1, line:24:23> 'int'
-// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_35:0x[a-z0-9]*]] <line:10:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// C-NEXT: | | | `-DeclRefExpr [[ADDR_6]] <col:1> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// C-NEXT: | | `-PseudoObjectExpr [[ADDR_36:0x[a-z0-9]*]] <line:25:10, col:24> 'int'
-// C-NEXT: | | |-CallExpr [[ADDR_37:0x[a-z0-9]*]] <col:10, col:24> 'int'
-// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_38:0x[a-z0-9]*]] <col:10, col:22> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// C-NEXT: | | | `-ParenExpr [[ADDR_39:0x[a-z0-9]*]] <col:10, col:22> 'int ({{.*}})'
-// C-NEXT: | | | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] <col:11> 'int ({{.*}})' Function [[ADDR_11]] 'also_before' 'int ({{.*}})'
-// C-NEXT: | | `-CallExpr [[ADDR_41:0x[a-z0-9]*]] <line:13:1, line:25:24> 'int'
-// C-NEXT: | | `-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] <line:13:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// C-NEXT: | | `-DeclRefExpr [[ADDR_13]] <col:1> 'int ({{.*}})' Function [[ADDR_14]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// C-NEXT: | `-PseudoObjectExpr [[ADDR_43:0x[a-z0-9]*]] <line:26:10, col:24> 'int'
-// C-NEXT: | |-CallExpr [[ADDR_44:0x[a-z0-9]*]] <col:10, col:24> 'int'
-// C-NEXT: | | `-ParenExpr [[ADDR_45:0x[a-z0-9]*]] <col:10, col:22> 'int (*)({{.*}})'
-// C-NEXT: | | `-UnaryOperator [[ADDR_46:0x[a-z0-9]*]] <col:11, col:12> 'int (*)({{.*}})' prefix '&' cannot overflow
-// C-NEXT: | | `-DeclRefExpr [[ADDR_47:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// C-NEXT: | `-CallExpr [[ADDR_48:0x[a-z0-9]*]] <line:10:1, line:26:24> 'int'
-// C-NEXT: | `-ImplicitCastExpr [[ADDR_49:0x[a-z0-9]*]] <line:10:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// C-NEXT: | `-DeclRefExpr [[ADDR_6]] <col:1> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// C-NEXT: `-PseudoObjectExpr [[ADDR_50:0x[a-z0-9]*]] <line:27:10, col:25> 'int'
-// C-NEXT: |-CallExpr [[ADDR_51:0x[a-z0-9]*]] <col:10, col:25> 'int'
-// C-NEXT: | `-ParenExpr [[ADDR_52:0x[a-z0-9]*]] <col:10, col:23> 'int (*)({{.*}})'
-// C-NEXT: | `-UnaryOperator [[ADDR_53:0x[a-z0-9]*]] <col:11, col:12> 'int (*)({{.*}})' prefix '&' cannot overflow
-// C-NEXT: | `-DeclRefExpr [[ADDR_54:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' Function [[ADDR_11]] 'also_before' 'int ({{.*}})'
-// C-NEXT: `-CallExpr [[ADDR_55:0x[a-z0-9]*]] <line:13:1, line:27:25> 'int'
-// C-NEXT: `-ImplicitCastExpr [[ADDR_56:0x[a-z0-9]*]] <line:13:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// C-NEXT: `-DeclRefExpr [[ADDR_13]] <col:1> 'int ({{.*}})' Function [[ADDR_14]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_6]] <line:13:1, line:15:1> line:13:5 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
+// C-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] <col:23, line:15:1>
+// C-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] <line:14:3, col:10>
+// C-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_11]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] <col:22, line:20:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] <line:19:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] <col:10> 'int' 2
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_13]] <line:10:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: `-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] <line:22:1, line:28:1> line:22:5 main 'int ({{.*}})'
+// C-NEXT: `-CompoundStmt [[ADDR_23:0x[a-z0-9]*]] <col:12, line:28:1>
+// C-NEXT: `-ReturnStmt [[ADDR_24:0x[a-z0-9]*]] <line:24:3, line:27:25>
+// C-NEXT: `-BinaryOperator [[ADDR_25:0x[a-z0-9]*]] <line:24:10, line:27:25> 'int' '+'
+// C-NEXT: |-BinaryOperator [[ADDR_26:0x[a-z0-9]*]] <line:24:10, line:26:24> 'int' '+'
+// C-NEXT: | |-BinaryOperator [[ADDR_27:0x[a-z0-9]*]] <line:24:10, line:25:24> 'int' '+'
+// C-NEXT: | | |-PseudoObjectExpr [[ADDR_28:0x[a-z0-9]*]] <line:24:10, col:23> 'int'
+// C-NEXT: | | | |-CallExpr [[ADDR_29:0x[a-z0-9]*]] <col:10, col:23> 'int'
+// C-NEXT: | | | | `-ImplicitCastExpr [[ADDR_30:0x[a-z0-9]*]] <col:10, col:21> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | | `-ParenExpr [[ADDR_31:0x[a-z0-9]*]] <col:10, col:21> 'int ({{.*}})'
+// C-NEXT: | | | | `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] <col:11> 'int ({{.*}})' Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// C-NEXT: | | | `-CallExpr [[ADDR_33:0x[a-z0-9]*]] <line:10:5, line:24:23> 'int'
+// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] <line:10:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_13]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: | | `-PseudoObjectExpr [[ADDR_35:0x[a-z0-9]*]] <line:25:10, col:24> 'int'
+// C-NEXT: | | |-CallExpr [[ADDR_36:0x[a-z0-9]*]] <col:10, col:24> 'int'
+// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] <col:10, col:22> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | `-ParenExpr [[ADDR_38:0x[a-z0-9]*]] <col:10, col:22> 'int ({{.*}})'
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] <col:11> 'int ({{.*}})' Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
+// C-NEXT: | | `-CallExpr [[ADDR_40:0x[a-z0-9]*]] <line:13:5, line:25:24> 'int'
+// C-NEXT: | | `-ImplicitCastExpr [[ADDR_41:0x[a-z0-9]*]] <line:13:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | `-DeclRefExpr [[ADDR_5]] <col:5> 'int ({{.*}})' Function [[ADDR_6]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: | `-PseudoObjectExpr [[ADDR_42:0x[a-z0-9]*]] <line:26:10, col:24> 'int'
+// C-NEXT: | |-CallExpr [[ADDR_43:0x[a-z0-9]*]] <col:10, col:24> 'int'
+// C-NEXT: | | `-ParenExpr [[ADDR_44:0x[a-z0-9]*]] <col:10, col:22> 'int (*)({{.*}})'
+// C-NEXT: | | `-UnaryOperator [[ADDR_45:0x[a-z0-9]*]] <col:11, col:12> 'int (*)({{.*}})' prefix '&' cannot overflow
+// C-NEXT: | | `-DeclRefExpr [[ADDR_46:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// C-NEXT: | `-CallExpr [[ADDR_47:0x[a-z0-9]*]] <line:10:5, line:26:24> 'int'
+// C-NEXT: | `-ImplicitCastExpr [[ADDR_48:0x[a-z0-9]*]] <line:10:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | `-DeclRefExpr [[ADDR_13]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: `-PseudoObjectExpr [[ADDR_49:0x[a-z0-9]*]] <line:27:10, col:25> 'int'
+// C-NEXT: |-CallExpr [[ADDR_50:0x[a-z0-9]*]] <col:10, col:25> 'int'
+// C-NEXT: | `-ParenExpr [[ADDR_51:0x[a-z0-9]*]] <col:10, col:23> 'int (*)({{.*}})'
+// C-NEXT: | `-UnaryOperator [[ADDR_52:0x[a-z0-9]*]] <col:11, col:12> 'int (*)({{.*}})' prefix '&' cannot overflow
+// C-NEXT: | `-DeclRefExpr [[ADDR_53:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
+// C-NEXT: `-CallExpr [[ADDR_54:0x[a-z0-9]*]] <line:13:5, line:27:25> 'int'
+// C-NEXT: `-ImplicitCastExpr [[ADDR_55:0x[a-z0-9]*]] <line:13:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: `-DeclRefExpr [[ADDR_5]] <col:5> 'int ({{.*}})' Function [[ADDR_6]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 used also_before 'int ({{.*}})'
-// CXX-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
-// CXX-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
-// CXX-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 1
-// CXX-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:10:1, col:20> col:5 implicit used also_after 'int ({{.*}})'
-// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX-NEXT: |-FunctionDecl [[ADDR_7]] <col:1, line:12:1> line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CXX: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 implicit used also_before 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 1
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] <line:13:5> 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:10:1, line:12:1> line:10:5 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
// CXX-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:22, line:12:1>
// CXX-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:11:3, col:10>
// CXX-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] <col:10> 'int' 0
-// CXX-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] <line:13:1, col:21> col:5 implicit used also_before 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] <line:10:5> col:5 implicit used also_after 'int ({{.*}})'
// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX-NEXT: |-FunctionDecl [[ADDR_14]] <col:1, line:15:1> line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
-// CXX-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] <col:23, line:15:1>
-// CXX-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] <line:14:3, col:10>
-// CXX-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] <col:10> 'int' 0
-// CXX-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
-// CXX-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] <col:22, line:20:1>
-// CXX-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] <line:19:3, col:10>
-// CXX-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] <col:10> 'int' 2
-// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_6]] <line:10:1> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX-NEXT: `-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] <line:22:1, line:28:1> line:22:5 main 'int ({{.*}})'
-// CXX-NEXT: `-CompoundStmt [[ADDR_24:0x[a-z0-9]*]] <col:12, line:28:1>
-// CXX-NEXT: `-ReturnStmt [[ADDR_25:0x[a-z0-9]*]] <line:24:3, line:27:25>
-// CXX-NEXT: `-BinaryOperator [[ADDR_26:0x[a-z0-9]*]] <line:24:10, line:27:25> 'int' '+'
-// CXX-NEXT: |-BinaryOperator [[ADDR_27:0x[a-z0-9]*]] <line:24:10, line:26:24> 'int' '+'
-// CXX-NEXT: | |-BinaryOperator [[ADDR_28:0x[a-z0-9]*]] <line:24:10, line:25:24> 'int' '+'
-// CXX-NEXT: | | |-PseudoObjectExpr [[ADDR_29:0x[a-z0-9]*]] <line:24:10, col:23> 'int'
-// CXX-NEXT: | | | |-CallExpr [[ADDR_30:0x[a-z0-9]*]] <col:10, col:23> 'int'
-// CXX-NEXT: | | | | `-ImplicitCastExpr [[ADDR_31:0x[a-z0-9]*]] <col:10, col:21> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CXX-NEXT: | | | | `-ParenExpr [[ADDR_32:0x[a-z0-9]*]] <col:10, col:21> 'int ({{.*}})' lvalue
-// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_33:0x[a-z0-9]*]] <col:11> 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// CXX-NEXT: | | | `-CallExpr [[ADDR_34:0x[a-z0-9]*]] <line:10:1, line:24:23> 'int'
-// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_35:0x[a-z0-9]*]] <line:10:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_6]] <col:1> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX-NEXT: | | `-PseudoObjectExpr [[ADDR_36:0x[a-z0-9]*]] <line:25:10, col:24> 'int'
-// CXX-NEXT: | | |-CallExpr [[ADDR_37:0x[a-z0-9]*]] <col:10, col:24> 'int'
-// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_38:0x[a-z0-9]*]] <col:10, col:22> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CXX-NEXT: | | | `-ParenExpr [[ADDR_39:0x[a-z0-9]*]] <col:10, col:22> 'int ({{.*}})' lvalue
-// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] <col:11> 'int ({{.*}})' {{.*}}Function [[ADDR_11]] 'also_before' 'int ({{.*}})'
-// CXX-NEXT: | | `-CallExpr [[ADDR_41:0x[a-z0-9]*]] <line:13:1, line:25:24> 'int'
-// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] <line:13:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CXX-NEXT: | | `-DeclRefExpr [[ADDR_13]] <col:1> 'int ({{.*}})' Function [[ADDR_14]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX-NEXT: | `-PseudoObjectExpr [[ADDR_43:0x[a-z0-9]*]] <line:26:10, col:24> 'int'
-// CXX-NEXT: | |-CallExpr [[ADDR_44:0x[a-z0-9]*]] <col:10, col:24> 'int'
-// CXX-NEXT: | | `-ParenExpr [[ADDR_45:0x[a-z0-9]*]] <col:10, col:22> 'int (*)({{.*}})'
-// CXX-NEXT: | | `-UnaryOperator [[ADDR_46:0x[a-z0-9]*]] <col:11, col:12> 'int (*)({{.*}})' prefix '&' cannot overflow
-// CXX-NEXT: | | `-DeclRefExpr [[ADDR_47:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// CXX-NEXT: | `-CallExpr [[ADDR_48:0x[a-z0-9]*]] <line:10:1, line:26:24> 'int'
-// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_49:0x[a-z0-9]*]] <line:10:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_6]] <col:1> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX-NEXT: `-PseudoObjectExpr [[ADDR_50:0x[a-z0-9]*]] <line:27:10, col:25> 'int'
-// CXX-NEXT: |-CallExpr [[ADDR_51:0x[a-z0-9]*]] <col:10, col:25> 'int'
-// CXX-NEXT: | `-ParenExpr [[ADDR_52:0x[a-z0-9]*]] <col:10, col:23> 'int (*)({{.*}})'
-// CXX-NEXT: | `-UnaryOperator [[ADDR_53:0x[a-z0-9]*]] <col:11, col:12> 'int (*)({{.*}})' prefix '&' cannot overflow
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_54:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' {{.*}}Function [[ADDR_11]] 'also_before' 'int ({{.*}})'
-// CXX-NEXT: `-CallExpr [[ADDR_55:0x[a-z0-9]*]] <line:13:1, line:27:25> 'int'
-// CXX-NEXT: `-ImplicitCastExpr [[ADDR_56:0x[a-z0-9]*]] <line:13:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CXX-NEXT: `-DeclRefExpr [[ADDR_13]] <col:1> 'int ({{.*}})' Function [[ADDR_14]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_6]] <line:13:1, line:15:1> line:13:5 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] <col:23, line:15:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] <line:14:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_11]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] <col:22, line:20:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] <line:19:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] <col:10> 'int' 2
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_13]] <line:10:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: `-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] <line:22:1, line:28:1> line:22:5 main 'int ({{.*}})'
+// CXX-NEXT: `-CompoundStmt [[ADDR_23:0x[a-z0-9]*]] <col:12, line:28:1>
+// CXX-NEXT: `-ReturnStmt [[ADDR_24:0x[a-z0-9]*]] <line:24:3, line:27:25>
+// CXX-NEXT: `-BinaryOperator [[ADDR_25:0x[a-z0-9]*]] <line:24:10, line:27:25> 'int' '+'
+// CXX-NEXT: |-BinaryOperator [[ADDR_26:0x[a-z0-9]*]] <line:24:10, line:26:24> 'int' '+'
+// CXX-NEXT: | |-BinaryOperator [[ADDR_27:0x[a-z0-9]*]] <line:24:10, line:25:24> 'int' '+'
+// CXX-NEXT: | | |-PseudoObjectExpr [[ADDR_28:0x[a-z0-9]*]] <line:24:10, col:23> 'int'
+// CXX-NEXT: | | | |-CallExpr [[ADDR_29:0x[a-z0-9]*]] <col:10, col:23> 'int'
+// CXX-NEXT: | | | | `-ImplicitCastExpr [[ADDR_30:0x[a-z0-9]*]] <col:10, col:21> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | | `-ParenExpr [[ADDR_31:0x[a-z0-9]*]] <col:10, col:21> 'int ({{.*}})' lvalue
+// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] <col:11> 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// CXX-NEXT: | | | `-CallExpr [[ADDR_33:0x[a-z0-9]*]] <line:10:5, line:24:23> 'int'
+// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] <line:10:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_13]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: | | `-PseudoObjectExpr [[ADDR_35:0x[a-z0-9]*]] <line:25:10, col:24> 'int'
+// CXX-NEXT: | | |-CallExpr [[ADDR_36:0x[a-z0-9]*]] <col:10, col:24> 'int'
+// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] <col:10, col:22> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | `-ParenExpr [[ADDR_38:0x[a-z0-9]*]] <col:10, col:22> 'int ({{.*}})' lvalue
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] <col:11> 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
+// CXX-NEXT: | | `-CallExpr [[ADDR_40:0x[a-z0-9]*]] <line:13:5, line:25:24> 'int'
+// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_41:0x[a-z0-9]*]] <line:13:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | `-DeclRefExpr [[ADDR_5]] <col:5> 'int ({{.*}})' Function [[ADDR_6]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: | `-PseudoObjectExpr [[ADDR_42:0x[a-z0-9]*]] <line:26:10, col:24> 'int'
+// CXX-NEXT: | |-CallExpr [[ADDR_43:0x[a-z0-9]*]] <col:10, col:24> 'int'
+// CXX-NEXT: | | `-ParenExpr [[ADDR_44:0x[a-z0-9]*]] <col:10, col:22> 'int (*)({{.*}})'
+// CXX-NEXT: | | `-UnaryOperator [[ADDR_45:0x[a-z0-9]*]] <col:11, col:12> 'int (*)({{.*}})' prefix '&' cannot overflow
+// CXX-NEXT: | | `-DeclRefExpr [[ADDR_46:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// CXX-NEXT: | `-CallExpr [[ADDR_47:0x[a-z0-9]*]] <line:10:5, line:26:24> 'int'
+// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_48:0x[a-z0-9]*]] <line:10:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_13]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: `-PseudoObjectExpr [[ADDR_49:0x[a-z0-9]*]] <line:27:10, col:25> 'int'
+// CXX-NEXT: |-CallExpr [[ADDR_50:0x[a-z0-9]*]] <col:10, col:25> 'int'
+// CXX-NEXT: | `-ParenExpr [[ADDR_51:0x[a-z0-9]*]] <col:10, col:23> 'int (*)({{.*}})'
+// CXX-NEXT: | `-UnaryOperator [[ADDR_52:0x[a-z0-9]*]] <col:11, col:12> 'int (*)({{.*}})' prefix '&' cannot overflow
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_53:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
+// CXX-NEXT: `-CallExpr [[ADDR_54:0x[a-z0-9]*]] <line:13:5, line:27:25> 'int'
+// CXX-NEXT: `-ImplicitCastExpr [[ADDR_55:0x[a-z0-9]*]] <line:13:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: `-DeclRefExpr [[ADDR_5]] <col:5> 'int ({{.*}})' Function [[ADDR_6]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_6.c b/clang/test/AST/ast-dump-openmp-begin-declare-variant_6.c
index 1e5241bc2c58..ffcd236244b2 100644
--- a/clang/test/AST/ast-dump-openmp-begin-declare-variant_6.c
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_6.c
@@ -28,37 +28,36 @@ int main() {
// - we see the specialization in the AST
// - we do use the original pointers for the calls as the variants are not applicable (this is not the ibm compiler).
-// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 used also_before 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
-// CHECK-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:10:1, col:20> col:5 implicit used also_after 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(ibm)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(ibm)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_7]] <col:1, line:12:1> line:10:1 also_after[implementation={vendor(ibm)}] 'int ({{.*}})'
+// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 implicit used also_before 'int ({{.*}})'
+// CHECK-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
+// CHECK-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
+// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(ibm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] <line:13:5> 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(ibm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:10:1, line:12:1> line:10:5 also_after[implementation={vendor(ibm)}] 'int ({{.*}})'
// CHECK-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:22, line:12:1>
// CHECK-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:11:3, col:10>
// CHECK-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] <col:10> 'int' 1
-// CHECK-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] <line:13:1, col:21> col:5 implicit used also_before 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] <line:10:5> col:5 implicit used also_after 'int ({{.*}})'
// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(ibm)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(ibm)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_14]] <col:1, line:15:1> line:13:1 also_before[implementation={vendor(ibm)}] 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] <col:23, line:15:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] <line:14:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] <col:10> 'int' 2
-// CHECK-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
-// CHECK-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] <col:22, line:20:1>
-// CHECK-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] <line:19:3, col:10>
-// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] <col:10> 'int' 0
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(ibm)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_6]] <line:10:1> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(ibm)}]' 'int ({{.*}})'
-// CHECK-NEXT: `-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] <line:22:1, line:25:1> line:22:5 main 'int ({{.*}})'
-// CHECK-NEXT: `-CompoundStmt [[ADDR_24:0x[a-z0-9]*]] <col:12, line:25:1>
-// CHECK-NEXT: `-ReturnStmt [[ADDR_25:0x[a-z0-9]*]] <line:24:3, col:37>
-// CHECK-NEXT: `-BinaryOperator [[ADDR_26:0x[a-z0-9]*]] <col:10, col:37> 'int' '+'
-// CHECK-NEXT: |-CallExpr [[ADDR_27:0x[a-z0-9]*]] <col:10, col:21> 'int'
-// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_28:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_29:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// CHECK-NEXT: `-CallExpr [[ADDR_30:0x[a-z0-9]*]] <col:25, col:37> 'int'
-// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_31:0x[a-z0-9]*]] <col:25> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] <col:25> 'int ({{.*}})' {{.*}}Function [[ADDR_11]] 'also_before' 'int ({{.*}})'
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(ibm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_6]] <line:13:1, line:15:1> line:13:5 also_before[implementation={vendor(ibm)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] <col:23, line:15:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] <line:14:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] <col:10> 'int' 2
+// CHECK-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_11]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
+// CHECK-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] <col:22, line:20:1>
+// CHECK-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] <line:19:3, col:10>
+// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] <col:10> 'int' 0
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(ibm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_13]] <line:10:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(ibm)}]' 'int ({{.*}})'
+// CHECK-NEXT: `-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] <line:22:1, line:25:1> line:22:5 main 'int ({{.*}})'
+// CHECK-NEXT: `-CompoundStmt [[ADDR_23:0x[a-z0-9]*]] <col:12, line:25:1>
+// CHECK-NEXT: `-ReturnStmt [[ADDR_24:0x[a-z0-9]*]] <line:24:3, col:37>
+// CHECK-NEXT: `-BinaryOperator [[ADDR_25:0x[a-z0-9]*]] <col:10, col:37> 'int' '+'
+// CHECK-NEXT: |-CallExpr [[ADDR_26:0x[a-z0-9]*]] <col:10, col:21> 'int'
+// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_27:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_28:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// CHECK-NEXT: `-CallExpr [[ADDR_29:0x[a-z0-9]*]] <col:25, col:37> 'int'
+// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_30:0x[a-z0-9]*]] <col:25> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: `-DeclRefExpr [[ADDR_31:0x[a-z0-9]*]] <col:25> 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_7.c b/clang/test/AST/ast-dump-openmp-begin-declare-variant_7.c
index cf5c1f3f62c1..070770ace337 100644
--- a/clang/test/AST/ast-dump-openmp-begin-declare-variant_7.c
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_7.c
@@ -34,49 +34,48 @@ int test() {
// We will issue an error during code generation instead. This is similar to the
// diagnosis in other multi-versioning schemes.
-// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, col:14> col:5 used OK_1 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_1:0x[a-z0-9]*]] prev [[ADDR_0]] <line:8:1, col:14> col:5 implicit used OK_1 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_2:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(intel)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_3:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_4:0x[a-z0-9]*]] 'OK_1[implementation={vendor(intel)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_4]] <col:1, line:10:1> line:8:1 OK_1[implementation={vendor(intel)}] 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_5:0x[a-z0-9]*]] <col:16, line:10:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_6:0x[a-z0-9]*]] <line:9:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_7:0x[a-z0-9]*]] <col:10> 'int' 1
-// CHECK-NEXT: |-FunctionDecl [[ADDR_8:0x[a-z0-9]*]] <line:11:1, col:14> col:5 implicit OK_2 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_9:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(intel)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_10:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_11:0x[a-z0-9]*]] 'OK_2[implementation={vendor(intel)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_11]] <col:1, line:13:1> line:11:1 OK_2[implementation={vendor(intel)}] 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_12:0x[a-z0-9]*]] <col:16, line:13:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_13:0x[a-z0-9]*]] <line:12:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_14:0x[a-z0-9]*]] <col:10> 'int' 1
-// CHECK-NEXT: |-FunctionDecl [[ADDR_15:0x[a-z0-9]*]] <line:14:1, col:16> col:5 implicit used not_OK 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_16:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(intel)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_17:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_18:0x[a-z0-9]*]] 'not_OK[implementation={vendor(intel)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_18]] <col:1, line:16:1> line:14:1 not_OK[implementation={vendor(intel)}] 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] <col:18, line:16:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] <line:15:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] <col:10> 'int' 1
-// CHECK-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] <line:17:1, col:14> col:5 implicit used OK_3 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_23:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(intel)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_24:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_25:0x[a-z0-9]*]] 'OK_3[implementation={vendor(intel)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_25]] <col:1, line:19:1> line:17:1 OK_3[implementation={vendor(intel)}] 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_26:0x[a-z0-9]*]] <col:16, line:19:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_27:0x[a-z0-9]*]] <line:18:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_28:0x[a-z0-9]*]] <col:10> 'int' 1
-// CHECK-NEXT: |-FunctionDecl [[ADDR_29:0x[a-z0-9]*]] prev [[ADDR_22]] <line:22:1, col:14> col:5 used OK_3 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_30:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(intel)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_24]] <line:17:1> 'int ({{.*}})' Function [[ADDR_25]] 'OK_3[implementation={vendor(intel)}]' 'int ({{.*}})'
-// CHECK-NEXT: `-FunctionDecl [[ADDR_31:0x[a-z0-9]*]] <line:24:1, line:27:1> line:24:5 test 'int ({{.*}})'
-// CHECK-NEXT: `-CompoundStmt [[ADDR_32:0x[a-z0-9]*]] <col:12, line:27:1>
-// CHECK-NEXT: `-ReturnStmt [[ADDR_33:0x[a-z0-9]*]] <line:26:3, col:35>
-// CHECK-NEXT: `-BinaryOperator [[ADDR_34:0x[a-z0-9]*]] <col:10, col:35> 'int' '+'
-// CHECK-NEXT: |-BinaryOperator [[ADDR_35:0x[a-z0-9]*]] <col:10, col:26> 'int' '+'
-// CHECK-NEXT: | |-CallExpr [[ADDR_36:0x[a-z0-9]*]] <col:10, col:15> 'int'
-// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_1]] 'OK_1' 'int ({{.*}})'
-// CHECK-NEXT: | `-CallExpr [[ADDR_39:0x[a-z0-9]*]] <col:19, col:26> 'int'
-// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_40:0x[a-z0-9]*]] <col:19> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_41:0x[a-z0-9]*]] <col:19> 'int ({{.*}})' {{.*}}Function [[ADDR_15]] 'not_OK' 'int ({{.*}})'
-// CHECK-NEXT: `-CallExpr [[ADDR_42:0x[a-z0-9]*]] <col:30, col:35> 'int'
-// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_43:0x[a-z0-9]*]] <col:30> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: `-DeclRefExpr [[ADDR_44:0x[a-z0-9]*]] <col:30> 'int ({{.*}})' {{.*}}Function [[ADDR_29]] 'OK_3' 'int ({{.*}})'
+// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, col:14> col:5 implicit used OK_1 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_1:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(intel)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] <line:8:5> 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'OK_1[implementation={vendor(intel)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_3]] <col:1, line:10:1> line:8:5 OK_1[implementation={vendor(intel)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_4:0x[a-z0-9]*]] <col:16, line:10:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_5:0x[a-z0-9]*]] <line:9:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_6:0x[a-z0-9]*]] <col:10> 'int' 1
+// CHECK-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:11:1, line:13:1> line:11:5 OK_2[implementation={vendor(intel)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:16, line:13:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:12:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] <col:10> 'int' 1
+// CHECK-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] <line:11:5> col:5 implicit OK_2 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(intel)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'OK_2[implementation={vendor(intel)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] <line:14:1, line:16:1> line:14:5 not_OK[implementation={vendor(intel)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] <col:18, line:16:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] <line:15:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] <col:10> 'int' 1
+// CHECK-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] <line:14:5> col:5 implicit used not_OK 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_19:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(intel)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_20:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_14]] 'not_OK[implementation={vendor(intel)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_21:0x[a-z0-9]*]] <line:17:1, line:19:1> line:17:5 OK_3[implementation={vendor(intel)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_22:0x[a-z0-9]*]] <col:16, line:19:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_23:0x[a-z0-9]*]] <line:18:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_24:0x[a-z0-9]*]] <col:10> 'int' 1
+// CHECK-NEXT: |-FunctionDecl [[ADDR_25:0x[a-z0-9]*]] <line:17:5> col:5 implicit used OK_3 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_26:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(intel)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_27:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_21]] 'OK_3[implementation={vendor(intel)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_28:0x[a-z0-9]*]] prev [[ADDR_25]] <line:22:1, col:14> col:5 used OK_3 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_29:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(intel)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_27]] <line:17:5> 'int ({{.*}})' Function [[ADDR_21]] 'OK_3[implementation={vendor(intel)}]' 'int ({{.*}})'
+// CHECK-NEXT: `-FunctionDecl [[ADDR_30:0x[a-z0-9]*]] <line:24:1, line:27:1> line:24:5 test 'int ({{.*}})'
+// CHECK-NEXT: `-CompoundStmt [[ADDR_31:0x[a-z0-9]*]] <col:12, line:27:1>
+// CHECK-NEXT: `-ReturnStmt [[ADDR_32:0x[a-z0-9]*]] <line:26:3, col:35>
+// CHECK-NEXT: `-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] <col:10, col:35> 'int' '+'
+// CHECK-NEXT: |-BinaryOperator [[ADDR_34:0x[a-z0-9]*]] <col:10, col:26> 'int' '+'
+// CHECK-NEXT: | |-CallExpr [[ADDR_35:0x[a-z0-9]*]] <col:10, col:15> 'int'
+// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_36:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_37:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'OK_1' 'int ({{.*}})'
+// CHECK-NEXT: | `-CallExpr [[ADDR_38:0x[a-z0-9]*]] <col:19, col:26> 'int'
+// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_39:0x[a-z0-9]*]] <col:19> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] <col:19> 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'not_OK' 'int ({{.*}})'
+// CHECK-NEXT: `-CallExpr [[ADDR_41:0x[a-z0-9]*]] <col:30, col:35> 'int'
+// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] <col:30> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: `-DeclRefExpr [[ADDR_43:0x[a-z0-9]*]] <col:30> 'int ({{.*}})' {{.*}}Function [[ADDR_28]] 'OK_3' 'int ({{.*}})'
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_8.c b/clang/test/AST/ast-dump-openmp-begin-declare-variant_8.c
index efedd2f9bb74..68ebf896a44e 100644
--- a/clang/test/AST/ast-dump-openmp-begin-declare-variant_8.c
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_8.c
@@ -33,50 +33,47 @@ int test() {
// - we do see the ast nodes for the llvm vendor
// - we pick the right callees
-// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, col:21> col:5 implicit used also_before 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_1:0x[a-z0-9]*]] <<invalid sloc>> Implicit device={kind(cpu)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_3]] <col:1, line:8:1> line:6:1 also_before[device={kind(cpu)}] 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_4:0x[a-z0-9]*]] <col:23, line:8:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_5:0x[a-z0-9]*]] <line:7:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_6:0x[a-z0-9]*]] <col:10> 'int' 1
-// CHECK-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:12:1, col:20> col:5 implicit used also_after 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(score(0): llvm)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_10]] <col:1, line:14:1> line:12:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CHECK: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:8:1> line:6:5 also_before[device={kind(cpu)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:8:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:7:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 1
+// CHECK-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:6:5> col:5 implicit used also_before 'int ({{.*}})'
+// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit device={kind(cpu)}
+// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_0]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_7:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(score(100): llvm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_8:0x[a-z0-9]*]] <line:17:5> 'int ({{.*}})' Function [[ADDR_9:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_10:0x[a-z0-9]*]] <line:12:1, line:14:1> line:12:5 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
// CHECK-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] <col:22, line:14:1>
// CHECK-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] <line:13:3, col:10>
// CHECK-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] <col:10> 'int' 0
-// CHECK-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] prev [[ADDR_0]] <line:17:1, col:21> col:5 implicit used also_before 'int ({{.*}})'
-// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_15:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit device={kind(cpu)}
-// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_2]] <line:6:1> 'int ({{.*}})' Function [[ADDR_3]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})'
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_16:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(score(100): llvm)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_17:0x[a-z0-9]*]] <line:17:1> 'int ({{.*}})' Function [[ADDR_18:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CHECK-NEXT: |-FunctionDecl [[ADDR_18]] <col:1, line:19:1> line:17:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
-// CHECK-NEXT: | `-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] <col:23, line:19:1>
-// CHECK-NEXT: | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] <line:18:3, col:10>
-// CHECK-NEXT: | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] <col:10> 'int' 0
-// CHECK-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] prev [[ADDR_7]] <line:22:1, line:24:1> line:22:5 used also_after 'int ({{.*}})'
-// CHECK-NEXT: | |-CompoundStmt [[ADDR_23:0x[a-z0-9]*]] <col:22, line:24:1>
-// CHECK-NEXT: | | `-ReturnStmt [[ADDR_24:0x[a-z0-9]*]] <line:23:3, col:10>
-// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_25:0x[a-z0-9]*]] <col:10> 'int' 2
-// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_26:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(score(0): llvm)}
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] <line:12:1> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CHECK-NEXT: `-FunctionDecl [[ADDR_27:0x[a-z0-9]*]] <line:26:1, line:29:1> line:26:5 test 'int ({{.*}})'
-// CHECK-NEXT: `-CompoundStmt [[ADDR_28:0x[a-z0-9]*]] <col:12, line:29:1>
-// CHECK-NEXT: `-ReturnStmt [[ADDR_29:0x[a-z0-9]*]] <line:28:3, col:37>
-// CHECK-NEXT: `-BinaryOperator [[ADDR_30:0x[a-z0-9]*]] <col:10, col:37> 'int' '+'
-// CHECK-NEXT: |-PseudoObjectExpr [[ADDR_31:0x[a-z0-9]*]] <col:10, col:21> 'int'
-// CHECK-NEXT: | |-CallExpr [[ADDR_32:0x[a-z0-9]*]] <col:10, col:21> 'int'
-// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_33:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_34:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_22]] 'also_after' 'int ({{.*}})'
-// CHECK-NEXT: | `-CallExpr [[ADDR_35:0x[a-z0-9]*]] <line:12:1, line:28:21> 'int'
-// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_36:0x[a-z0-9]*]] <line:12:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] <col:1> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_37:0x[a-z0-9]*]] <line:28:25, col:37> 'int'
-// CHECK-NEXT: |-CallExpr [[ADDR_38:0x[a-z0-9]*]] <col:25, col:37> 'int'
-// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_39:0x[a-z0-9]*]] <col:25> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] <col:25> 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'also_before' 'int ({{.*}})'
-// CHECK-NEXT: `-CallExpr [[ADDR_41:0x[a-z0-9]*]] <line:17:1, line:28:37> 'int'
-// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] <line:17:1> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CHECK-NEXT: `-DeclRefExpr [[ADDR_17]] <col:1> 'int ({{.*}})' Function [[ADDR_18]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] <line:12:5> col:5 implicit used also_after 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_15:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(score(0): llvm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_16:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_9]] <line:17:1, line:19:1> line:17:5 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_17:0x[a-z0-9]*]] <col:23, line:19:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_18:0x[a-z0-9]*]] <line:18:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_19:0x[a-z0-9]*]] <col:10> 'int' 0
+// CHECK-NEXT: |-FunctionDecl [[ADDR_20:0x[a-z0-9]*]] prev [[ADDR_14]] <line:22:1, line:24:1> line:22:5 used also_after 'int ({{.*}})'
+// CHECK-NEXT: | |-CompoundStmt [[ADDR_21:0x[a-z0-9]*]] <col:22, line:24:1>
+// CHECK-NEXT: | | `-ReturnStmt [[ADDR_22:0x[a-z0-9]*]] <line:23:3, col:10>
+// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_23:0x[a-z0-9]*]] <col:10> 'int' 2
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_24:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(score(0): llvm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_16]] <line:12:5> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: `-FunctionDecl [[ADDR_25:0x[a-z0-9]*]] <line:26:1, line:29:1> line:26:5 test 'int ({{.*}})'
+// CHECK-NEXT: `-CompoundStmt [[ADDR_26:0x[a-z0-9]*]] <col:12, line:29:1>
+// CHECK-NEXT: `-ReturnStmt [[ADDR_27:0x[a-z0-9]*]] <line:28:3, col:37>
+// CHECK-NEXT: `-BinaryOperator [[ADDR_28:0x[a-z0-9]*]] <col:10, col:37> 'int' '+'
+// CHECK-NEXT: |-PseudoObjectExpr [[ADDR_29:0x[a-z0-9]*]] <col:10, col:21> 'int'
+// CHECK-NEXT: | |-CallExpr [[ADDR_30:0x[a-z0-9]*]] <col:10, col:21> 'int'
+// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_31:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_20]] 'also_after' 'int ({{.*}})'
+// CHECK-NEXT: | `-CallExpr [[ADDR_33:0x[a-z0-9]*]] <line:12:5, line:28:21> 'int'
+// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] <line:12:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_16]] <col:5> 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_35:0x[a-z0-9]*]] <line:28:25, col:37> 'int'
+// CHECK-NEXT: |-CallExpr [[ADDR_36:0x[a-z0-9]*]] <col:25, col:37> 'int'
+// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] <col:25> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] <col:25> 'int ({{.*}})' {{.*}}Function [[ADDR_4]] 'also_before' 'int ({{.*}})'
+// CHECK-NEXT: `-CallExpr [[ADDR_39:0x[a-z0-9]*]] <line:17:5, line:28:37> 'int'
+// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_40:0x[a-z0-9]*]] <line:17:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: `-DeclRefExpr [[ADDR_8]] <col:5> 'int ({{.*}})' Function [[ADDR_9]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_9.c b/clang/test/AST/ast-dump-openmp-begin-declare-variant_9.c
index af61859ae306..d6b5ccece796 100644
--- a/clang/test/AST/ast-dump-openmp-begin-declare-variant_9.c
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_9.c
@@ -35,150 +35,148 @@ int main() {
// - we see the specialization in the AST
// - we pick the right callees
-// C: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 used also_before 'int ({{.*}})'
-// C-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
-// C-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
-// C-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
-// C-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:10:1, col:20> col:5 implicit used also_after 'int ({{.*}})'
-// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
-// C-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// C-NEXT: |-FunctionDecl [[ADDR_7]] <col:1, line:12:1> line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
+// C: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 implicit used also_before 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] <line:13:5> 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:10:1, line:12:1> line:10:5 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
// C-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:22, line:12:1>
// C-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:11:3, col:10>
// C-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] <col:10> 'int' 1
-// C-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] <line:13:1, col:21> col:5 implicit used also_before 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] <line:10:5> col:5 implicit used also_after 'int ({{.*}})'
// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
-// C-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// C-NEXT: |-FunctionDecl [[ADDR_14]] <col:1, line:15:1> line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
-// C-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] <col:23, line:15:1>
-// C-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] <line:14:3, col:10>
-// C-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] <col:10> 'int' 2
-// C-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
-// C-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] <col:22, line:20:1>
-// C-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] <line:19:3, col:10>
-// C-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] <col:10> 'int' 0
-// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
-// C-NEXT: | `-DeclRefExpr [[ADDR_6]] <line:10:1> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// C-NEXT: |-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] <line:22:1, col:10> col:6 used foo 'void ({{.*}})'
-// C-NEXT: |-TypedefDecl [[ADDR_24:0x[a-z0-9]*]] <line:23:1, col:22> col:14 referenced fd 'int (*)({{.*}})'
-// C-NEXT: | `-PointerType [[ADDR_25:0x[a-z0-9]*]] 'int (*)({{.*}})'
-// C-NEXT: | `-ParenType [[ADDR_26:0x[a-z0-9]*]] 'int ({{.*}})' sugar
-// C-NEXT: | `-FunctionProtoType [[ADDR_27:0x[a-z0-9]*]] 'int ({{.*}})' cdecl
-// C-NEXT: | `-BuiltinType [[ADDR_28:0x[a-z0-9]*]] 'int'
-// C-NEXT: `-FunctionDecl [[ADDR_29:0x[a-z0-9]*]] <line:24:1, line:32:1> line:24:5 main 'int ({{.*}})'
-// C-NEXT: `-CompoundStmt [[ADDR_30:0x[a-z0-9]*]] <col:12, line:32:1>
-// C-NEXT: |-DeclStmt [[ADDR_31:0x[a-z0-9]*]] <line:26:3, col:12>
-// C-NEXT: | `-VarDecl [[ADDR_32:0x[a-z0-9]*]] <col:3, col:11> col:6 used fns 'fd [2]'
-// C-NEXT: |-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] <line:27:3, col:13> 'fd':'int (*)({{.*}})' '='
-// C-NEXT: | |-ArraySubscriptExpr [[ADDR_34:0x[a-z0-9]*]] <col:3, col:8> 'fd':'int (*)({{.*}})' lvalue
-// C-NEXT: | | |-ImplicitCastExpr [[ADDR_35:0x[a-z0-9]*]] <col:3> 'fd *' <ArrayToPointerDecay>
-// C-NEXT: | | | `-DeclRefExpr [[ADDR_36:0x[a-z0-9]*]] <col:3> 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]'
-// C-NEXT: | | `-IntegerLiteral [[ADDR_37:0x[a-z0-9]*]] <col:7> 'int' 0
-// C-NEXT: | `-UnaryOperator [[ADDR_38:0x[a-z0-9]*]] <col:12, col:13> 'int (*)({{.*}})' prefix '&' cannot overflow
-// C-NEXT: | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] <col:13> 'int ({{.*}})' Function [[ADDR_11]] 'also_before' 'int ({{.*}})'
-// C-NEXT: |-BinaryOperator [[ADDR_40:0x[a-z0-9]*]] <line:28:3, col:12> 'fd':'int (*)({{.*}})' '='
-// C-NEXT: | |-ArraySubscriptExpr [[ADDR_41:0x[a-z0-9]*]] <col:3, col:8> 'fd':'int (*)({{.*}})' lvalue
-// C-NEXT: | | |-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] <col:3> 'fd *' <ArrayToPointerDecay>
-// C-NEXT: | | | `-DeclRefExpr [[ADDR_43:0x[a-z0-9]*]] <col:3> 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]'
-// C-NEXT: | | `-IntegerLiteral [[ADDR_44:0x[a-z0-9]*]] <col:7> 'int' 1
-// C-NEXT: | `-ImplicitCastExpr [[ADDR_45:0x[a-z0-9]*]] <col:12> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// C-NEXT: | `-DeclRefExpr [[ADDR_46:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// C-NEXT: `-ReturnStmt [[ADDR_47:0x[a-z0-9]*]] <line:29:3, line:31:19>
-// C-NEXT: `-BinaryOperator [[ADDR_48:0x[a-z0-9]*]] <line:29:10, line:31:19> 'int' '+'
-// C-NEXT: |-BinaryOperator [[ADDR_49:0x[a-z0-9]*]] <line:29:10, line:30:19> 'int' '+'
-// C-NEXT: | |-CallExpr [[ADDR_50:0x[a-z0-9]*]] <line:29:10, col:30> 'int'
-// C-NEXT: | | `-ParenExpr [[ADDR_51:0x[a-z0-9]*]] <col:10, col:28> 'int (*)({{.*}})'
-// C-NEXT: | | `-BinaryOperator [[ADDR_52:0x[a-z0-9]*]] <col:11, col:18> 'int (*)({{.*}})' ','
-// C-NEXT: | | |-CallExpr [[ADDR_53:0x[a-z0-9]*]] <col:11, col:15> 'void'
-// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_54:0x[a-z0-9]*]] <col:11> 'void (*)({{.*}})' <FunctionToPointerDecay>
-// C-NEXT: | | | `-DeclRefExpr [[ADDR_55:0x[a-z0-9]*]] <col:11> 'void ({{.*}})' Function [[ADDR_23]] 'foo' 'void ({{.*}})'
-// C-NEXT: | | `-ImplicitCastExpr [[ADDR_56:0x[a-z0-9]*]] <col:18> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// C-NEXT: | | `-DeclRefExpr [[ADDR_57:0x[a-z0-9]*]] <col:18> 'int ({{.*}})' Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// C-NEXT: | `-CallExpr [[ADDR_58:0x[a-z0-9]*]] <line:30:10, col:19> 'int'
-// C-NEXT: | `-ImplicitCastExpr [[ADDR_59:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' <LValueToRValue>
-// C-NEXT: | `-ParenExpr [[ADDR_60:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' lvalue
-// C-NEXT: | `-ArraySubscriptExpr [[ADDR_61:0x[a-z0-9]*]] <col:11, col:16> 'fd':'int (*)({{.*}})' lvalue
-// C-NEXT: | |-ImplicitCastExpr [[ADDR_62:0x[a-z0-9]*]] <col:11> 'fd *' <ArrayToPointerDecay>
-// C-NEXT: | | `-DeclRefExpr [[ADDR_63:0x[a-z0-9]*]] <col:11> 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]'
-// C-NEXT: | `-IntegerLiteral [[ADDR_64:0x[a-z0-9]*]] <col:15> 'int' 0
-// C-NEXT: `-CallExpr [[ADDR_65:0x[a-z0-9]*]] <line:31:10, col:19> 'int'
-// C-NEXT: `-ImplicitCastExpr [[ADDR_66:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' <LValueToRValue>
-// C-NEXT: `-ParenExpr [[ADDR_67:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' lvalue
-// C-NEXT: `-ArraySubscriptExpr [[ADDR_68:0x[a-z0-9]*]] <col:11, col:16> 'fd':'int (*)({{.*}})' lvalue
-// C-NEXT: |-IntegerLiteral [[ADDR_69:0x[a-z0-9]*]] <col:11> 'int' 1
-// C-NEXT: `-ImplicitCastExpr [[ADDR_70:0x[a-z0-9]*]] <col:13> 'fd *' <ArrayToPointerDecay>
-// C-NEXT: `-DeclRefExpr [[ADDR_71:0x[a-z0-9]*]] <col:13> 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]'
+// C-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_6]] <line:13:1, line:15:1> line:13:5 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
+// C-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] <col:23, line:15:1>
+// C-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] <line:14:3, col:10>
+// C-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] <col:10> 'int' 2
+// C-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_11]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] <col:22, line:20:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] <line:19:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_13]] <line:10:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] <line:22:1, col:10> col:6 used foo 'void ({{.*}})'
+// C-NEXT: |-TypedefDecl [[ADDR_23:0x[a-z0-9]*]] <line:23:1, col:22> col:14 referenced fd 'int (*)({{.*}})'
+// C-NEXT: | `-PointerType [[ADDR_24:0x[a-z0-9]*]] 'int (*)({{.*}})'
+// C-NEXT: | `-ParenType [[ADDR_25:0x[a-z0-9]*]] 'int ({{.*}})' sugar
+// C-NEXT: | `-FunctionProtoType [[ADDR_26:0x[a-z0-9]*]] 'int ({{.*}})' cdecl
+// C-NEXT: | `-BuiltinType [[ADDR_27:0x[a-z0-9]*]] 'int'
+// C-NEXT: `-FunctionDecl [[ADDR_28:0x[a-z0-9]*]] <line:24:1, line:32:1> line:24:5 main 'int ({{.*}})'
+// C-NEXT: `-CompoundStmt [[ADDR_29:0x[a-z0-9]*]] <col:12, line:32:1>
+// C-NEXT: |-DeclStmt [[ADDR_30:0x[a-z0-9]*]] <line:26:3, col:12>
+// C-NEXT: | `-VarDecl [[ADDR_31:0x[a-z0-9]*]] <col:3, col:11> col:6 used fns 'fd [2]'
+// C-NEXT: |-BinaryOperator [[ADDR_32:0x[a-z0-9]*]] <line:27:3, col:13> 'fd':'int (*)({{.*}})' '='
+// C-NEXT: | |-ArraySubscriptExpr [[ADDR_33:0x[a-z0-9]*]] <col:3, col:8> 'fd':'int (*)({{.*}})' lvalue
+// C-NEXT: | | |-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] <col:3> 'fd *' <ArrayToPointerDecay>
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_35:0x[a-z0-9]*]] <col:3> 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]'
+// C-NEXT: | | `-IntegerLiteral [[ADDR_36:0x[a-z0-9]*]] <col:7> 'int' 0
+// C-NEXT: | `-UnaryOperator [[ADDR_37:0x[a-z0-9]*]] <col:12, col:13> 'int (*)({{.*}})' prefix '&' cannot overflow
+// C-NEXT: | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] <col:13> 'int ({{.*}})' Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
+// C-NEXT: |-BinaryOperator [[ADDR_39:0x[a-z0-9]*]] <line:28:3, col:12> 'fd':'int (*)({{.*}})' '='
+// C-NEXT: | |-ArraySubscriptExpr [[ADDR_40:0x[a-z0-9]*]] <col:3, col:8> 'fd':'int (*)({{.*}})' lvalue
+// C-NEXT: | | |-ImplicitCastExpr [[ADDR_41:0x[a-z0-9]*]] <col:3> 'fd *' <ArrayToPointerDecay>
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_42:0x[a-z0-9]*]] <col:3> 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]'
+// C-NEXT: | | `-IntegerLiteral [[ADDR_43:0x[a-z0-9]*]] <col:7> 'int' 1
+// C-NEXT: | `-ImplicitCastExpr [[ADDR_44:0x[a-z0-9]*]] <col:12> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | `-DeclRefExpr [[ADDR_45:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// C-NEXT: `-ReturnStmt [[ADDR_46:0x[a-z0-9]*]] <line:29:3, line:31:19>
+// C-NEXT: `-BinaryOperator [[ADDR_47:0x[a-z0-9]*]] <line:29:10, line:31:19> 'int' '+'
+// C-NEXT: |-BinaryOperator [[ADDR_48:0x[a-z0-9]*]] <line:29:10, line:30:19> 'int' '+'
+// C-NEXT: | |-CallExpr [[ADDR_49:0x[a-z0-9]*]] <line:29:10, col:30> 'int'
+// C-NEXT: | | `-ParenExpr [[ADDR_50:0x[a-z0-9]*]] <col:10, col:28> 'int (*)({{.*}})'
+// C-NEXT: | | `-BinaryOperator [[ADDR_51:0x[a-z0-9]*]] <col:11, col:18> 'int (*)({{.*}})' ','
+// C-NEXT: | | |-CallExpr [[ADDR_52:0x[a-z0-9]*]] <col:11, col:15> 'void'
+// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_53:0x[a-z0-9]*]] <col:11> 'void (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_54:0x[a-z0-9]*]] <col:11> 'void ({{.*}})' Function [[ADDR_22]] 'foo' 'void ({{.*}})'
+// C-NEXT: | | `-ImplicitCastExpr [[ADDR_55:0x[a-z0-9]*]] <col:18> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | `-DeclRefExpr [[ADDR_56:0x[a-z0-9]*]] <col:18> 'int ({{.*}})' Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// C-NEXT: | `-CallExpr [[ADDR_57:0x[a-z0-9]*]] <line:30:10, col:19> 'int'
+// C-NEXT: | `-ImplicitCastExpr [[ADDR_58:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' <LValueToRValue>
+// C-NEXT: | `-ParenExpr [[ADDR_59:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' lvalue
+// C-NEXT: | `-ArraySubscriptExpr [[ADDR_60:0x[a-z0-9]*]] <col:11, col:16> 'fd':'int (*)({{.*}})' lvalue
+// C-NEXT: | |-ImplicitCastExpr [[ADDR_61:0x[a-z0-9]*]] <col:11> 'fd *' <ArrayToPointerDecay>
+// C-NEXT: | | `-DeclRefExpr [[ADDR_62:0x[a-z0-9]*]] <col:11> 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]'
+// C-NEXT: | `-IntegerLiteral [[ADDR_63:0x[a-z0-9]*]] <col:15> 'int' 0
+// C-NEXT: `-CallExpr [[ADDR_64:0x[a-z0-9]*]] <line:31:10, col:19> 'int'
+// C-NEXT: `-ImplicitCastExpr [[ADDR_65:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' <LValueToRValue>
+// C-NEXT: `-ParenExpr [[ADDR_66:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' lvalue
+// C-NEXT: `-ArraySubscriptExpr [[ADDR_67:0x[a-z0-9]*]] <col:11, col:16> 'fd':'int (*)({{.*}})' lvalue
+// C-NEXT: |-IntegerLiteral [[ADDR_68:0x[a-z0-9]*]] <col:11> 'int' 1
+// C-NEXT: `-ImplicitCastExpr [[ADDR_69:0x[a-z0-9]*]] <col:13> 'fd *' <ArrayToPointerDecay>
+// C-NEXT: `-DeclRefExpr [[ADDR_70:0x[a-z0-9]*]] <col:13> 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]'
-// CXX: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 used also_before 'int ({{.*}})'
-// CXX-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
-// CXX-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
-// CXX-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
-// CXX-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:10:1, col:20> col:5 implicit used also_after 'int ({{.*}})'
-// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX-NEXT: |-FunctionDecl [[ADDR_7]] <col:1, line:12:1> line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CXX: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 implicit used also_before 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] <line:13:5> 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:10:1, line:12:1> line:10:5 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
// CXX-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:22, line:12:1>
// CXX-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:11:3, col:10>
// CXX-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] <col:10> 'int' 1
-// CXX-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] <line:13:1, col:21> col:5 implicit used also_before 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] <line:10:5> col:5 implicit used also_after 'int ({{.*}})'
// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX-NEXT: |-FunctionDecl [[ADDR_14]] <col:1, line:15:1> line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
-// CXX-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] <col:23, line:15:1>
-// CXX-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] <line:14:3, col:10>
-// CXX-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] <col:10> 'int' 2
-// CXX-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
-// CXX-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] <col:22, line:20:1>
-// CXX-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] <line:19:3, col:10>
-// CXX-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] <col:10> 'int' 0
-// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_6]] <line:10:1> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX-NEXT: |-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] <line:22:1, col:10> col:6 used foo 'void ({{.*}})'
-// CXX-NEXT: |-TypedefDecl [[ADDR_24:0x[a-z0-9]*]] <line:23:1, col:22> col:14 referenced fd 'int (*)({{.*}})'
-// CXX-NEXT: | `-PointerType [[ADDR_25:0x[a-z0-9]*]] 'int (*)({{.*}})'
-// CXX-NEXT: | `-ParenType [[ADDR_26:0x[a-z0-9]*]] 'int ({{.*}})' sugar
-// CXX-NEXT: | `-FunctionProtoType [[ADDR_27:0x[a-z0-9]*]] 'int ({{.*}})' cdecl
-// CXX-NEXT: | `-BuiltinType [[ADDR_28:0x[a-z0-9]*]] 'int'
-// CXX-NEXT: `-FunctionDecl [[ADDR_29:0x[a-z0-9]*]] <line:24:1, line:32:1> line:24:5 main 'int ({{.*}})'
-// CXX-NEXT: `-CompoundStmt [[ADDR_30:0x[a-z0-9]*]] <col:12, line:32:1>
-// CXX-NEXT: |-DeclStmt [[ADDR_31:0x[a-z0-9]*]] <line:26:3, col:12>
-// CXX-NEXT: | `-VarDecl [[ADDR_32:0x[a-z0-9]*]] <col:3, col:11> col:6 used fns 'fd [2]'
-// CXX-NEXT: |-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] <line:27:3, col:13> 'fd':'int (*)({{.*}})' {{.*}}'='
-// CXX-NEXT: | |-ArraySubscriptExpr [[ADDR_34:0x[a-z0-9]*]] <col:3, col:8> 'fd':'int (*)({{.*}})' lvalue
-// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_35:0x[a-z0-9]*]] <col:3> 'fd *' <ArrayToPointerDecay>
-// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_36:0x[a-z0-9]*]] <col:3> 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]'
-// CXX-NEXT: | | `-IntegerLiteral [[ADDR_37:0x[a-z0-9]*]] <col:7> 'int' 0
-// CXX-NEXT: | `-UnaryOperator [[ADDR_38:0x[a-z0-9]*]] <col:12, col:13> 'int (*)({{.*}})' prefix '&' cannot overflow
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] <col:13> 'int ({{.*}})' {{.*}}Function [[ADDR_11]] 'also_before' 'int ({{.*}})'
-// CXX-NEXT: |-BinaryOperator [[ADDR_40:0x[a-z0-9]*]] <line:28:3, col:12> 'fd':'int (*)({{.*}})' {{.*}}'='
-// CXX-NEXT: | |-ArraySubscriptExpr [[ADDR_41:0x[a-z0-9]*]] <col:3, col:8> 'fd':'int (*)({{.*}})' lvalue
-// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] <col:3> 'fd *' <ArrayToPointerDecay>
-// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_43:0x[a-z0-9]*]] <col:3> 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]'
-// CXX-NEXT: | | `-IntegerLiteral [[ADDR_44:0x[a-z0-9]*]] <col:7> 'int' 1
-// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_45:0x[a-z0-9]*]] <col:12> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_46:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// CXX-NEXT: `-ReturnStmt [[ADDR_47:0x[a-z0-9]*]] <line:29:3, line:31:19>
-// CXX-NEXT: `-BinaryOperator [[ADDR_48:0x[a-z0-9]*]] <line:29:10, line:31:19> 'int' '+'
-// CXX-NEXT: |-BinaryOperator [[ADDR_49:0x[a-z0-9]*]] <line:29:10, line:30:19> 'int' '+'
-// CXX-NEXT: | |-CallExpr [[ADDR_50:0x[a-z0-9]*]] <line:29:10, col:30> 'int'
-// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_51:0x[a-z0-9]*]] <col:10, col:28> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CXX-NEXT: | | `-ParenExpr [[ADDR_52:0x[a-z0-9]*]] <col:10, col:28> 'int ({{.*}})' lvalue
-// CXX-NEXT: | | `-BinaryOperator [[ADDR_53:0x[a-z0-9]*]] <col:11, col:18> 'int ({{.*}})' {{.*}}','
-// CXX-NEXT: | | |-CallExpr [[ADDR_54:0x[a-z0-9]*]] <col:11, col:15> 'void'
-// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_55:0x[a-z0-9]*]] <col:11> 'void (*)({{.*}})' <FunctionToPointerDecay>
-// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_56:0x[a-z0-9]*]] <col:11> 'void ({{.*}})' {{.*}}Function [[ADDR_23]] 'foo' 'void ({{.*}})'
-// CXX-NEXT: | | `-DeclRefExpr [[ADDR_57:0x[a-z0-9]*]] <col:18> 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// CXX-NEXT: | `-CallExpr [[ADDR_58:0x[a-z0-9]*]] <line:30:10, col:19> 'int'
-// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_59:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' <LValueToRValue>
-// CXX-NEXT: | `-ParenExpr [[ADDR_60:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' lvalue
-// CXX-NEXT: | `-ArraySubscriptExpr [[ADDR_61:0x[a-z0-9]*]] <col:11, col:16> 'fd':'int (*)({{.*}})' lvalue
-// CXX-NEXT: | |-ImplicitCastExpr [[ADDR_62:0x[a-z0-9]*]] <col:11> 'fd *' <ArrayToPointerDecay>
-// CXX-NEXT: | | `-DeclRefExpr [[ADDR_63:0x[a-z0-9]*]] <col:11> 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]'
-// CXX-NEXT: | `-IntegerLiteral [[ADDR_64:0x[a-z0-9]*]] <col:15> 'int' 0
-// CXX-NEXT: `-CallExpr [[ADDR_65:0x[a-z0-9]*]] <line:31:10, col:19> 'int'
-// CXX-NEXT: `-ImplicitCastExpr [[ADDR_66:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' <LValueToRValue>
-// CXX-NEXT: `-ParenExpr [[ADDR_67:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' lvalue
-// CXX-NEXT: `-ArraySubscriptExpr [[ADDR_68:0x[a-z0-9]*]] <col:11, col:16> 'fd':'int (*)({{.*}})' lvalue
-// CXX-NEXT: |-IntegerLiteral [[ADDR_69:0x[a-z0-9]*]] <col:11> 'int' 1
-// CXX-NEXT: `-ImplicitCastExpr [[ADDR_70:0x[a-z0-9]*]] <col:13> 'fd *' <ArrayToPointerDecay>
-// CXX-NEXT: `-DeclRefExpr [[ADDR_71:0x[a-z0-9]*]] <col:13> 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]'
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_6]] <line:13:1, line:15:1> line:13:5 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] <col:23, line:15:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] <line:14:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] <col:10> 'int' 2
+// CXX-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_11]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] <col:22, line:20:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] <line:19:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_13]] <line:10:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] <line:22:1, col:10> col:6 used foo 'void ({{.*}})'
+// CXX-NEXT: |-TypedefDecl [[ADDR_23:0x[a-z0-9]*]] <line:23:1, col:22> col:14 referenced fd 'int (*)({{.*}})'
+// CXX-NEXT: | `-PointerType [[ADDR_24:0x[a-z0-9]*]] 'int (*)({{.*}})'
+// CXX-NEXT: | `-ParenType [[ADDR_25:0x[a-z0-9]*]] 'int ({{.*}})' sugar
+// CXX-NEXT: | `-FunctionProtoType [[ADDR_26:0x[a-z0-9]*]] 'int ({{.*}})' cdecl
+// CXX-NEXT: | `-BuiltinType [[ADDR_27:0x[a-z0-9]*]] 'int'
+// CXX-NEXT: `-FunctionDecl [[ADDR_28:0x[a-z0-9]*]] <line:24:1, line:32:1> line:24:5 main 'int ({{.*}})'
+// CXX-NEXT: `-CompoundStmt [[ADDR_29:0x[a-z0-9]*]] <col:12, line:32:1>
+// CXX-NEXT: |-DeclStmt [[ADDR_30:0x[a-z0-9]*]] <line:26:3, col:12>
+// CXX-NEXT: | `-VarDecl [[ADDR_31:0x[a-z0-9]*]] <col:3, col:11> col:6 used fns 'fd [2]'
+// CXX-NEXT: |-BinaryOperator [[ADDR_32:0x[a-z0-9]*]] <line:27:3, col:13> 'fd':'int (*)({{.*}})' {{.*}}'='
+// CXX-NEXT: | |-ArraySubscriptExpr [[ADDR_33:0x[a-z0-9]*]] <col:3, col:8> 'fd':'int (*)({{.*}})' lvalue
+// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] <col:3> 'fd *' <ArrayToPointerDecay>
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_35:0x[a-z0-9]*]] <col:3> 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]'
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_36:0x[a-z0-9]*]] <col:7> 'int' 0
+// CXX-NEXT: | `-UnaryOperator [[ADDR_37:0x[a-z0-9]*]] <col:12, col:13> 'int (*)({{.*}})' prefix '&' cannot overflow
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] <col:13> 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
+// CXX-NEXT: |-BinaryOperator [[ADDR_39:0x[a-z0-9]*]] <line:28:3, col:12> 'fd':'int (*)({{.*}})' {{.*}}'='
+// CXX-NEXT: | |-ArraySubscriptExpr [[ADDR_40:0x[a-z0-9]*]] <col:3, col:8> 'fd':'int (*)({{.*}})' lvalue
+// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_41:0x[a-z0-9]*]] <col:3> 'fd *' <ArrayToPointerDecay>
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_42:0x[a-z0-9]*]] <col:3> 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]'
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_43:0x[a-z0-9]*]] <col:7> 'int' 1
+// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_44:0x[a-z0-9]*]] <col:12> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_45:0x[a-z0-9]*]] <col:12> 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// CXX-NEXT: `-ReturnStmt [[ADDR_46:0x[a-z0-9]*]] <line:29:3, line:31:19>
+// CXX-NEXT: `-BinaryOperator [[ADDR_47:0x[a-z0-9]*]] <line:29:10, line:31:19> 'int' '+'
+// CXX-NEXT: |-BinaryOperator [[ADDR_48:0x[a-z0-9]*]] <line:29:10, line:30:19> 'int' '+'
+// CXX-NEXT: | |-CallExpr [[ADDR_49:0x[a-z0-9]*]] <line:29:10, col:30> 'int'
+// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_50:0x[a-z0-9]*]] <col:10, col:28> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | `-ParenExpr [[ADDR_51:0x[a-z0-9]*]] <col:10, col:28> 'int ({{.*}})' lvalue
+// CXX-NEXT: | | `-BinaryOperator [[ADDR_52:0x[a-z0-9]*]] <col:11, col:18> 'int ({{.*}})' {{.*}}','
+// CXX-NEXT: | | |-CallExpr [[ADDR_53:0x[a-z0-9]*]] <col:11, col:15> 'void'
+// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_54:0x[a-z0-9]*]] <col:11> 'void (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_55:0x[a-z0-9]*]] <col:11> 'void ({{.*}})' {{.*}}Function [[ADDR_22]] 'foo' 'void ({{.*}})'
+// CXX-NEXT: | | `-DeclRefExpr [[ADDR_56:0x[a-z0-9]*]] <col:18> 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// CXX-NEXT: | `-CallExpr [[ADDR_57:0x[a-z0-9]*]] <line:30:10, col:19> 'int'
+// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_58:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' <LValueToRValue>
+// CXX-NEXT: | `-ParenExpr [[ADDR_59:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' lvalue
+// CXX-NEXT: | `-ArraySubscriptExpr [[ADDR_60:0x[a-z0-9]*]] <col:11, col:16> 'fd':'int (*)({{.*}})' lvalue
+// CXX-NEXT: | |-ImplicitCastExpr [[ADDR_61:0x[a-z0-9]*]] <col:11> 'fd *' <ArrayToPointerDecay>
+// CXX-NEXT: | | `-DeclRefExpr [[ADDR_62:0x[a-z0-9]*]] <col:11> 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]'
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_63:0x[a-z0-9]*]] <col:15> 'int' 0
+// CXX-NEXT: `-CallExpr [[ADDR_64:0x[a-z0-9]*]] <line:31:10, col:19> 'int'
+// CXX-NEXT: `-ImplicitCastExpr [[ADDR_65:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' <LValueToRValue>
+// CXX-NEXT: `-ParenExpr [[ADDR_66:0x[a-z0-9]*]] <col:10, col:17> 'fd':'int (*)({{.*}})' lvalue
+// CXX-NEXT: `-ArraySubscriptExpr [[ADDR_67:0x[a-z0-9]*]] <col:11, col:16> 'fd':'int (*)({{.*}})' lvalue
+// CXX-NEXT: |-IntegerLiteral [[ADDR_68:0x[a-z0-9]*]] <col:11> 'int' 1
+// CXX-NEXT: `-ImplicitCastExpr [[ADDR_69:0x[a-z0-9]*]] <col:13> 'fd *' <ArrayToPointerDecay>
+// CXX-NEXT: `-DeclRefExpr [[ADDR_70:0x[a-z0-9]*]] <col:13> 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]'
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_addr_1.c b/clang/test/AST/ast-dump-openmp-begin-declare-variant_addr_1.c
index 1cb39dac3c7f..731753f9cb2d 100644
--- a/clang/test/AST/ast-dump-openmp-begin-declare-variant_addr_1.c
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_addr_1.c
@@ -34,118 +34,116 @@ int main() {
// - we see the specialization in the AST
// - we pick the right callees
-// CXX: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 used also_before 'int ({{.*}})'
-// CXX-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
-// CXX-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
-// CXX-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
-// CXX-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:10:1, col:20> col:5 implicit used also_after 'int ({{.*}})'
-// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX-NEXT: |-FunctionDecl [[ADDR_7]] <col:1, line:12:1> line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
-// CXX-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:22, line:12:1>
-// CXX-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:11:3, col:10>
-// CXX-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] <col:10> 'int' 1
-// CXX-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] <line:13:1, col:21> col:5 implicit used also_before 'int ({{.*}})'
-// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX-NEXT: |-FunctionDecl [[ADDR_14]] <col:1, line:15:1> line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
-// CXX-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] <col:23, line:15:1>
-// CXX-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] <line:14:3, col:10>
-// CXX-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] <col:10> 'int' 2
-// CXX-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
-// CXX-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] <col:22, line:20:1>
-// CXX-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] <line:19:3, col:10>
-// CXX-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] <col:10> 'int' 0
-// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_6]] <line:10:1> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// CXX-NEXT: |-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] <line:22:1, line:24:1> line:22:5 used test 'int (int (*)({{.*}}))'
-// CXX-NEXT: | |-ParmVarDecl [[ADDR_24:0x[a-z0-9]*]] <col:10, col:24> col:16 used fd 'int (*)({{.*}})'
-// CXX-NEXT: | `-CompoundStmt [[ADDR_25:0x[a-z0-9]*]] <col:27, line:24:1>
-// CXX-NEXT: | `-ReturnStmt [[ADDR_26:0x[a-z0-9]*]] <line:23:3, col:13>
-// CXX-NEXT: | `-CallExpr [[ADDR_27:0x[a-z0-9]*]] <col:10, col:13> 'int'
-// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_28:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <LValueToRValue>
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_29:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' {{.*}}ParmVar [[ADDR_24]] 'fd' 'int (*)({{.*}})'
-// CXX-NEXT: `-FunctionDecl [[ADDR_30:0x[a-z0-9]*]] <line:25:1, line:31:1> line:25:5 main 'int ({{.*}})'
-// CXX-NEXT: `-CompoundStmt [[ADDR_31:0x[a-z0-9]*]] <col:12, line:31:1>
-// CXX-NEXT: `-ReturnStmt [[ADDR_32:0x[a-z0-9]*]] <line:27:3, line:30:27>
-// CXX-NEXT: `-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] <line:27:10, line:30:27> 'int' '+'
-// CXX-NEXT: |-BinaryOperator [[ADDR_34:0x[a-z0-9]*]] <line:27:10, line:29:26> 'int' '+'
-// CXX-NEXT: | |-BinaryOperator [[ADDR_35:0x[a-z0-9]*]] <line:27:10, line:28:26> 'int' '+'
-// CXX-NEXT: | | |-CallExpr [[ADDR_36:0x[a-z0-9]*]] <line:27:10, col:25> 'int'
-// CXX-NEXT: | | | |-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
-// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))'
-// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_39:0x[a-z0-9]*]] <col:15> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] <col:15> 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// CXX-NEXT: | | `-CallExpr [[ADDR_41:0x[a-z0-9]*]] <line:28:10, col:26> 'int'
-// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
-// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_43:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))'
-// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_44:0x[a-z0-9]*]] <col:15> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// CXX-NEXT: | | `-DeclRefExpr [[ADDR_45:0x[a-z0-9]*]] <col:15> 'int ({{.*}})' {{.*}}Function [[ADDR_11]] 'also_before' 'int ({{.*}})'
-// CXX-NEXT: | `-CallExpr [[ADDR_46:0x[a-z0-9]*]] <line:29:10, col:26> 'int'
-// CXX-NEXT: | |-ImplicitCastExpr [[ADDR_47:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
-// CXX-NEXT: | | `-DeclRefExpr [[ADDR_48:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))'
-// CXX-NEXT: | `-UnaryOperator [[ADDR_49:0x[a-z0-9]*]] <col:15, col:16> 'int (*)({{.*}})' prefix '&' cannot overflow
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_50:0x[a-z0-9]*]] <col:16> 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// CXX-NEXT: `-CallExpr [[ADDR_51:0x[a-z0-9]*]] <line:30:10, col:27> 'int'
-// CXX-NEXT: |-ImplicitCastExpr [[ADDR_52:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
-// CXX-NEXT: | `-DeclRefExpr [[ADDR_53:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))'
-// CXX-NEXT: `-UnaryOperator [[ADDR_54:0x[a-z0-9]*]] <col:15, col:16> 'int (*)({{.*}})' prefix '&' cannot overflow
-// CXX-NEXT: `-DeclRefExpr [[ADDR_55:0x[a-z0-9]*]] <col:16> 'int ({{.*}})' {{.*}}Function [[ADDR_11]] 'also_before' 'int ({{.*}})'
-
-// C: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 used also_before 'int ({{.*}})'
-// C-NEXT: | `-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
-// C-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
-// C-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
-// C-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] <line:10:1, col:20> col:5 implicit used also_after 'int ({{.*}})'
-// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
-// C-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// C-NEXT: |-FunctionDecl [[ADDR_7]] <col:1, line:12:1> line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
+// C: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 implicit used also_before 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] <line:13:5> 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:10:1, line:12:1> line:10:5 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
// C-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:22, line:12:1>
// C-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:11:3, col:10>
// C-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] <col:10> 'int' 1
-// C-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] <line:13:1, col:21> col:5 implicit used also_before 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] <line:10:5> col:5 implicit used also_after 'int ({{.*}})'
// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
-// C-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:1> 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// C-NEXT: |-FunctionDecl [[ADDR_14]] <col:1, line:15:1> line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
-// C-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] <col:23, line:15:1>
-// C-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] <line:14:3, col:10>
-// C-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] <col:10> 'int' 2
-// C-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
-// C-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] <col:22, line:20:1>
-// C-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] <line:19:3, col:10>
-// C-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] <col:10> 'int' 0
-// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
-// C-NEXT: | `-DeclRefExpr [[ADDR_6]] <line:10:1> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
-// C-NEXT: |-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] <line:22:1, line:24:1> line:22:5 used test 'int (int (*)({{.*}}))'
-// C-NEXT: | |-ParmVarDecl [[ADDR_24:0x[a-z0-9]*]] <col:10, col:24> col:16 used fd 'int (*)({{.*}})'
-// C-NEXT: | `-CompoundStmt [[ADDR_25:0x[a-z0-9]*]] <col:27, line:24:1>
-// C-NEXT: | `-ReturnStmt [[ADDR_26:0x[a-z0-9]*]] <line:23:3, col:13>
-// C-NEXT: | `-CallExpr [[ADDR_27:0x[a-z0-9]*]] <col:10, col:13> 'int'
-// C-NEXT: | `-ImplicitCastExpr [[ADDR_28:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <LValueToRValue>
-// C-NEXT: | `-DeclRefExpr [[ADDR_29:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' {{.*}}ParmVar [[ADDR_24]] 'fd' 'int (*)({{.*}})'
-// C-NEXT: `-FunctionDecl [[ADDR_30:0x[a-z0-9]*]] <line:25:1, line:31:1> line:25:5 main 'int ({{.*}})'
-// C-NEXT: `-CompoundStmt [[ADDR_31:0x[a-z0-9]*]] <col:12, line:31:1>
-// C-NEXT: `-ReturnStmt [[ADDR_32:0x[a-z0-9]*]] <line:27:3, line:30:27>
-// C-NEXT: `-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] <line:27:10, line:30:27> 'int' '+'
-// C-NEXT: |-BinaryOperator [[ADDR_34:0x[a-z0-9]*]] <line:27:10, line:29:26> 'int' '+'
-// C-NEXT: | |-BinaryOperator [[ADDR_35:0x[a-z0-9]*]] <line:27:10, line:28:26> 'int' '+'
-// C-NEXT: | | |-CallExpr [[ADDR_36:0x[a-z0-9]*]] <line:27:10, col:25> 'int'
-// C-NEXT: | | | |-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
-// C-NEXT: | | | | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))'
-// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_39:0x[a-z0-9]*]] <col:15> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// C-NEXT: | | | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] <col:15> 'int ({{.*}})' Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// C-NEXT: | | `-CallExpr [[ADDR_41:0x[a-z0-9]*]] <line:28:10, col:26> 'int'
-// C-NEXT: | | |-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
-// C-NEXT: | | | `-DeclRefExpr [[ADDR_43:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))'
-// C-NEXT: | | `-ImplicitCastExpr [[ADDR_44:0x[a-z0-9]*]] <col:15> 'int (*)({{.*}})' <FunctionToPointerDecay>
-// C-NEXT: | | `-DeclRefExpr [[ADDR_45:0x[a-z0-9]*]] <col:15> 'int ({{.*}})' Function [[ADDR_11]] 'also_before' 'int ({{.*}})'
-// C-NEXT: | `-CallExpr [[ADDR_46:0x[a-z0-9]*]] <line:29:10, col:26> 'int'
-// C-NEXT: | |-ImplicitCastExpr [[ADDR_47:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
-// C-NEXT: | | `-DeclRefExpr [[ADDR_48:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))'
-// C-NEXT: | `-UnaryOperator [[ADDR_49:0x[a-z0-9]*]] <col:15, col:16> 'int (*)({{.*}})' prefix '&' cannot overflow
-// C-NEXT: | `-DeclRefExpr [[ADDR_50:0x[a-z0-9]*]] <col:16> 'int ({{.*}})' Function [[ADDR_18]] 'also_after' 'int ({{.*}})'
-// C-NEXT: `-CallExpr [[ADDR_51:0x[a-z0-9]*]] <line:30:10, col:27> 'int'
-// C-NEXT: |-ImplicitCastExpr [[ADDR_52:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
-// C-NEXT: | `-DeclRefExpr [[ADDR_53:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))'
-// C-NEXT: `-UnaryOperator [[ADDR_54:0x[a-z0-9]*]] <col:15, col:16> 'int (*)({{.*}})' prefix '&' cannot overflow
-// C-NEXT: `-DeclRefExpr [[ADDR_55:0x[a-z0-9]*]] <col:16> 'int ({{.*}})' Function [[ADDR_11]] 'also_before' 'int ({{.*}})'
+// C-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_6]] <line:13:1, line:15:1> line:13:5 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
+// C-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] <col:23, line:15:1>
+// C-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] <line:14:3, col:10>
+// C-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] <col:10> 'int' 2
+// C-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_11]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
+// C-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] <col:22, line:20:1>
+// C-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] <line:19:3, col:10>
+// C-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] <col:10> 'int' 0
+// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// C-NEXT: | `-DeclRefExpr [[ADDR_13]] <line:10:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// C-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] <line:22:1, line:24:1> line:22:5 used test 'int (int (*)({{.*}}))'
+// C-NEXT: | |-ParmVarDecl [[ADDR_23:0x[a-z0-9]*]] <col:10, col:24> col:16 used fd 'int (*)({{.*}})'
+// C-NEXT: | `-CompoundStmt [[ADDR_24:0x[a-z0-9]*]] <col:27, line:24:1>
+// C-NEXT: | `-ReturnStmt [[ADDR_25:0x[a-z0-9]*]] <line:23:3, col:13>
+// C-NEXT: | `-CallExpr [[ADDR_26:0x[a-z0-9]*]] <col:10, col:13> 'int'
+// C-NEXT: | `-ImplicitCastExpr [[ADDR_27:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <LValueToRValue>
+// C-NEXT: | `-DeclRefExpr [[ADDR_28:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' {{.*}}ParmVar [[ADDR_23]] 'fd' 'int (*)({{.*}})'
+// C-NEXT: `-FunctionDecl [[ADDR_29:0x[a-z0-9]*]] <line:25:1, line:31:1> line:25:5 main 'int ({{.*}})'
+// C-NEXT: `-CompoundStmt [[ADDR_30:0x[a-z0-9]*]] <col:12, line:31:1>
+// C-NEXT: `-ReturnStmt [[ADDR_31:0x[a-z0-9]*]] <line:27:3, line:30:27>
+// C-NEXT: `-BinaryOperator [[ADDR_32:0x[a-z0-9]*]] <line:27:10, line:30:27> 'int' '+'
+// C-NEXT: |-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] <line:27:10, line:29:26> 'int' '+'
+// C-NEXT: | |-BinaryOperator [[ADDR_34:0x[a-z0-9]*]] <line:27:10, line:28:26> 'int' '+'
+// C-NEXT: | | |-CallExpr [[ADDR_35:0x[a-z0-9]*]] <line:27:10, col:25> 'int'
+// C-NEXT: | | | |-ImplicitCastExpr [[ADDR_36:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
+// C-NEXT: | | | | `-DeclRefExpr [[ADDR_37:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' Function [[ADDR_22]] 'test' 'int (int (*)({{.*}}))'
+// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_38:0x[a-z0-9]*]] <col:15> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] <col:15> 'int ({{.*}})' Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// C-NEXT: | | `-CallExpr [[ADDR_40:0x[a-z0-9]*]] <line:28:10, col:26> 'int'
+// C-NEXT: | | |-ImplicitCastExpr [[ADDR_41:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
+// C-NEXT: | | | `-DeclRefExpr [[ADDR_42:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' Function [[ADDR_22]] 'test' 'int (int (*)({{.*}}))'
+// C-NEXT: | | `-ImplicitCastExpr [[ADDR_43:0x[a-z0-9]*]] <col:15> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// C-NEXT: | | `-DeclRefExpr [[ADDR_44:0x[a-z0-9]*]] <col:15> 'int ({{.*}})' Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
+// C-NEXT: | `-CallExpr [[ADDR_45:0x[a-z0-9]*]] <line:29:10, col:26> 'int'
+// C-NEXT: | |-ImplicitCastExpr [[ADDR_46:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
+// C-NEXT: | | `-DeclRefExpr [[ADDR_47:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' Function [[ADDR_22]] 'test' 'int (int (*)({{.*}}))'
+// C-NEXT: | `-UnaryOperator [[ADDR_48:0x[a-z0-9]*]] <col:15, col:16> 'int (*)({{.*}})' prefix '&' cannot overflow
+// C-NEXT: | `-DeclRefExpr [[ADDR_49:0x[a-z0-9]*]] <col:16> 'int ({{.*}})' Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// C-NEXT: `-CallExpr [[ADDR_50:0x[a-z0-9]*]] <line:30:10, col:27> 'int'
+// C-NEXT: |-ImplicitCastExpr [[ADDR_51:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
+// C-NEXT: | `-DeclRefExpr [[ADDR_52:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' Function [[ADDR_22]] 'test' 'int (int (*)({{.*}}))'
+// C-NEXT: `-UnaryOperator [[ADDR_53:0x[a-z0-9]*]] <col:15, col:16> 'int (*)({{.*}})' prefix '&' cannot overflow
+// C-NEXT: `-DeclRefExpr [[ADDR_54:0x[a-z0-9]*]] <col:16> 'int ({{.*}})' Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
+
+// CXX: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:5:5 implicit used also_before 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] <col:23, line:7:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] <line:6:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] <line:13:5> 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] <line:10:1, line:12:1> line:10:5 also_after[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] <col:22, line:12:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] <line:11:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] <col:10> 'int' 1
+// CXX-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] <line:10:5> col:5 implicit used also_after 'int ({{.*}})'
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_6]] <line:13:1, line:15:1> line:13:5 also_before[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] <col:23, line:15:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] <line:14:3, col:10>
+// CXX-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] <col:10> 'int' 2
+// CXX-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_11]] <line:18:1, line:20:1> line:18:5 used also_after 'int ({{.*}})'
+// CXX-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] <col:22, line:20:1>
+// CXX-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] <line:19:3, col:10>
+// CXX-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] <col:10> 'int' 0
+// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <<invalid sloc>> Inherited Implicit implementation={vendor(llvm)}
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_13]] <line:10:5> 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CXX-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] <line:22:1, line:24:1> line:22:5 used test 'int (int (*)({{.*}}))'
+// CXX-NEXT: | |-ParmVarDecl [[ADDR_23:0x[a-z0-9]*]] <col:10, col:24> col:16 used fd 'int (*)({{.*}})'
+// CXX-NEXT: | `-CompoundStmt [[ADDR_24:0x[a-z0-9]*]] <col:27, line:24:1>
+// CXX-NEXT: | `-ReturnStmt [[ADDR_25:0x[a-z0-9]*]] <line:23:3, col:13>
+// CXX-NEXT: | `-CallExpr [[ADDR_26:0x[a-z0-9]*]] <col:10, col:13> 'int'
+// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_27:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <LValueToRValue>
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_28:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' {{.*}}ParmVar [[ADDR_23]] 'fd' 'int (*)({{.*}})'
+// CXX-NEXT: `-FunctionDecl [[ADDR_29:0x[a-z0-9]*]] <line:25:1, line:31:1> line:25:5 main 'int ({{.*}})'
+// CXX-NEXT: `-CompoundStmt [[ADDR_30:0x[a-z0-9]*]] <col:12, line:31:1>
+// CXX-NEXT: `-ReturnStmt [[ADDR_31:0x[a-z0-9]*]] <line:27:3, line:30:27>
+// CXX-NEXT: `-BinaryOperator [[ADDR_32:0x[a-z0-9]*]] <line:27:10, line:30:27> 'int' '+'
+// CXX-NEXT: |-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] <line:27:10, line:29:26> 'int' '+'
+// CXX-NEXT: | |-BinaryOperator [[ADDR_34:0x[a-z0-9]*]] <line:27:10, line:28:26> 'int' '+'
+// CXX-NEXT: | | |-CallExpr [[ADDR_35:0x[a-z0-9]*]] <line:27:10, col:25> 'int'
+// CXX-NEXT: | | | |-ImplicitCastExpr [[ADDR_36:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
+// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_37:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_22]] 'test' 'int (int (*)({{.*}}))'
+// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_38:0x[a-z0-9]*]] <col:15> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] <col:15> 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// CXX-NEXT: | | `-CallExpr [[ADDR_40:0x[a-z0-9]*]] <line:28:10, col:26> 'int'
+// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_41:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
+// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_42:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_22]] 'test' 'int (int (*)({{.*}}))'
+// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_43:0x[a-z0-9]*]] <col:15> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CXX-NEXT: | | `-DeclRefExpr [[ADDR_44:0x[a-z0-9]*]] <col:15> 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
+// CXX-NEXT: | `-CallExpr [[ADDR_45:0x[a-z0-9]*]] <line:29:10, col:26> 'int'
+// CXX-NEXT: | |-ImplicitCastExpr [[ADDR_46:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
+// CXX-NEXT: | | `-DeclRefExpr [[ADDR_47:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_22]] 'test' 'int (int (*)({{.*}}))'
+// CXX-NEXT: | `-UnaryOperator [[ADDR_48:0x[a-z0-9]*]] <col:15, col:16> 'int (*)({{.*}})' prefix '&' cannot overflow
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_49:0x[a-z0-9]*]] <col:16> 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})'
+// CXX-NEXT: `-CallExpr [[ADDR_50:0x[a-z0-9]*]] <line:30:10, col:27> 'int'
+// CXX-NEXT: |-ImplicitCastExpr [[ADDR_51:0x[a-z0-9]*]] <col:10> 'int (*)(int (*)({{.*}}))' <FunctionToPointerDecay>
+// CXX-NEXT: | `-DeclRefExpr [[ADDR_52:0x[a-z0-9]*]] <col:10> 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_22]] 'test' 'int (int (*)({{.*}}))'
+// CXX-NEXT: `-UnaryOperator [[ADDR_53:0x[a-z0-9]*]] <col:15, col:16> 'int (*)({{.*}})' prefix '&' cannot overflow
+// CXX-NEXT: `-DeclRefExpr [[ADDR_54:0x[a-z0-9]*]] <col:16> 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})'
diff --git a/clang/test/AST/ast-dump-openmp-begin-declare-variant_namespace_1.cpp b/clang/test/AST/ast-dump-openmp-begin-declare-variant_namespace_1.cpp
new file mode 100644
index 000000000000..f1a4ff1c3f11
--- /dev/null
+++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_namespace_1.cpp
@@ -0,0 +1,162 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s -x c++ | FileCheck %s
+
+namespace A {
+int foo(void) { // expected-note {{candidate function}}
+ return 0;
+}
+} // namespace A
+
+namespace B {
+int bar(void) {
+ return 1;
+}
+} // namespace B
+
+namespace C {
+int baz(void) {
+ return 2;
+}
+} // namespace C
+
+#pragma omp begin declare variant match(implementation = {vendor(llvm)})
+
+// This will *not* be a specialization of A::foo(void).
+int foo(void) { // expected-note {{candidate function}}
+ return 3;
+}
+
+namespace B {
+// This will *not* be a specialization of A::foo(void).
+int foo(void) {
+ return 4;
+}
+// This will be a specialization of B::bar(void).
+int bar(void) {
+ return 0;
+}
+} // namespace B
+
+using namespace C;
+
+// This will be a specialization of C::baz(void).
+int baz(void) {
+ return 0;
+}
+#pragma omp end declare variant
+
+
+int explicit1() {
+ // Should return 0.
+ return A::foo() + B::bar() + C::baz();
+}
+
+int implicit2() {
+ using namespace A;
+ using namespace B;
+ // Should return 0.
+ foo(); // expected-error {{call to 'foo' is ambiguous}}
+ return bar() + baz();
+}
+
+int main() {
+ // Should return 0.
+ return explicit1() + implicit2();
+}
+
+// CHECK: |-NamespaceDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:7:1> line:3:11 A
+// CHECK-NEXT: | `-FunctionDecl [[ADDR_1:0x[a-z0-9]*]] <line:4:1, line:6:1> line:4:5 used foo 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_2:0x[a-z0-9]*]] <col:15, line:6:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_3:0x[a-z0-9]*]] <line:5:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_4:0x[a-z0-9]*]] <col:10> 'int' 0
+// CHECK-NEXT: |-NamespaceDecl [[ADDR_5:0x[a-z0-9]*]] <line:9:1, line:13:1> line:9:11 B
+// CHECK-NEXT: | `-FunctionDecl [[ADDR_6:0x[a-z0-9]*]] <line:10:1, line:12:1> line:10:5 implicit used bar 'int ({{.*}})'
+// CHECK-NEXT: | |-CompoundStmt [[ADDR_7:0x[a-z0-9]*]] <col:15, line:12:1>
+// CHECK-NEXT: | | `-ReturnStmt [[ADDR_8:0x[a-z0-9]*]] <line:11:3, col:10>
+// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_9:0x[a-z0-9]*]] <col:10> 'int' 1
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_10:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_11:0x[a-z0-9]*]] <line:34:5> 'int ({{.*}})' Function [[ADDR_12:0x[a-z0-9]*]] 'bar[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-NamespaceDecl [[ADDR_13:0x[a-z0-9]*]] <line:15:1, line:19:1> line:15:11 C
+// CHECK-NEXT: | `-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] <line:16:1, line:18:1> line:16:5 implicit used baz 'int ({{.*}})'
+// CHECK-NEXT: | |-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] <col:15, line:18:1>
+// CHECK-NEXT: | | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] <line:17:3, col:10>
+// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] <col:10> 'int' 2
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_18:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_19:0x[a-z0-9]*]] <line:42:5> 'int ({{.*}})' Function [[ADDR_20:0x[a-z0-9]*]] 'baz[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_21:0x[a-z0-9]*]] <line:24:1, line:26:1> line:24:5 foo[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_22:0x[a-z0-9]*]] <col:15, line:26:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_23:0x[a-z0-9]*]] <line:25:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_24:0x[a-z0-9]*]] <col:10> 'int' 3
+// CHECK-NEXT: |-FunctionDecl [[ADDR_25:0x[a-z0-9]*]] <line:24:5> col:5 implicit foo 'int ({{.*}})'
+// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_26:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_27:0x[a-z0-9]*]] <col:5> 'int ({{.*}})' Function [[ADDR_21]] 'foo[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_28:0x[a-z0-9]*]] <<invalid sloc>> Implicit implementation={vendor(llvm)}
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_29:0x[a-z0-9]*]] <line:30:5> 'int ({{.*}})' Function [[ADDR_30:0x[a-z0-9]*]] 'foo[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-NamespaceDecl [[ADDR_31:0x[a-z0-9]*]] prev [[ADDR_5]] <line:28:1, line:37:1> line:28:11 B
+// CHECK-NEXT: | |-original Namespace [[ADDR_5]] 'B'
+// CHECK-NEXT: | |-FunctionDecl [[ADDR_30]] <line:30:1, line:32:1> line:30:5 foo[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CHECK-NEXT: | | `-CompoundStmt [[ADDR_32:0x[a-z0-9]*]] <col:15, line:32:1>
+// CHECK-NEXT: | | `-ReturnStmt [[ADDR_33:0x[a-z0-9]*]] <line:31:3, col:10>
+// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_34:0x[a-z0-9]*]] <col:10> 'int' 4
+// CHECK-NEXT: | `-FunctionDecl [[ADDR_12]] <line:34:1, line:36:1> line:34:5 bar[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_35:0x[a-z0-9]*]] <col:15, line:36:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_36:0x[a-z0-9]*]] <line:35:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_37:0x[a-z0-9]*]] <col:10> 'int' 0
+// CHECK-NEXT: |-UsingDirectiveDecl [[ADDR_38:0x[a-z0-9]*]] <line:39:1, col:17> col:17 Namespace [[ADDR_13]] 'C'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_20]] <line:42:1, line:44:1> line:42:5 baz[implementation={vendor(llvm)}] 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_39:0x[a-z0-9]*]] <col:15, line:44:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_40:0x[a-z0-9]*]] <line:43:3, col:10>
+// CHECK-NEXT: | `-IntegerLiteral [[ADDR_41:0x[a-z0-9]*]] <col:10> 'int' 0
+// CHECK-NEXT: |-FunctionDecl [[ADDR_42:0x[a-z0-9]*]] <line:48:1, line:51:1> line:48:5 used explicit1 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_43:0x[a-z0-9]*]] <col:17, line:51:1>
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_44:0x[a-z0-9]*]] <line:50:3, col:39>
+// CHECK-NEXT: | `-BinaryOperator [[ADDR_45:0x[a-z0-9]*]] <col:10, col:39> 'int' '+'
+// CHECK-NEXT: | |-BinaryOperator [[ADDR_46:0x[a-z0-9]*]] <col:10, col:28> 'int' '+'
+// CHECK-NEXT: | | |-CallExpr [[ADDR_47:0x[a-z0-9]*]] <col:10, col:17> 'int'
+// CHECK-NEXT: | | | `-ImplicitCastExpr [[ADDR_48:0x[a-z0-9]*]] <col:10, col:13> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | | | `-DeclRefExpr [[ADDR_49:0x[a-z0-9]*]] <col:10, col:13> 'int ({{.*}})' {{.*}}Function [[ADDR_1]] 'foo' 'int ({{.*}})'
+// CHECK-NEXT: | | `-PseudoObjectExpr [[ADDR_50:0x[a-z0-9]*]] <col:21, col:28> 'int'
+// CHECK-NEXT: | | |-CallExpr [[ADDR_51:0x[a-z0-9]*]] <col:21, col:28> 'int'
+// CHECK-NEXT: | | | `-ImplicitCastExpr [[ADDR_52:0x[a-z0-9]*]] <col:21, col:24> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | | | `-DeclRefExpr [[ADDR_53:0x[a-z0-9]*]] <col:21, col:24> 'int ({{.*}})' {{.*}}Function [[ADDR_6]] 'bar' 'int ({{.*}})'
+// CHECK-NEXT: | | `-CallExpr [[ADDR_54:0x[a-z0-9]*]] <line:34:5, line:50:28> 'int'
+// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_55:0x[a-z0-9]*]] <line:34:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_11]] <col:5> 'int ({{.*}})' Function [[ADDR_12]] 'bar[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: | `-PseudoObjectExpr [[ADDR_56:0x[a-z0-9]*]] <line:50:32, col:39> 'int'
+// CHECK-NEXT: | |-CallExpr [[ADDR_57:0x[a-z0-9]*]] <col:32, col:39> 'int'
+// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_58:0x[a-z0-9]*]] <col:32, col:35> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_59:0x[a-z0-9]*]] <col:32, col:35> 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'baz' 'int ({{.*}})'
+// CHECK-NEXT: | `-CallExpr [[ADDR_60:0x[a-z0-9]*]] <line:42:5, line:50:39> 'int'
+// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_61:0x[a-z0-9]*]] <line:42:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_19]] <col:5> 'int ({{.*}})' Function [[ADDR_20]] 'baz[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: |-FunctionDecl [[ADDR_62:0x[a-z0-9]*]] <line:53:1, line:59:1> line:53:5 used implicit2 'int ({{.*}})'
+// CHECK-NEXT: | `-CompoundStmt [[ADDR_63:0x[a-z0-9]*]] <col:17, line:59:1>
+// CHECK-NEXT: | |-DeclStmt [[ADDR_64:0x[a-z0-9]*]] <line:54:3, col:20>
+// CHECK-NEXT: | | `-UsingDirectiveDecl [[ADDR_65:0x[a-z0-9]*]] <col:3, col:19> col:19 Namespace [[ADDR_0]] 'A'
+// CHECK-NEXT: | |-DeclStmt [[ADDR_66:0x[a-z0-9]*]] <line:55:3, col:20>
+// CHECK-NEXT: | | `-UsingDirectiveDecl [[ADDR_67:0x[a-z0-9]*]] <col:3, col:19> col:19 Namespace [[ADDR_5]] 'B'
+// CHECK-NEXT: | `-ReturnStmt [[ADDR_68:0x[a-z0-9]*]] <line:58:3, col:22>
+// CHECK-NEXT: | `-BinaryOperator [[ADDR_69:0x[a-z0-9]*]] <col:10, col:22> 'int' '+'
+// CHECK-NEXT: | |-PseudoObjectExpr [[ADDR_70:0x[a-z0-9]*]] <col:10, col:14> 'int'
+// CHECK-NEXT: | | |-CallExpr [[ADDR_71:0x[a-z0-9]*]] <col:10, col:14> 'int'
+// CHECK-NEXT: | | | `-ImplicitCastExpr [[ADDR_72:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | | | `-DeclRefExpr [[ADDR_73:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_6]] 'bar' 'int ({{.*}})'
+// CHECK-NEXT: | | `-CallExpr [[ADDR_74:0x[a-z0-9]*]] <line:34:5, line:58:14> 'int'
+// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_75:0x[a-z0-9]*]] <line:34:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_11]] <col:5> 'int ({{.*}})' Function [[ADDR_12]] 'bar[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: | `-PseudoObjectExpr [[ADDR_76:0x[a-z0-9]*]] <line:58:18, col:22> 'int'
+// CHECK-NEXT: | |-CallExpr [[ADDR_77:0x[a-z0-9]*]] <col:18, col:22> 'int'
+// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_78:0x[a-z0-9]*]] <col:18> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_79:0x[a-z0-9]*]] <col:18> 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'baz' 'int ({{.*}})'
+// CHECK-NEXT: | `-CallExpr [[ADDR_80:0x[a-z0-9]*]] <line:42:5, line:58:22> 'int'
+// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_81:0x[a-z0-9]*]] <line:42:5> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_19]] <col:5> 'int ({{.*}})' Function [[ADDR_20]] 'baz[implementation={vendor(llvm)}]' 'int ({{.*}})'
+// CHECK-NEXT: `-FunctionDecl [[ADDR_82:0x[a-z0-9]*]] <line:61:1, line:64:1> line:61:5 main 'int ({{.*}})'
+// CHECK-NEXT: `-CompoundStmt [[ADDR_83:0x[a-z0-9]*]] <col:12, line:64:1>
+// CHECK-NEXT: `-ReturnStmt [[ADDR_84:0x[a-z0-9]*]] <line:63:3, col:34>
+// CHECK-NEXT: `-BinaryOperator [[ADDR_85:0x[a-z0-9]*]] <col:10, col:34> 'int' '+'
+// CHECK-NEXT: |-CallExpr [[ADDR_86:0x[a-z0-9]*]] <col:10, col:20> 'int'
+// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_87:0x[a-z0-9]*]] <col:10> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: | `-DeclRefExpr [[ADDR_88:0x[a-z0-9]*]] <col:10> 'int ({{.*}})' {{.*}}Function [[ADDR_42]] 'explicit1' 'int ({{.*}})'
+// CHECK-NEXT: `-CallExpr [[ADDR_89:0x[a-z0-9]*]] <col:24, col:34> 'int'
+// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_90:0x[a-z0-9]*]] <col:24> 'int (*)({{.*}})' <FunctionToPointerDecay>
+// CHECK-NEXT: `-DeclRefExpr [[ADDR_91:0x[a-z0-9]*]] <col:24> 'int ({{.*}})' {{.*}}Function [[ADDR_62]] 'implicit2' 'int ({{.*}})'
More information about the llvm-branch-commits
mailing list