From 8f0aa3f3a407994314371ee042854a8c79cea462 Mon Sep 17 00:00:00 2001 From: Johannes Doerfert Date: Wed, 1 Apr 2020 17:07:10 -0500 Subject: [PATCH] [OpenMP] Try to find an existing base for `omp begin/end declare variant` 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. Reviewed By: mikerice Differential Revision: https://reviews.llvm.org/D77252 --- clang/include/clang/AST/ASTContext.h | 2 +- clang/lib/AST/ASTContext.cpp | 9 +- clang/lib/Sema/SemaOpenMP.cpp | 42 ++- .../AST/ast-dump-openmp-begin-declare-variant_10.c | 203 +++++++++++++++ .../AST/ast-dump-openmp-begin-declare-variant_11.c | 240 +++++++++++++++++ .../AST/ast-dump-openmp-begin-declare-variant_12.c | 263 +++++++++++++++++++ .../AST/ast-dump-openmp-begin-declare-variant_2.c | 87 +++---- .../AST/ast-dump-openmp-begin-declare-variant_3.c | 89 ++++--- .../AST/ast-dump-openmp-begin-declare-variant_5.c | 242 +++++++++-------- .../AST/ast-dump-openmp-begin-declare-variant_6.c | 65 +++-- .../AST/ast-dump-openmp-begin-declare-variant_7.c | 89 ++++--- .../AST/ast-dump-openmp-begin-declare-variant_8.c | 89 ++++--- .../AST/ast-dump-openmp-begin-declare-variant_9.c | 286 ++++++++++----------- .../ast-dump-openmp-begin-declare-variant_addr_1.c | 175 +++++-------- ...mp-openmp-begin-declare-variant_namespace_1.cpp | 162 ++++++++++++ 15 files changed, 1437 insertions(+), 606 deletions(-) create mode 100644 clang/test/AST/ast-dump-openmp-begin-declare-variant_10.c create mode 100644 clang/test/AST/ast-dump-openmp-begin-declare-variant_11.c create mode 100644 clang/test/AST/ast-dump-openmp-begin-declare-variant_12.c create mode 100644 clang/test/AST/ast-dump-openmp-begin-declare-variant_namespace_1.cpp diff --git a/clang/include/clang/AST/ASTContext.h b/clang/include/clang/AST/ASTContext.h index 6813ab5..c0cff8a 100644 --- a/clang/include/clang/AST/ASTContext.h +++ b/clang/include/clang/AST/ASTContext.h @@ -2535,7 +2535,7 @@ public: 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/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index 1e81e0a..9181cce 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/lib/AST/ASTContext.cpp @@ -8856,8 +8856,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(); const auto *rbase = rhs->castAs(); const auto *lproto = dyn_cast(lbase); @@ -8931,7 +8931,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()) @@ -8995,7 +8996,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/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index e969b70..2a411e5 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -5554,7 +5554,45 @@ Sema::OMPDeclareVariantScope::OMPDeclareVariantScope(OMPTraitInfo &TI) FunctionDecl * Sema::ActOnStartOfFunctionDefinitionInOpenMPDeclareVariantScope(Scope *S, Declarator &D) { - auto *BaseFD = cast(ActOnDeclarator(S, D)); + IdentifierInfo *BaseII = D.getIdentifier(); + LookupResult Lookup(*this, DeclarationName(BaseII), D.getIdentifierLoc(), + LookupOrdinaryName); + LookupParsedName(Lookup, S, &D.getCXXScopeSpec()); + + TypeSourceInfo *TInfo = GetTypeForDeclarator(D, S); + QualType FType = TInfo->getType(); + + bool IsConstexpr = D.getDeclSpec().getConstexprSpecifier() == CSK_constexpr; + bool IsConsteval = D.getDeclSpec().getConstexprSpecifier() == CSK_consteval; + + FunctionDecl *BaseFD = nullptr; + for (auto *Candidate : Lookup) { + auto *UDecl = dyn_cast(Candidate->getUnderlyingDecl()); + if (!UDecl) + continue; + + // Don't specialize constexpr/consteval functions with + // non-constexpr/consteval functions. + if (UDecl->isConstexpr() && !IsConstexpr) + continue; + if (UDecl->isConsteval() && !IsConsteval) + continue; + + QualType NewType = Context.mergeFunctionTypes( + FType, UDecl->getType(), /* OfBlockPointer */ false, + /* Unqualified */ false, /* AllowCXX */ true); + if (NewType.isNull()) + continue; + + // Found a base! + BaseFD = UDecl; + break; + } + if (!BaseFD) { + BaseFD = cast(ActOnDeclarator(S, D)); + BaseFD->setImplicit(true); + } + OMPDeclareVariantScope &DVScope = OMPDeclareVariantScopes.back(); std::string MangledName; MangledName += D.getIdentifier()->getName(); @@ -5583,8 +5621,6 @@ void Sema::ActOnFinishedFunctionDefinitionInOpenMPDeclareVariantScope( auto *OMPDeclareVariantA = OMPDeclareVariantAttr::CreateImplicit( Context, VariantFuncRef, DVScope.TI); BaseFD->addAttr(OMPDeclareVariantA); - - BaseFD->setImplicit(true); } ExprResult Sema::ActOnOpenMPCall(ExprResult Call, Scope *Scope, 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 0000000..fb73471 --- /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 used also_before1 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 1 +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] '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:5 used also_before2 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] 'int' 2 +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_11:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_12:0x[a-z0-9]*]] '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:5 used also_before3 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] 'int' 3 +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_18:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_19:0x[a-z0-9]*]] '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:5 used also_before4 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_22:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_23:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_24:0x[a-z0-9]*]] 'int' 4 +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_25:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_26:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_27:0x[a-z0-9]*]] 'also_before4[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_6]] line:8:15 also_before1[implementation={vendor(llvm)}] 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_28:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_29:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_30:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | `-ConstAttr [[ADDR_31:0x[a-z0-9]*]] +// C-NEXT: |-FunctionDecl [[ADDR_13]] line:28:1 also_before2[implementation={vendor(llvm)}] 'int ({{.*}})' static +// C-NEXT: | `-CompoundStmt [[ADDR_32:0x[a-z0-9]*]] +// C-NEXT: | `-ReturnStmt [[ADDR_33:0x[a-z0-9]*]] +// C-NEXT: | `-IntegerLiteral [[ADDR_34:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: |-FunctionDecl [[ADDR_20]] line:31:1 also_before3[implementation={vendor(llvm)}] 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_35:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_36:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_37:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | `-NoThrowAttr [[ADDR_38:0x[a-z0-9]*]] +// C-NEXT: |-FunctionDecl [[ADDR_27]] line:34:1 also_before4[implementation={vendor(llvm)}] 'int ({{.*}})' static inline +// C-NEXT: | |-CompoundStmt [[ADDR_39:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_40:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_41:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | |-ConstAttr [[ADDR_42:0x[a-z0-9]*]] +// C-NEXT: | |-NoThrowAttr [[ADDR_43:0x[a-z0-9]*]] +// C-NEXT: | `-AlwaysInlineAttr [[ADDR_44:0x[a-z0-9]*]] always_inline +// C-NEXT: `-FunctionDecl [[ADDR_45:0x[a-z0-9]*]] line:40:5 main 'int ({{.*}})' +// C-NEXT: `-CompoundStmt [[ADDR_46:0x[a-z0-9]*]] +// C-NEXT: `-ReturnStmt [[ADDR_47:0x[a-z0-9]*]] +// C-NEXT: `-BinaryOperator [[ADDR_48:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: |-BinaryOperator [[ADDR_49:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: | |-BinaryOperator [[ADDR_50:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: | | |-PseudoObjectExpr [[ADDR_51:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | |-CallExpr [[ADDR_52:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | | `-ImplicitCastExpr [[ADDR_53:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | | | `-DeclRefExpr [[ADDR_54:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_0]] 'also_before1' 'int ({{.*}})' +// C-NEXT: | | | `-CallExpr [[ADDR_55:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_56:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | | `-DeclRefExpr [[ADDR_5]] 'int ({{.*}})' Function [[ADDR_6]] 'also_before1[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: | | `-PseudoObjectExpr [[ADDR_57:0x[a-z0-9]*]] 'int' +// C-NEXT: | | |-CallExpr [[ADDR_58:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_59:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | | `-DeclRefExpr [[ADDR_60:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_7]] 'also_before2' 'int ({{.*}})' +// C-NEXT: | | `-CallExpr [[ADDR_61:0x[a-z0-9]*]] 'int' +// C-NEXT: | | `-ImplicitCastExpr [[ADDR_62:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | `-DeclRefExpr [[ADDR_12]] 'int ({{.*}})' Function [[ADDR_13]] 'also_before2[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: | `-PseudoObjectExpr [[ADDR_63:0x[a-z0-9]*]] 'int' +// C-NEXT: | |-CallExpr [[ADDR_64:0x[a-z0-9]*]] 'int' +// C-NEXT: | | `-ImplicitCastExpr [[ADDR_65:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | `-DeclRefExpr [[ADDR_66:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_14]] 'also_before3' 'int ({{.*}})' +// C-NEXT: | `-CallExpr [[ADDR_67:0x[a-z0-9]*]] 'int' +// C-NEXT: | `-ImplicitCastExpr [[ADDR_68:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | `-DeclRefExpr [[ADDR_19]] 'int ({{.*}})' Function [[ADDR_20]] 'also_before3[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: `-PseudoObjectExpr [[ADDR_69:0x[a-z0-9]*]] 'int' +// C-NEXT: |-CallExpr [[ADDR_70:0x[a-z0-9]*]] 'int' +// C-NEXT: | `-ImplicitCastExpr [[ADDR_71:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | `-DeclRefExpr [[ADDR_72:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_21]] 'also_before4' 'int ({{.*}})' +// C-NEXT: `-CallExpr [[ADDR_73:0x[a-z0-9]*]] 'int' +// C-NEXT: `-ImplicitCastExpr [[ADDR_74:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: `-DeclRefExpr [[ADDR_26]] 'int ({{.*}})' Function [[ADDR_27]] 'also_before4[implementation={vendor(llvm)}]' 'int ({{.*}})' + +// CXX: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:13:1> line:11:5 used also_before1 'int ({{.*}})' +// CXX-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 1 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] '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:5 used also_before2 'int ({{.*}})' +// CXX-NEXT: | |-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] 'int' 2 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_11:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_12:0x[a-z0-9]*]] '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:5 used also_before3 'int ({{.*}})' +// CXX-NEXT: | |-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] 'int' 3 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_18:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_19:0x[a-z0-9]*]] '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:5 used also_before4 'int ({{.*}})' +// CXX-NEXT: | |-CompoundStmt [[ADDR_22:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_23:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_24:0x[a-z0-9]*]] 'int' 4 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_25:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_26:0x[a-z0-9]*]] '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 constexpr also_before1[implementation={vendor(llvm)}] 'int ({{.*}})' +// CXX-NEXT: | `-CompoundStmt [[ADDR_28:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_29:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_30:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: |-FunctionDecl [[ADDR_13]] line:28:1 also_before2[implementation={vendor(llvm)}] 'int ({{.*}})' static +// CXX-NEXT: | `-CompoundStmt [[ADDR_31:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_32:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_33:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: |-FunctionDecl [[ADDR_20]] line:31:1 also_before3[implementation={vendor(llvm)}] 'int ({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: | `-CompoundStmt [[ADDR_34:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_35:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_36:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: |-FunctionDecl [[ADDR_27]] line:34:1 constexpr also_before4[implementation={vendor(llvm)}] 'int ({{.*}}) __attribute__((nothrow))' static inline +// CXX-NEXT: | |-CompoundStmt [[ADDR_37:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_38:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_39:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: | `-AlwaysInlineAttr [[ADDR_40:0x[a-z0-9]*]] always_inline +// CXX-NEXT: `-FunctionDecl [[ADDR_41:0x[a-z0-9]*]] line:40:5 main 'int ({{.*}})' +// CXX-NEXT: `-CompoundStmt [[ADDR_42:0x[a-z0-9]*]] +// CXX-NEXT: `-ReturnStmt [[ADDR_43:0x[a-z0-9]*]] +// CXX-NEXT: `-BinaryOperator [[ADDR_44:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: |-BinaryOperator [[ADDR_45:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: | |-BinaryOperator [[ADDR_46:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: | | |-PseudoObjectExpr [[ADDR_47:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | |-CallExpr [[ADDR_48:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | | `-ImplicitCastExpr [[ADDR_49:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_50:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before1' 'int ({{.*}})' +// CXX-NEXT: | | | `-CallExpr [[ADDR_51:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_52:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_5]] 'int ({{.*}})' Function [[ADDR_6]] 'also_before1[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: | | `-PseudoObjectExpr [[ADDR_53:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | |-CallExpr [[ADDR_54:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_55:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_56:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_7]] 'also_before2' 'int ({{.*}})' +// CXX-NEXT: | | `-CallExpr [[ADDR_57:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_58:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | `-DeclRefExpr [[ADDR_12]] 'int ({{.*}})' Function [[ADDR_13]] 'also_before2[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: | `-PseudoObjectExpr [[ADDR_59:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | |-CallExpr [[ADDR_60:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_61:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | `-DeclRefExpr [[ADDR_62:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'also_before3' 'int ({{.*}})' +// CXX-NEXT: | `-CallExpr [[ADDR_63:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_64:0x[a-z0-9]*]] 'int (*)({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: | `-DeclRefExpr [[ADDR_19]] 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_20]] 'also_before3[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: `-PseudoObjectExpr [[ADDR_65:0x[a-z0-9]*]] 'int' +// CXX-NEXT: |-CallExpr [[ADDR_66:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_67:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | `-DeclRefExpr [[ADDR_68:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_21]] 'also_before4' 'int ({{.*}})' +// CXX-NEXT: `-CallExpr [[ADDR_69:0x[a-z0-9]*]] 'int' +// CXX-NEXT: `-ImplicitCastExpr [[ADDR_70:0x[a-z0-9]*]] 'int (*)({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: `-DeclRefExpr [[ADDR_26]] '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 0000000..237eede --- /dev/null +++ b/clang/test/AST/ast-dump-openmp-begin-declare-variant_11.c @@ -0,0 +1,240 @@ +// 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:13:27> col:11 implicit used also_after1 'int ({{.*}})' +// C-NEXT: | |-ConstAttr [[ADDR_1:0x[a-z0-9]*]] +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_2:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_3:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_4:0x[a-z0-9]*]] 'also_after1[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_4]] line:9:15 also_after1[implementation={vendor(llvm)}] 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_5:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_6:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_7:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | `-ConstAttr [[ADDR_8:0x[a-z0-9]*]] +// C-NEXT: |-FunctionDecl [[ADDR_9:0x[a-z0-9]*]] col:12 implicit used also_after2 'int ({{.*}})' static +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_10:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_11:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_12:0x[a-z0-9]*]] 'also_after2[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_12]] line:16:1 also_after2[implementation={vendor(llvm)}] 'int ({{.*}})' static +// C-NEXT: | `-CompoundStmt [[ADDR_13:0x[a-z0-9]*]] +// C-NEXT: | `-ReturnStmt [[ADDR_14:0x[a-z0-9]*]] +// C-NEXT: | `-IntegerLiteral [[ADDR_15:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: |-FunctionDecl [[ADDR_16:0x[a-z0-9]*]] col:30 implicit used also_after3 'int ({{.*}})' +// C-NEXT: | |-NoThrowAttr [[ADDR_17:0x[a-z0-9]*]] +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_18:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_19:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_20:0x[a-z0-9]*]] 'also_after3[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_20]] line:19:1 also_after3[implementation={vendor(llvm)}] 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_21:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_22:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_23:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | `-NoThrowAttr [[ADDR_24:0x[a-z0-9]*]] +// C-NEXT: |-FunctionDecl [[ADDR_25:0x[a-z0-9]*]] col:69 implicit used also_after4 'int ({{.*}})' static inline +// C-NEXT: | |-ConstAttr [[ADDR_26:0x[a-z0-9]*]] +// C-NEXT: | |-NoThrowAttr [[ADDR_27:0x[a-z0-9]*]] +// C-NEXT: | |-AlwaysInlineAttr [[ADDR_28:0x[a-z0-9]*]] always_inline +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_29:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_30:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_31:0x[a-z0-9]*]] 'also_after4[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_31]] line:22:1 also_after4[implementation={vendor(llvm)}] 'int ({{.*}})' static inline +// C-NEXT: | |-CompoundStmt [[ADDR_32:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_33:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_34:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | |-ConstAttr [[ADDR_35:0x[a-z0-9]*]] +// C-NEXT: | |-NoThrowAttr [[ADDR_36:0x[a-z0-9]*]] +// C-NEXT: | `-AlwaysInlineAttr [[ADDR_37:0x[a-z0-9]*]] always_inline +// C-NEXT: |-FunctionDecl [[ADDR_38:0x[a-z0-9]*]] prev [[ADDR_0]] line:27:5 used also_after1 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_39:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_40:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_41:0x[a-z0-9]*]] 'int' 1 +// C-NEXT: | |-ConstAttr [[ADDR_42:0x[a-z0-9]*]] Inherited +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_43:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_3]] 'int ({{.*}})' Function [[ADDR_4]] 'also_after1[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_44:0x[a-z0-9]*]] prev [[ADDR_9]] line:30:5 used also_after2 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_45:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_46:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_47:0x[a-z0-9]*]] 'int' 2 +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_48:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_11]] 'int ({{.*}})' Function [[ADDR_12]] 'also_after2[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_49:0x[a-z0-9]*]] prev [[ADDR_16]] line:33:5 used also_after3 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_50:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_51:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_52:0x[a-z0-9]*]] 'int' 3 +// C-NEXT: | |-NoThrowAttr [[ADDR_53:0x[a-z0-9]*]] Inherited +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_54:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_19]] 'int ({{.*}})' Function [[ADDR_20]] 'also_after3[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_55:0x[a-z0-9]*]] prev [[ADDR_25]] line:36:5 used also_after4 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_56:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_57:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_58:0x[a-z0-9]*]] 'int' 4 +// C-NEXT: | |-ConstAttr [[ADDR_59:0x[a-z0-9]*]] Inherited +// C-NEXT: | |-NoThrowAttr [[ADDR_60:0x[a-z0-9]*]] Inherited +// C-NEXT: | |-AlwaysInlineAttr [[ADDR_61:0x[a-z0-9]*]] Inherited always_inline +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_62:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_30]] 'int ({{.*}})' Function [[ADDR_31]] 'also_after4[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: `-FunctionDecl [[ADDR_63:0x[a-z0-9]*]] line:41:5 main 'int ({{.*}})' +// C-NEXT: `-CompoundStmt [[ADDR_64:0x[a-z0-9]*]] +// C-NEXT: `-ReturnStmt [[ADDR_65:0x[a-z0-9]*]] +// C-NEXT: `-BinaryOperator [[ADDR_66:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: |-BinaryOperator [[ADDR_67:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: | |-BinaryOperator [[ADDR_68:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: | | |-PseudoObjectExpr [[ADDR_69:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | |-CallExpr [[ADDR_70:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | | `-ImplicitCastExpr [[ADDR_71:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | | | `-DeclRefExpr [[ADDR_72:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_38]] 'also_after1' 'int ({{.*}})' +// C-NEXT: | | | `-CallExpr [[ADDR_73:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_74:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | | `-DeclRefExpr [[ADDR_3]] 'int ({{.*}})' Function [[ADDR_4]] 'also_after1[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: | | `-PseudoObjectExpr [[ADDR_75:0x[a-z0-9]*]] 'int' +// C-NEXT: | | |-CallExpr [[ADDR_76:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_77:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | | `-DeclRefExpr [[ADDR_78:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_44]] 'also_after2' 'int ({{.*}})' +// C-NEXT: | | `-CallExpr [[ADDR_79:0x[a-z0-9]*]] 'int' +// C-NEXT: | | `-ImplicitCastExpr [[ADDR_80:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | `-DeclRefExpr [[ADDR_11]] 'int ({{.*}})' Function [[ADDR_12]] 'also_after2[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: | `-PseudoObjectExpr [[ADDR_81:0x[a-z0-9]*]] 'int' +// C-NEXT: | |-CallExpr [[ADDR_82:0x[a-z0-9]*]] 'int' +// C-NEXT: | | `-ImplicitCastExpr [[ADDR_83:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | `-DeclRefExpr [[ADDR_84:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_49]] 'also_after3' 'int ({{.*}})' +// C-NEXT: | `-CallExpr [[ADDR_85:0x[a-z0-9]*]] 'int' +// C-NEXT: | `-ImplicitCastExpr [[ADDR_86:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | `-DeclRefExpr [[ADDR_19]] 'int ({{.*}})' Function [[ADDR_20]] 'also_after3[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: `-PseudoObjectExpr [[ADDR_87:0x[a-z0-9]*]] 'int' +// C-NEXT: |-CallExpr [[ADDR_88:0x[a-z0-9]*]] 'int' +// C-NEXT: | `-ImplicitCastExpr [[ADDR_89:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | `-DeclRefExpr [[ADDR_90:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_55]] 'also_after4' 'int ({{.*}})' +// C-NEXT: `-CallExpr [[ADDR_91:0x[a-z0-9]*]] 'int' +// C-NEXT: `-ImplicitCastExpr [[ADDR_92:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: `-DeclRefExpr [[ADDR_30]] 'int ({{.*}})' Function [[ADDR_31]] 'also_after4[implementation={vendor(llvm)}]' 'int ({{.*}})' + +// CXX: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:13:27> col:11 implicit used constexpr also_after1 'int ({{.*}})' +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_1:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'also_after1[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: |-FunctionDecl [[ADDR_3]] line:7:15 constexpr also_after1[implementation={vendor(llvm)}] 'int ({{.*}})' +// CXX-NEXT: | `-CompoundStmt [[ADDR_4:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_5:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_6:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] col:12 implicit used also_after2 'int ({{.*}})' static +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after2[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: |-FunctionDecl [[ADDR_10]] line:16:1 also_after2[implementation={vendor(llvm)}] 'int ({{.*}})' static +// CXX-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] col:30 implicit used also_after3 'int ({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_15:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_16:0x[a-z0-9]*]] 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_17:0x[a-z0-9]*]] 'also_after3[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: |-FunctionDecl [[ADDR_17]] line:19:1 also_after3[implementation={vendor(llvm)}] 'int ({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: | `-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: |-FunctionDecl [[ADDR_21:0x[a-z0-9]*]] col:69 implicit used constexpr also_after4 'int ({{.*}}) __attribute__((nothrow))' static inline +// CXX-NEXT: | |-AlwaysInlineAttr [[ADDR_22:0x[a-z0-9]*]] always_inline +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_23:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_24:0x[a-z0-9]*]] 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_25:0x[a-z0-9]*]] 'also_after4[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: |-FunctionDecl [[ADDR_25]] line:22:1 constexpr also_after4[implementation={vendor(llvm)}] 'int ({{.*}}) __attribute__((nothrow))' static inline +// CXX-NEXT: | |-CompoundStmt [[ADDR_26:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_27:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_28:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: | `-AlwaysInlineAttr [[ADDR_29:0x[a-z0-9]*]] always_inline +// CXX-NEXT: |-FunctionDecl [[ADDR_30:0x[a-z0-9]*]] line:27:5 invalid also_after1 'int ({{.*}})' +// CXX-NEXT: | |-CompoundStmt [[ADDR_31:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_32:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_33:0x[a-z0-9]*]] 'int' 1 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_34:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_2]] 'int ({{.*}})' Function [[ADDR_3]] 'also_after1[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: |-FunctionDecl [[ADDR_35:0x[a-z0-9]*]] prev [[ADDR_7]] line:30:5 used also_after2 'int ({{.*}})' +// CXX-NEXT: | |-CompoundStmt [[ADDR_36:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_37:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_38:0x[a-z0-9]*]] 'int' 2 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_39:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after2[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: |-FunctionDecl [[ADDR_40:0x[a-z0-9]*]] prev [[ADDR_14]] line:33:5 used also_after3 'int ({{.*}})' +// CXX-NEXT: | |-CompoundStmt [[ADDR_41:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_42:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_43:0x[a-z0-9]*]] 'int' 3 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_44:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_16]] 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_17]] 'also_after3[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: |-FunctionDecl [[ADDR_45:0x[a-z0-9]*]] line:36:5 invalid also_after4 'int ({{.*}})' +// CXX-NEXT: | |-CompoundStmt [[ADDR_46:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_47:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_48:0x[a-z0-9]*]] 'int' 4 +// CXX-NEXT: | |-AlwaysInlineAttr [[ADDR_49:0x[a-z0-9]*]] Inherited always_inline +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_50:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_24]] 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_25]] 'also_after4[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: `-FunctionDecl [[ADDR_51:0x[a-z0-9]*]] line:41:5 main 'int ({{.*}})' +// CXX-NEXT: `-CompoundStmt [[ADDR_52:0x[a-z0-9]*]] +// CXX-NEXT: `-ReturnStmt [[ADDR_53:0x[a-z0-9]*]] +// CXX-NEXT: `-BinaryOperator [[ADDR_54:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: |-BinaryOperator [[ADDR_55:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: | |-BinaryOperator [[ADDR_56:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: | | |-PseudoObjectExpr [[ADDR_57:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | |-CallExpr [[ADDR_58:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | | `-ImplicitCastExpr [[ADDR_59:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_60:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_after1' 'int ({{.*}})' +// CXX-NEXT: | | | `-CallExpr [[ADDR_61:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_62:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_2]] 'int ({{.*}})' Function [[ADDR_3]] 'also_after1[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: | | `-PseudoObjectExpr [[ADDR_63:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | |-CallExpr [[ADDR_64:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_65:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_66:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_35]] 'also_after2' 'int ({{.*}})' +// CXX-NEXT: | | `-CallExpr [[ADDR_67:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_68:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after2[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: | `-PseudoObjectExpr [[ADDR_69:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | |-CallExpr [[ADDR_70:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_71:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | `-DeclRefExpr [[ADDR_72:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_40]] 'also_after3' 'int ({{.*}})' +// CXX-NEXT: | `-CallExpr [[ADDR_73:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_74:0x[a-z0-9]*]] 'int (*)({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: | `-DeclRefExpr [[ADDR_16]] 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_17]] 'also_after3[implementation={vendor(llvm)}]' 'int ({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: `-PseudoObjectExpr [[ADDR_75:0x[a-z0-9]*]] 'int' +// CXX-NEXT: |-CallExpr [[ADDR_76:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_77:0x[a-z0-9]*]] 'int (*)({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: | `-DeclRefExpr [[ADDR_78:0x[a-z0-9]*]] 'int ({{.*}}) __attribute__((nothrow))' {{.*}}Function [[ADDR_21]] 'also_after4' 'int ({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: `-CallExpr [[ADDR_79:0x[a-z0-9]*]] 'int' +// CXX-NEXT: `-ImplicitCastExpr [[ADDR_80:0x[a-z0-9]*]] 'int (*)({{.*}}) __attribute__((nothrow))' +// CXX-NEXT: `-DeclRefExpr [[ADDR_24]] 'int ({{.*}}) __attribute__((nothrow))' Function [[ADDR_25]] '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 0000000..11fc1e4 --- /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 used also_before 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 1 +// C-NEXT: | |-OverloadableAttr [[ADDR_4:0x[a-z0-9]*]] +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_8:0x[a-z0-9]*]] line:16:5 used also_before 'int (int)' +// C-NEXT: | |-ParmVarDecl [[ADDR_9:0x[a-z0-9]*]] col:21 i 'int' +// C-NEXT: | |-CompoundStmt [[ADDR_10:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_11:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_12:0x[a-z0-9]*]] 'int' 2 +// C-NEXT: | |-OverloadableAttr [[ADDR_13:0x[a-z0-9]*]] +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_14:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_15:0x[a-z0-9]*]] '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:20:5 used also_before 'int (float)' +// C-NEXT: | |-ParmVarDecl [[ADDR_18:0x[a-z0-9]*]] col:23 f 'float' +// C-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | `-OverloadableAttr [[ADDR_22:0x[a-z0-9]*]] +// C-NEXT: |-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] line:24:5 used also_before 'int (double)' +// C-NEXT: | |-ParmVarDecl [[ADDR_24:0x[a-z0-9]*]] col:24 d 'double' +// C-NEXT: | |-CompoundStmt [[ADDR_25:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_26:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_27:0x[a-z0-9]*]] 'int' 3 +// C-NEXT: | |-OverloadableAttr [[ADDR_28:0x[a-z0-9]*]] +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_29:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_30:0x[a-z0-9]*]] '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:28:5 used also_before 'int (long)' +// C-NEXT: | |-ParmVarDecl [[ADDR_33:0x[a-z0-9]*]] col:22 l 'long' +// C-NEXT: | |-CompoundStmt [[ADDR_34:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_35:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_36:0x[a-z0-9]*]] 'int' 4 +// C-NEXT: | |-OverloadableAttr [[ADDR_37:0x[a-z0-9]*]] +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_38:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] 'int (long)' Function [[ADDR_40:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int (long)' +// C-NEXT: |-FunctionDecl [[ADDR_7]] line:8:22 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_41:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_42:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_43:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | `-OverloadableAttr [[ADDR_44:0x[a-z0-9]*]] +// C-NEXT: |-FunctionDecl [[ADDR_16]] line:8:22 also_before[implementation={vendor(llvm)}] 'int (int)' +// C-NEXT: | |-ParmVarDecl [[ADDR_45:0x[a-z0-9]*]] col:21 i 'int' +// C-NEXT: | |-CompoundStmt [[ADDR_46:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_47:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_48:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | `-OverloadableAttr [[ADDR_49:0x[a-z0-9]*]] +// C-NEXT: |-FunctionDecl [[ADDR_31]] line:8:22 also_before[implementation={vendor(llvm)}] 'int (double)' +// C-NEXT: | |-ParmVarDecl [[ADDR_50:0x[a-z0-9]*]] col:24 d 'double' +// C-NEXT: | |-CompoundStmt [[ADDR_51:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_52:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_53:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | `-OverloadableAttr [[ADDR_54:0x[a-z0-9]*]] +// C-NEXT: |-FunctionDecl [[ADDR_40]] line:8:22 also_before[implementation={vendor(llvm)}] 'int (long)' +// C-NEXT: | |-ParmVarDecl [[ADDR_55:0x[a-z0-9]*]] col:22 l 'long' +// C-NEXT: | |-CompoundStmt [[ADDR_56:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_57:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_58:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | `-OverloadableAttr [[ADDR_59:0x[a-z0-9]*]] +// C-NEXT: `-FunctionDecl [[ADDR_60:0x[a-z0-9]*]] line:53:5 main 'int ({{.*}})' +// C-NEXT: `-CompoundStmt [[ADDR_61:0x[a-z0-9]*]] +// C-NEXT: `-ReturnStmt [[ADDR_62:0x[a-z0-9]*]] +// C-NEXT: `-BinaryOperator [[ADDR_63:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: |-BinaryOperator [[ADDR_64:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: | |-BinaryOperator [[ADDR_65:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: | | |-BinaryOperator [[ADDR_66:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: | | | |-PseudoObjectExpr [[ADDR_67:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | | |-CallExpr [[ADDR_68:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | | | `-ImplicitCastExpr [[ADDR_69:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | | | | `-DeclRefExpr [[ADDR_70:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})' +// C-NEXT: | | | | `-CallExpr [[ADDR_71:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | | `-ImplicitCastExpr [[ADDR_72:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | | | `-DeclRefExpr [[ADDR_6]] 'int ({{.*}})' Function [[ADDR_7]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: | | | `-PseudoObjectExpr [[ADDR_73:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | |-CallExpr [[ADDR_74:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | | |-ImplicitCastExpr [[ADDR_75:0x[a-z0-9]*]] 'int (*)(int)' +// C-NEXT: | | | | | `-DeclRefExpr [[ADDR_76:0x[a-z0-9]*]] 'int (int)' {{.*}}Function [[ADDR_8]] 'also_before' 'int (int)' +// C-NEXT: | | | | `-IntegerLiteral [[ADDR_77:0x[a-z0-9]*]] 'int' 1 +// C-NEXT: | | | `-CallExpr [[ADDR_78:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | |-ImplicitCastExpr [[ADDR_79:0x[a-z0-9]*]] 'int (*)(int)' +// C-NEXT: | | | | `-DeclRefExpr [[ADDR_15]] 'int (int)' Function [[ADDR_16]] 'also_before[implementation={vendor(llvm)}]' 'int (int)' +// C-NEXT: | | | `-IntegerLiteral [[ADDR_77]] 'int' 1 +// C-NEXT: | | `-CallExpr [[ADDR_80:0x[a-z0-9]*]] 'int' +// C-NEXT: | | |-ImplicitCastExpr [[ADDR_81:0x[a-z0-9]*]] 'int (*)(float)' +// C-NEXT: | | | `-DeclRefExpr [[ADDR_82:0x[a-z0-9]*]] 'int (float)' {{.*}}Function [[ADDR_17]] 'also_before' 'int (float)' +// C-NEXT: | | `-FloatingLiteral [[ADDR_83:0x[a-z0-9]*]] 'float' 2.000000e+00 +// C-NEXT: | `-PseudoObjectExpr [[ADDR_84:0x[a-z0-9]*]] 'int' +// C-NEXT: | |-CallExpr [[ADDR_85:0x[a-z0-9]*]] 'int' +// C-NEXT: | | |-ImplicitCastExpr [[ADDR_86:0x[a-z0-9]*]] 'int (*)(double)' +// C-NEXT: | | | `-DeclRefExpr [[ADDR_87:0x[a-z0-9]*]] 'int (double)' {{.*}}Function [[ADDR_23]] 'also_before' 'int (double)' +// C-NEXT: | | `-FloatingLiteral [[ADDR_88:0x[a-z0-9]*]] 'double' 3.000000e+00 +// C-NEXT: | `-CallExpr [[ADDR_89:0x[a-z0-9]*]] 'int' +// C-NEXT: | |-ImplicitCastExpr [[ADDR_90:0x[a-z0-9]*]] 'int (*)(double)' +// C-NEXT: | | `-DeclRefExpr [[ADDR_30]] 'int (double)' Function [[ADDR_31]] 'also_before[implementation={vendor(llvm)}]' 'int (double)' +// C-NEXT: | `-FloatingLiteral [[ADDR_88]] 'double' 3.000000e+00 +// C-NEXT: `-PseudoObjectExpr [[ADDR_91:0x[a-z0-9]*]] 'int' +// C-NEXT: |-CallExpr [[ADDR_92:0x[a-z0-9]*]] 'int' +// C-NEXT: | |-ImplicitCastExpr [[ADDR_93:0x[a-z0-9]*]] 'int (*)(long)' +// C-NEXT: | | `-DeclRefExpr [[ADDR_94:0x[a-z0-9]*]] 'int (long)' {{.*}}Function [[ADDR_32]] 'also_before' 'int (long)' +// C-NEXT: | `-IntegerLiteral [[ADDR_95:0x[a-z0-9]*]] 'long' 4 +// C-NEXT: `-CallExpr [[ADDR_96:0x[a-z0-9]*]] 'int' +// C-NEXT: |-ImplicitCastExpr [[ADDR_97:0x[a-z0-9]*]] 'int (*)(long)' +// C-NEXT: | `-DeclRefExpr [[ADDR_39]] 'int (long)' Function [[ADDR_40]] 'also_before[implementation={vendor(llvm)}]' 'int (long)' +// C-NEXT: `-IntegerLiteral [[ADDR_95]] 'long' 4 + +// CXX: |-FunctionDecl [[ADDR_0:0x[a-z0-9]*]] <{{.*}}, line:14:1> line:12:5 used also_before 'int ({{.*}})' +// CXX-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 1 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] '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:5 used also_before 'int (int)' +// CXX-NEXT: | |-ParmVarDecl [[ADDR_8:0x[a-z0-9]*]] col:21 i 'int' +// CXX-NEXT: | |-CompoundStmt [[ADDR_9:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_10:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_11:0x[a-z0-9]*]] 'int' 2 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] '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:5 used also_before 'int (float)' +// CXX-NEXT: | |-ParmVarDecl [[ADDR_16:0x[a-z0-9]*]] col:23 f 'float' +// CXX-NEXT: | `-CompoundStmt [[ADDR_17:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_18:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_19:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: |-FunctionDecl [[ADDR_20:0x[a-z0-9]*]] line:24:5 used also_before 'int (double)' +// CXX-NEXT: | |-ParmVarDecl [[ADDR_21:0x[a-z0-9]*]] col:24 d 'double' +// CXX-NEXT: | |-CompoundStmt [[ADDR_22:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_23:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_24:0x[a-z0-9]*]] 'int' 3 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_25:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_26:0x[a-z0-9]*]] '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:5 used also_before 'int (long)' +// CXX-NEXT: | |-ParmVarDecl [[ADDR_29:0x[a-z0-9]*]] col:22 l 'long' +// CXX-NEXT: | |-CompoundStmt [[ADDR_30:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_31:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_32:0x[a-z0-9]*]] 'int' 4 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_33:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_34:0x[a-z0-9]*]] 'int (long)' Function [[ADDR_35:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int (long)' +// CXX-NEXT: |-FunctionDecl [[ADDR_6]] line:34:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' +// CXX-NEXT: | `-CompoundStmt [[ADDR_36:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_37:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_38:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: |-FunctionDecl [[ADDR_14]] line:38:1 also_before[implementation={vendor(llvm)}] 'int (int)' +// CXX-NEXT: | |-ParmVarDecl [[ADDR_39:0x[a-z0-9]*]] col:21 i 'int' +// CXX-NEXT: | `-CompoundStmt [[ADDR_40:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_41:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_42:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: |-FunctionDecl [[ADDR_27]] line:43:1 also_before[implementation={vendor(llvm)}] 'int (double)' +// CXX-NEXT: | |-ParmVarDecl [[ADDR_43:0x[a-z0-9]*]] col:24 d 'double' +// CXX-NEXT: | `-CompoundStmt [[ADDR_44:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_45:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_46:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: |-FunctionDecl [[ADDR_35]] line:47:1 also_before[implementation={vendor(llvm)}] 'int (long)' +// CXX-NEXT: | |-ParmVarDecl [[ADDR_47:0x[a-z0-9]*]] col:22 l 'long' +// CXX-NEXT: | `-CompoundStmt [[ADDR_48:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_49:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_50:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: `-FunctionDecl [[ADDR_51:0x[a-z0-9]*]] line:53:5 main 'int ({{.*}})' +// CXX-NEXT: `-CompoundStmt [[ADDR_52:0x[a-z0-9]*]] +// CXX-NEXT: `-ReturnStmt [[ADDR_53:0x[a-z0-9]*]] +// CXX-NEXT: `-BinaryOperator [[ADDR_54:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: |-BinaryOperator [[ADDR_55:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: | |-BinaryOperator [[ADDR_56:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: | | |-BinaryOperator [[ADDR_57:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: | | | |-PseudoObjectExpr [[ADDR_58:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | | |-CallExpr [[ADDR_59:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | | | `-ImplicitCastExpr [[ADDR_60:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | | | | `-DeclRefExpr [[ADDR_61:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})' +// CXX-NEXT: | | | | `-CallExpr [[ADDR_62:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | | `-ImplicitCastExpr [[ADDR_63:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_5]] 'int ({{.*}})' Function [[ADDR_6]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: | | | `-PseudoObjectExpr [[ADDR_64:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | |-CallExpr [[ADDR_65:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | | |-ImplicitCastExpr [[ADDR_66:0x[a-z0-9]*]] 'int (*)(int)' +// CXX-NEXT: | | | | | `-DeclRefExpr [[ADDR_67:0x[a-z0-9]*]] 'int (int)' {{.*}}Function [[ADDR_7]] 'also_before' 'int (int)' +// CXX-NEXT: | | | | `-IntegerLiteral [[ADDR_68:0x[a-z0-9]*]] 'int' 1 +// CXX-NEXT: | | | `-CallExpr [[ADDR_69:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | |-ImplicitCastExpr [[ADDR_70:0x[a-z0-9]*]] 'int (*)(int)' +// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_13]] 'int (int)' Function [[ADDR_14]] 'also_before[implementation={vendor(llvm)}]' 'int (int)' +// CXX-NEXT: | | | `-IntegerLiteral [[ADDR_68]] 'int' 1 +// CXX-NEXT: | | `-CallExpr [[ADDR_71:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_72:0x[a-z0-9]*]] 'int (*)(float)' +// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_73:0x[a-z0-9]*]] 'int (float)' {{.*}}Function [[ADDR_15]] 'also_before' 'int (float)' +// CXX-NEXT: | | `-FloatingLiteral [[ADDR_74:0x[a-z0-9]*]] 'float' 2.000000e+00 +// CXX-NEXT: | `-PseudoObjectExpr [[ADDR_75:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | |-CallExpr [[ADDR_76:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_77:0x[a-z0-9]*]] 'int (*)(double)' +// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_78:0x[a-z0-9]*]] 'int (double)' {{.*}}Function [[ADDR_20]] 'also_before' 'int (double)' +// CXX-NEXT: | | `-FloatingLiteral [[ADDR_79:0x[a-z0-9]*]] 'double' 3.000000e+00 +// CXX-NEXT: | `-CallExpr [[ADDR_80:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | |-ImplicitCastExpr [[ADDR_81:0x[a-z0-9]*]] 'int (*)(double)' +// CXX-NEXT: | | `-DeclRefExpr [[ADDR_26]] 'int (double)' Function [[ADDR_27]] 'also_before[implementation={vendor(llvm)}]' 'int (double)' +// CXX-NEXT: | `-FloatingLiteral [[ADDR_79]] 'double' 3.000000e+00 +// CXX-NEXT: `-PseudoObjectExpr [[ADDR_82:0x[a-z0-9]*]] 'int' +// CXX-NEXT: |-CallExpr [[ADDR_83:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | |-ImplicitCastExpr [[ADDR_84:0x[a-z0-9]*]] 'int (*)(long)' +// CXX-NEXT: | | `-DeclRefExpr [[ADDR_85:0x[a-z0-9]*]] 'int (long)' {{.*}}Function [[ADDR_28]] 'also_before' 'int (long)' +// CXX-NEXT: | `-IntegerLiteral [[ADDR_86:0x[a-z0-9]*]] 'long' 4 +// CXX-NEXT: `-CallExpr [[ADDR_87:0x[a-z0-9]*]] 'int' +// CXX-NEXT: |-ImplicitCastExpr [[ADDR_88:0x[a-z0-9]*]] 'int (*)(long)' +// CXX-NEXT: | `-DeclRefExpr [[ADDR_34]] 'int (long)' Function [[ADDR_35]] 'also_before[implementation={vendor(llvm)}]' 'int (long)' +// CXX-NEXT: `-IntegerLiteral [[ADDR_86]] '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 fda973b..8defe3a 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 @@ -34,49 +34,46 @@ int test() { // - 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]*]] <> Implicit device={kind(cpu)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_3]] line:6:1 also_before[device={kind(cpu)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_4:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_5:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_6:0x[a-z0-9]*]] 'int' 0 -// CHECK-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <> Implicit implementation={vendor(score(100): llvm)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_10]] line:12:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] 'int' 0 -// CHECK-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] prev [[ADDR_0]] col:5 implicit used also_before 'int ({{.*}})' -// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_15:0x[a-z0-9]*]] <> Inherited Implicit device={kind(cpu)} -// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_2]] 'int ({{.*}})' Function [[ADDR_3]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_16:0x[a-z0-9]*]] <> Implicit implementation={vendor(score(0): llvm)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_17:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_18:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_18]] line:17:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] 'int' 1 -// CHECK-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] prev [[ADDR_7]] line:22:5 used also_after 'int ({{.*}})' -// CHECK-NEXT: | |-CompoundStmt [[ADDR_23:0x[a-z0-9]*]] -// CHECK-NEXT: | | `-ReturnStmt [[ADDR_24:0x[a-z0-9]*]] -// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_25:0x[a-z0-9]*]] 'int' 2 -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_26:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(score(100): llvm)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CHECK-NEXT: `-FunctionDecl [[ADDR_27:0x[a-z0-9]*]] line:26:5 test 'int ({{.*}})' -// CHECK-NEXT: `-CompoundStmt [[ADDR_28:0x[a-z0-9]*]] -// CHECK-NEXT: `-ReturnStmt [[ADDR_29:0x[a-z0-9]*]] -// CHECK-NEXT: `-BinaryOperator [[ADDR_30:0x[a-z0-9]*]] 'int' '+' -// CHECK-NEXT: |-PseudoObjectExpr [[ADDR_31:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | |-CallExpr [[ADDR_32:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_33:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_34:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_22]] 'also_after' 'int ({{.*}})' -// CHECK-NEXT: | `-CallExpr [[ADDR_35:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_36:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_37:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: |-CallExpr [[ADDR_38:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_39:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'also_before' 'int ({{.*}})' -// CHECK-NEXT: `-CallExpr [[ADDR_41:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_1:0x[a-z0-9]*]] <> Implicit device={kind(cpu)} +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <> Implicit implementation={vendor(score(0): llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_3]] line:6:1 also_before[device={kind(cpu)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_7:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_8:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_9:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: |-FunctionDecl [[ADDR_10:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_11:0x[a-z0-9]*]] <> Implicit implementation={vendor(score(100): llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_12:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_13:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_13]] line:12:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: |-FunctionDecl [[ADDR_6]] line:17:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_17:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_18:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_19:0x[a-z0-9]*]] 'int' 1 +// CHECK-NEXT: |-FunctionDecl [[ADDR_20:0x[a-z0-9]*]] prev [[ADDR_10]] line:22:5 used also_after 'int ({{.*}})' +// CHECK-NEXT: | |-CompoundStmt [[ADDR_21:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_22:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_23:0x[a-z0-9]*]] 'int' 2 +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_24:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(score(100): llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_12]] 'int ({{.*}})' Function [[ADDR_13]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: `-FunctionDecl [[ADDR_25:0x[a-z0-9]*]] line:26:5 test 'int ({{.*}})' +// CHECK-NEXT: `-CompoundStmt [[ADDR_26:0x[a-z0-9]*]] +// CHECK-NEXT: `-ReturnStmt [[ADDR_27:0x[a-z0-9]*]] +// CHECK-NEXT: `-BinaryOperator [[ADDR_28:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: |-PseudoObjectExpr [[ADDR_29:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | |-CallExpr [[ADDR_30:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_31:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_20]] 'also_after' 'int ({{.*}})' +// CHECK-NEXT: | `-CallExpr [[ADDR_33:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_12]] 'int ({{.*}})' Function [[ADDR_13]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_35:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: |-CallExpr [[ADDR_36:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})' +// CHECK-NEXT: `-CallExpr [[ADDR_39:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_40:0x[a-z0-9]*]] 'int (*)({{.*}})' // CHECK-NEXT: `-DeclRefExpr [[ADDR_2]] 'int ({{.*}})' Function [[ADDR_3]] '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 efedd2f..a9b03f8 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 @@ -34,49 +34,46 @@ int test() { // - 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]*]] <> Implicit device={kind(cpu)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_3]] line:6:1 also_before[device={kind(cpu)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_4:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_5:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_6:0x[a-z0-9]*]] 'int' 1 -// CHECK-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <> Implicit implementation={vendor(score(0): llvm)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_10]] line:12:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] 'int' 0 -// CHECK-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] prev [[ADDR_0]] col:5 implicit used also_before 'int ({{.*}})' -// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_15:0x[a-z0-9]*]] <> Inherited Implicit device={kind(cpu)} -// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_2]] 'int ({{.*}})' Function [[ADDR_3]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_16:0x[a-z0-9]*]] <> Implicit implementation={vendor(score(100): llvm)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_17:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_18:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_18]] line:17:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] 'int' 0 -// CHECK-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] prev [[ADDR_7]] line:22:5 used also_after 'int ({{.*}})' -// CHECK-NEXT: | |-CompoundStmt [[ADDR_23:0x[a-z0-9]*]] -// CHECK-NEXT: | | `-ReturnStmt [[ADDR_24:0x[a-z0-9]*]] -// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_25:0x[a-z0-9]*]] 'int' 2 -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_26:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(score(0): llvm)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CHECK-NEXT: `-FunctionDecl [[ADDR_27:0x[a-z0-9]*]] line:26:5 test 'int ({{.*}})' -// CHECK-NEXT: `-CompoundStmt [[ADDR_28:0x[a-z0-9]*]] -// CHECK-NEXT: `-ReturnStmt [[ADDR_29:0x[a-z0-9]*]] -// CHECK-NEXT: `-BinaryOperator [[ADDR_30:0x[a-z0-9]*]] 'int' '+' -// CHECK-NEXT: |-PseudoObjectExpr [[ADDR_31:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | |-CallExpr [[ADDR_32:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_33:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_34:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_22]] 'also_after' 'int ({{.*}})' -// CHECK-NEXT: | `-CallExpr [[ADDR_35:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_36:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_37:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: |-CallExpr [[ADDR_38:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_39:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'also_before' 'int ({{.*}})' -// CHECK-NEXT: `-CallExpr [[ADDR_41:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: `-DeclRefExpr [[ADDR_17]] 'int ({{.*}})' Function [[ADDR_18]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_1:0x[a-z0-9]*]] <> Implicit device={kind(cpu)} +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <> Implicit implementation={vendor(score(100): llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_3]] line:6:1 also_before[device={kind(cpu)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_7:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_8:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_9:0x[a-z0-9]*]] 'int' 1 +// CHECK-NEXT: |-FunctionDecl [[ADDR_10:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_11:0x[a-z0-9]*]] <> Implicit implementation={vendor(score(0): llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_12:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_13:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_13]] line:12:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: |-FunctionDecl [[ADDR_6]] line:17:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_17:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_18:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_19:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: |-FunctionDecl [[ADDR_20:0x[a-z0-9]*]] prev [[ADDR_10]] line:22:5 used also_after 'int ({{.*}})' +// CHECK-NEXT: | |-CompoundStmt [[ADDR_21:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_22:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_23:0x[a-z0-9]*]] 'int' 2 +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_24:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(score(0): llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_12]] 'int ({{.*}})' Function [[ADDR_13]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: `-FunctionDecl [[ADDR_25:0x[a-z0-9]*]] line:26:5 test 'int ({{.*}})' +// CHECK-NEXT: `-CompoundStmt [[ADDR_26:0x[a-z0-9]*]] +// CHECK-NEXT: `-ReturnStmt [[ADDR_27:0x[a-z0-9]*]] +// CHECK-NEXT: `-BinaryOperator [[ADDR_28:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: |-PseudoObjectExpr [[ADDR_29:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | |-CallExpr [[ADDR_30:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_31:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_20]] 'also_after' 'int ({{.*}})' +// CHECK-NEXT: | `-CallExpr [[ADDR_33:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_12]] 'int ({{.*}})' Function [[ADDR_13]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_35:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: |-CallExpr [[ADDR_36:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})' +// CHECK-NEXT: `-CallExpr [[ADDR_39:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_40:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: `-DeclRefExpr [[ADDR_5]] 'int ({{.*}})' Function [[ADDR_6]] 'also_before[implementation={vendor(llvm)}]' '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 b2a1cb0..da8e2fa 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 @@ -32,127 +32,125 @@ int main() { // - 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]*]] -// C-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] -// C-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 1 -// C-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' -// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} -// C-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// C-NEXT: |-FunctionDecl [[ADDR_7]] line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' -// C-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] -// C-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] -// C-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] 'int' 0 -// C-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] col:5 implicit used also_before 'int ({{.*}})' -// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} -// C-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' -// C-NEXT: |-FunctionDecl [[ADDR_14]] line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' -// C-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] -// C-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] -// C-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] 'int' 0 -// C-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] line:18:5 used also_after 'int ({{.*}})' -// C-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] -// C-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] -// C-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] 'int' 2 -// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} -// C-NEXT: | `-DeclRefExpr [[ADDR_6]] 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// C-NEXT: `-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] line:22:5 main 'int ({{.*}})' -// C-NEXT: `-CompoundStmt [[ADDR_24:0x[a-z0-9]*]] -// C-NEXT: `-ReturnStmt [[ADDR_25:0x[a-z0-9]*]] -// C-NEXT: `-BinaryOperator [[ADDR_26:0x[a-z0-9]*]] 'int' '+' -// C-NEXT: |-BinaryOperator [[ADDR_27:0x[a-z0-9]*]] 'int' '+' -// C-NEXT: | |-BinaryOperator [[ADDR_28:0x[a-z0-9]*]] 'int' '+' -// C-NEXT: | | |-PseudoObjectExpr [[ADDR_29:0x[a-z0-9]*]] 'int' -// C-NEXT: | | | |-CallExpr [[ADDR_30:0x[a-z0-9]*]] 'int' -// C-NEXT: | | | | `-ImplicitCastExpr [[ADDR_31:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | | | | `-ParenExpr [[ADDR_32:0x[a-z0-9]*]] 'int ({{.*}})' -// C-NEXT: | | | | `-DeclRefExpr [[ADDR_33:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// C-NEXT: | | | `-CallExpr [[ADDR_34:0x[a-z0-9]*]] 'int' -// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_35:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | | | `-DeclRefExpr [[ADDR_6]] 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// C-NEXT: | | `-PseudoObjectExpr [[ADDR_36:0x[a-z0-9]*]] 'int' -// C-NEXT: | | |-CallExpr [[ADDR_37:0x[a-z0-9]*]] 'int' -// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_38:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | | | `-ParenExpr [[ADDR_39:0x[a-z0-9]*]] 'int ({{.*}})' -// C-NEXT: | | | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_11]] 'also_before' 'int ({{.*}})' -// C-NEXT: | | `-CallExpr [[ADDR_41:0x[a-z0-9]*]] 'int' -// C-NEXT: | | `-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | | `-DeclRefExpr [[ADDR_13]] 'int ({{.*}})' Function [[ADDR_14]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' -// C-NEXT: | `-PseudoObjectExpr [[ADDR_43:0x[a-z0-9]*]] 'int' -// C-NEXT: | |-CallExpr [[ADDR_44:0x[a-z0-9]*]] 'int' -// C-NEXT: | | `-ParenExpr [[ADDR_45:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | | `-UnaryOperator [[ADDR_46:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow -// C-NEXT: | | `-DeclRefExpr [[ADDR_47:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// C-NEXT: | `-CallExpr [[ADDR_48:0x[a-z0-9]*]] 'int' -// C-NEXT: | `-ImplicitCastExpr [[ADDR_49:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | `-DeclRefExpr [[ADDR_6]] 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// C-NEXT: `-PseudoObjectExpr [[ADDR_50:0x[a-z0-9]*]] 'int' -// C-NEXT: |-CallExpr [[ADDR_51:0x[a-z0-9]*]] 'int' -// C-NEXT: | `-ParenExpr [[ADDR_52:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | `-UnaryOperator [[ADDR_53:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow -// C-NEXT: | `-DeclRefExpr [[ADDR_54:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_11]] 'also_before' 'int ({{.*}})' -// C-NEXT: `-CallExpr [[ADDR_55:0x[a-z0-9]*]] 'int' -// C-NEXT: `-ImplicitCastExpr [[ADDR_56:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: `-DeclRefExpr [[ADDR_13]] 'int ({{.*}})' Function [[ADDR_14]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 1 +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_10]] line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' +// C-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] +// C-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] +// C-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: |-FunctionDecl [[ADDR_6]] line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' +// C-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] +// C-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] +// C-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_7]] line:18:5 used also_after 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] 'int' 2 +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: `-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] line:22:5 main 'int ({{.*}})' +// C-NEXT: `-CompoundStmt [[ADDR_23:0x[a-z0-9]*]] +// C-NEXT: `-ReturnStmt [[ADDR_24:0x[a-z0-9]*]] +// C-NEXT: `-BinaryOperator [[ADDR_25:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: |-BinaryOperator [[ADDR_26:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: | |-BinaryOperator [[ADDR_27:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: | | |-PseudoObjectExpr [[ADDR_28:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | |-CallExpr [[ADDR_29:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | | `-ImplicitCastExpr [[ADDR_30:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | | | `-ParenExpr [[ADDR_31:0x[a-z0-9]*]] 'int ({{.*}})' +// C-NEXT: | | | | `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_17]] 'also_after' 'int ({{.*}})' +// C-NEXT: | | | `-CallExpr [[ADDR_33:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: | | `-PseudoObjectExpr [[ADDR_35:0x[a-z0-9]*]] 'int' +// C-NEXT: | | |-CallExpr [[ADDR_36:0x[a-z0-9]*]] 'int' +// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | | `-ParenExpr [[ADDR_38:0x[a-z0-9]*]] 'int ({{.*}})' +// C-NEXT: | | | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_0]] 'also_before' 'int ({{.*}})' +// C-NEXT: | | `-CallExpr [[ADDR_40:0x[a-z0-9]*]] 'int' +// C-NEXT: | | `-ImplicitCastExpr [[ADDR_41:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | `-DeclRefExpr [[ADDR_5]] 'int ({{.*}})' Function [[ADDR_6]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: | `-PseudoObjectExpr [[ADDR_42:0x[a-z0-9]*]] 'int' +// C-NEXT: | |-CallExpr [[ADDR_43:0x[a-z0-9]*]] 'int' +// C-NEXT: | | `-ParenExpr [[ADDR_44:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | `-UnaryOperator [[ADDR_45:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow +// C-NEXT: | | `-DeclRefExpr [[ADDR_46:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_17]] 'also_after' 'int ({{.*}})' +// C-NEXT: | `-CallExpr [[ADDR_47:0x[a-z0-9]*]] 'int' +// C-NEXT: | `-ImplicitCastExpr [[ADDR_48:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: `-PseudoObjectExpr [[ADDR_49:0x[a-z0-9]*]] 'int' +// C-NEXT: |-CallExpr [[ADDR_50:0x[a-z0-9]*]] 'int' +// C-NEXT: | `-ParenExpr [[ADDR_51:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | `-UnaryOperator [[ADDR_52:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow +// C-NEXT: | `-DeclRefExpr [[ADDR_53:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_0]] 'also_before' 'int ({{.*}})' +// C-NEXT: `-CallExpr [[ADDR_54:0x[a-z0-9]*]] 'int' +// C-NEXT: `-ImplicitCastExpr [[ADDR_55:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: `-DeclRefExpr [[ADDR_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]*]] -// CXX-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] -// CXX-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 1 -// CXX-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' -// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} -// CXX-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CXX-NEXT: |-FunctionDecl [[ADDR_7]] line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' -// CXX-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] -// CXX-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] -// CXX-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] 'int' 0 -// CXX-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] col:5 implicit used also_before 'int ({{.*}})' -// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} -// CXX-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CXX-NEXT: |-FunctionDecl [[ADDR_14]] line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' -// CXX-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] -// CXX-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] -// CXX-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] 'int' 0 -// CXX-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] line:18:5 used also_after 'int ({{.*}})' -// CXX-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] -// CXX-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] -// CXX-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] 'int' 2 -// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} -// CXX-NEXT: | `-DeclRefExpr [[ADDR_6]] 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CXX-NEXT: `-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] line:22:5 main 'int ({{.*}})' -// CXX-NEXT: `-CompoundStmt [[ADDR_24:0x[a-z0-9]*]] -// CXX-NEXT: `-ReturnStmt [[ADDR_25:0x[a-z0-9]*]] -// CXX-NEXT: `-BinaryOperator [[ADDR_26:0x[a-z0-9]*]] 'int' '+' -// CXX-NEXT: |-BinaryOperator [[ADDR_27:0x[a-z0-9]*]] 'int' '+' -// CXX-NEXT: | |-BinaryOperator [[ADDR_28:0x[a-z0-9]*]] 'int' '+' -// CXX-NEXT: | | |-PseudoObjectExpr [[ADDR_29:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | | | |-CallExpr [[ADDR_30:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | | | | `-ImplicitCastExpr [[ADDR_31:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: | | | | `-ParenExpr [[ADDR_32:0x[a-z0-9]*]] 'int ({{.*}})' lvalue -// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_33:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// CXX-NEXT: | | | `-CallExpr [[ADDR_34:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_35:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_6]] 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CXX-NEXT: | | `-PseudoObjectExpr [[ADDR_36:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | | |-CallExpr [[ADDR_37:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_38:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: | | | `-ParenExpr [[ADDR_39:0x[a-z0-9]*]] 'int ({{.*}})' lvalue -// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_11]] 'also_before' 'int ({{.*}})' -// CXX-NEXT: | | `-CallExpr [[ADDR_41:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: | | `-DeclRefExpr [[ADDR_13]] 'int ({{.*}})' Function [[ADDR_14]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CXX-NEXT: | `-PseudoObjectExpr [[ADDR_43:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | |-CallExpr [[ADDR_44:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | | `-ParenExpr [[ADDR_45:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: | | `-UnaryOperator [[ADDR_46:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow -// CXX-NEXT: | | `-DeclRefExpr [[ADDR_47:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// CXX-NEXT: | `-CallExpr [[ADDR_48:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_49:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: | `-DeclRefExpr [[ADDR_6]] 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CXX-NEXT: `-PseudoObjectExpr [[ADDR_50:0x[a-z0-9]*]] 'int' -// CXX-NEXT: |-CallExpr [[ADDR_51:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | `-ParenExpr [[ADDR_52:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: | `-UnaryOperator [[ADDR_53:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow -// CXX-NEXT: | `-DeclRefExpr [[ADDR_54:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_11]] 'also_before' 'int ({{.*}})' -// CXX-NEXT: `-CallExpr [[ADDR_55:0x[a-z0-9]*]] 'int' -// CXX-NEXT: `-ImplicitCastExpr [[ADDR_56:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: `-DeclRefExpr [[ADDR_13]] 'int ({{.*}})' Function [[ADDR_14]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 1 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: |-FunctionDecl [[ADDR_10]] line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' +// CXX-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: |-FunctionDecl [[ADDR_6]] line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' +// CXX-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_7]] line:18:5 used also_after 'int ({{.*}})' +// CXX-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] 'int' 2 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: `-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] line:22:5 main 'int ({{.*}})' +// CXX-NEXT: `-CompoundStmt [[ADDR_23:0x[a-z0-9]*]] +// CXX-NEXT: `-ReturnStmt [[ADDR_24:0x[a-z0-9]*]] +// CXX-NEXT: `-BinaryOperator [[ADDR_25:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: |-BinaryOperator [[ADDR_26:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: | |-BinaryOperator [[ADDR_27:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: | | |-PseudoObjectExpr [[ADDR_28:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | |-CallExpr [[ADDR_29:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | | `-ImplicitCastExpr [[ADDR_30:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | | | `-ParenExpr [[ADDR_31:0x[a-z0-9]*]] 'int ({{.*}})' lvalue +// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})' +// CXX-NEXT: | | | `-CallExpr [[ADDR_33:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: | | `-PseudoObjectExpr [[ADDR_35:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | |-CallExpr [[ADDR_36:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | | `-ParenExpr [[ADDR_38:0x[a-z0-9]*]] 'int ({{.*}})' lvalue +// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})' +// CXX-NEXT: | | `-CallExpr [[ADDR_40:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_41:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | `-DeclRefExpr [[ADDR_5]] 'int ({{.*}})' Function [[ADDR_6]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: | `-PseudoObjectExpr [[ADDR_42:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | |-CallExpr [[ADDR_43:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | `-ParenExpr [[ADDR_44:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | `-UnaryOperator [[ADDR_45:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow +// CXX-NEXT: | | `-DeclRefExpr [[ADDR_46:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})' +// CXX-NEXT: | `-CallExpr [[ADDR_47:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_48:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: `-PseudoObjectExpr [[ADDR_49:0x[a-z0-9]*]] 'int' +// CXX-NEXT: |-CallExpr [[ADDR_50:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | `-ParenExpr [[ADDR_51:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | `-UnaryOperator [[ADDR_52:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow +// CXX-NEXT: | `-DeclRefExpr [[ADDR_53:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})' +// CXX-NEXT: `-CallExpr [[ADDR_54:0x[a-z0-9]*]] 'int' +// CXX-NEXT: `-ImplicitCastExpr [[ADDR_55:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: `-DeclRefExpr [[ADDR_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 1e5241b..f221ae8 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 @@ -29,36 +29,35 @@ int main() { // - 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]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 0 -// CHECK-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <> Implicit implementation={vendor(ibm)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(ibm)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_7]] line:10:1 also_after[implementation={vendor(ibm)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] 'int' 1 -// CHECK-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] col:5 implicit used also_before 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <> Implicit implementation={vendor(ibm)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(ibm)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_14]] line:13:1 also_before[implementation={vendor(ibm)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] 'int' 2 -// CHECK-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] line:18:5 used also_after 'int ({{.*}})' -// CHECK-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] -// CHECK-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] -// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] 'int' 0 -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(ibm)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_6]] 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(ibm)}]' 'int ({{.*}})' -// CHECK-NEXT: `-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] line:22:5 main 'int ({{.*}})' -// CHECK-NEXT: `-CompoundStmt [[ADDR_24:0x[a-z0-9]*]] -// CHECK-NEXT: `-ReturnStmt [[ADDR_25:0x[a-z0-9]*]] -// CHECK-NEXT: `-BinaryOperator [[ADDR_26:0x[a-z0-9]*]] 'int' '+' -// CHECK-NEXT: |-CallExpr [[ADDR_27:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_28:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_29:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// CHECK-NEXT: `-CallExpr [[ADDR_30:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_31:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_11]] 'also_before' 'int ({{.*}})' +// CHECK-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <> Implicit implementation={vendor(ibm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(ibm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <> Implicit implementation={vendor(ibm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after[implementation={vendor(ibm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_10]] line:10:1 also_after[implementation={vendor(ibm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] 'int' 1 +// CHECK-NEXT: |-FunctionDecl [[ADDR_6]] line:13:1 also_before[implementation={vendor(ibm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] 'int' 2 +// CHECK-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_7]] line:18:5 used also_after 'int ({{.*}})' +// CHECK-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(ibm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(ibm)}]' 'int ({{.*}})' +// CHECK-NEXT: `-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] line:22:5 main 'int ({{.*}})' +// CHECK-NEXT: `-CompoundStmt [[ADDR_23:0x[a-z0-9]*]] +// CHECK-NEXT: `-ReturnStmt [[ADDR_24:0x[a-z0-9]*]] +// CHECK-NEXT: `-BinaryOperator [[ADDR_25:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: |-CallExpr [[ADDR_26:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_27:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_28:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})' +// CHECK-NEXT: `-CallExpr [[ADDR_29:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_30:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: `-DeclRefExpr [[ADDR_31:0x[a-z0-9]*]] '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 cf5c1f3..baf3044 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 @@ -35,48 +35,47 @@ int test() { // 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]] col:5 implicit used OK_1 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_2:0x[a-z0-9]*]] <> Implicit implementation={vendor(intel)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_3:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_4:0x[a-z0-9]*]] 'OK_1[implementation={vendor(intel)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_4]] line:8:1 OK_1[implementation={vendor(intel)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_5:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_6:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_7:0x[a-z0-9]*]] 'int' 1 -// CHECK-NEXT: |-FunctionDecl [[ADDR_8:0x[a-z0-9]*]] col:5 implicit OK_2 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_9:0x[a-z0-9]*]] <> Implicit implementation={vendor(intel)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_10:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_11:0x[a-z0-9]*]] 'OK_2[implementation={vendor(intel)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_11]] line:11:1 OK_2[implementation={vendor(intel)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_12:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_13:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_14:0x[a-z0-9]*]] 'int' 1 -// CHECK-NEXT: |-FunctionDecl [[ADDR_15:0x[a-z0-9]*]] col:5 implicit used not_OK 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_16:0x[a-z0-9]*]] <> Implicit implementation={vendor(intel)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_17:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_18:0x[a-z0-9]*]] 'not_OK[implementation={vendor(intel)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_18]] line:14:1 not_OK[implementation={vendor(intel)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] 'int' 1 -// CHECK-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] col:5 implicit used OK_3 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_23:0x[a-z0-9]*]] <> Implicit implementation={vendor(intel)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_24:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_25:0x[a-z0-9]*]] 'OK_3[implementation={vendor(intel)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_25]] line:17:1 OK_3[implementation={vendor(intel)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_26:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_27:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_28:0x[a-z0-9]*]] 'int' 1 -// CHECK-NEXT: |-FunctionDecl [[ADDR_29:0x[a-z0-9]*]] prev [[ADDR_22]] col:5 used OK_3 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_30:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(intel)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_24]] 'int ({{.*}})' Function [[ADDR_25]] 'OK_3[implementation={vendor(intel)}]' 'int ({{.*}})' -// CHECK-NEXT: `-FunctionDecl [[ADDR_31:0x[a-z0-9]*]] line:24:5 test 'int ({{.*}})' -// CHECK-NEXT: `-CompoundStmt [[ADDR_32:0x[a-z0-9]*]] -// CHECK-NEXT: `-ReturnStmt [[ADDR_33:0x[a-z0-9]*]] -// CHECK-NEXT: `-BinaryOperator [[ADDR_34:0x[a-z0-9]*]] 'int' '+' -// CHECK-NEXT: |-BinaryOperator [[ADDR_35:0x[a-z0-9]*]] 'int' '+' -// CHECK-NEXT: | |-CallExpr [[ADDR_36:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_1]] 'OK_1' 'int ({{.*}})' -// CHECK-NEXT: | `-CallExpr [[ADDR_39:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_40:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_41:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_15]] 'not_OK' 'int ({{.*}})' -// CHECK-NEXT: `-CallExpr [[ADDR_42:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_43:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: `-DeclRefExpr [[ADDR_44:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_29]] 'OK_3' 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_1:0x[a-z0-9]*]] <> Implicit implementation={vendor(intel)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'OK_1[implementation={vendor(intel)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_3]] line:8:1 OK_1[implementation={vendor(intel)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_4:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_5:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_6:0x[a-z0-9]*]] 'int' 1 +// CHECK-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] col:5 implicit OK_2 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <> Implicit implementation={vendor(intel)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'OK_2[implementation={vendor(intel)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_10]] line:11:1 OK_2[implementation={vendor(intel)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] 'int' 1 +// CHECK-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] col:5 implicit used not_OK 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_15:0x[a-z0-9]*]] <> Implicit implementation={vendor(intel)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_16:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_17:0x[a-z0-9]*]] 'not_OK[implementation={vendor(intel)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_17]] line:14:1 not_OK[implementation={vendor(intel)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] 'int' 1 +// CHECK-NEXT: |-FunctionDecl [[ADDR_21:0x[a-z0-9]*]] col:5 implicit used OK_3 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <> Implicit implementation={vendor(intel)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_23:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_24:0x[a-z0-9]*]] 'OK_3[implementation={vendor(intel)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_24]] line:17:1 OK_3[implementation={vendor(intel)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_25:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_26:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_27:0x[a-z0-9]*]] 'int' 1 +// CHECK-NEXT: |-FunctionDecl [[ADDR_28:0x[a-z0-9]*]] prev [[ADDR_21]] col:5 used OK_3 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_29:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(intel)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_23]] 'int ({{.*}})' Function [[ADDR_24]] 'OK_3[implementation={vendor(intel)}]' 'int ({{.*}})' +// CHECK-NEXT: `-FunctionDecl [[ADDR_30:0x[a-z0-9]*]] line:24:5 test 'int ({{.*}})' +// CHECK-NEXT: `-CompoundStmt [[ADDR_31:0x[a-z0-9]*]] +// CHECK-NEXT: `-ReturnStmt [[ADDR_32:0x[a-z0-9]*]] +// CHECK-NEXT: `-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: |-BinaryOperator [[ADDR_34:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: | |-CallExpr [[ADDR_35:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_36:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_37:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'OK_1' 'int ({{.*}})' +// CHECK-NEXT: | `-CallExpr [[ADDR_38:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_39:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'not_OK' 'int ({{.*}})' +// CHECK-NEXT: `-CallExpr [[ADDR_41:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: `-DeclRefExpr [[ADDR_43:0x[a-z0-9]*]] '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 efedd2f..a9b03f8 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 @@ -34,49 +34,46 @@ int test() { // - 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]*]] <> Implicit device={kind(cpu)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_3]] line:6:1 also_before[device={kind(cpu)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_4:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_5:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_6:0x[a-z0-9]*]] 'int' 1 -// CHECK-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <> Implicit implementation={vendor(score(0): llvm)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_10]] line:12:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] 'int' 0 -// CHECK-NEXT: |-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] prev [[ADDR_0]] col:5 implicit used also_before 'int ({{.*}})' -// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_15:0x[a-z0-9]*]] <> Inherited Implicit device={kind(cpu)} -// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_2]] 'int ({{.*}})' Function [[ADDR_3]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})' -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_16:0x[a-z0-9]*]] <> Implicit implementation={vendor(score(100): llvm)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_17:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_18:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CHECK-NEXT: |-FunctionDecl [[ADDR_18]] line:17:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' -// CHECK-NEXT: | `-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] -// CHECK-NEXT: | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] -// CHECK-NEXT: | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] 'int' 0 -// CHECK-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] prev [[ADDR_7]] line:22:5 used also_after 'int ({{.*}})' -// CHECK-NEXT: | |-CompoundStmt [[ADDR_23:0x[a-z0-9]*]] -// CHECK-NEXT: | | `-ReturnStmt [[ADDR_24:0x[a-z0-9]*]] -// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_25:0x[a-z0-9]*]] 'int' 2 -// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_26:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(score(0): llvm)} -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CHECK-NEXT: `-FunctionDecl [[ADDR_27:0x[a-z0-9]*]] line:26:5 test 'int ({{.*}})' -// CHECK-NEXT: `-CompoundStmt [[ADDR_28:0x[a-z0-9]*]] -// CHECK-NEXT: `-ReturnStmt [[ADDR_29:0x[a-z0-9]*]] -// CHECK-NEXT: `-BinaryOperator [[ADDR_30:0x[a-z0-9]*]] 'int' '+' -// CHECK-NEXT: |-PseudoObjectExpr [[ADDR_31:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | |-CallExpr [[ADDR_32:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_33:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_34:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_22]] 'also_after' 'int ({{.*}})' -// CHECK-NEXT: | `-CallExpr [[ADDR_35:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_36:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_37:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: |-CallExpr [[ADDR_38:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_39:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'also_before' 'int ({{.*}})' -// CHECK-NEXT: `-CallExpr [[ADDR_41:0x[a-z0-9]*]] 'int' -// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CHECK-NEXT: `-DeclRefExpr [[ADDR_17]] 'int ({{.*}})' Function [[ADDR_18]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_1:0x[a-z0-9]*]] <> Implicit device={kind(cpu)} +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_2:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_3:0x[a-z0-9]*]] 'also_before[device={kind(cpu)}]' 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <> Implicit implementation={vendor(score(100): llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_3]] line:6:1 also_before[device={kind(cpu)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_7:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_8:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_9:0x[a-z0-9]*]] 'int' 1 +// CHECK-NEXT: |-FunctionDecl [[ADDR_10:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_11:0x[a-z0-9]*]] <> Implicit implementation={vendor(score(0): llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_12:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_13:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_13]] line:12:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: |-FunctionDecl [[ADDR_6]] line:17:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_17:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_18:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_19:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: |-FunctionDecl [[ADDR_20:0x[a-z0-9]*]] prev [[ADDR_10]] line:22:5 used also_after 'int ({{.*}})' +// CHECK-NEXT: | |-CompoundStmt [[ADDR_21:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_22:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_23:0x[a-z0-9]*]] 'int' 2 +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_24:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(score(0): llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_12]] 'int ({{.*}})' Function [[ADDR_13]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: `-FunctionDecl [[ADDR_25:0x[a-z0-9]*]] line:26:5 test 'int ({{.*}})' +// CHECK-NEXT: `-CompoundStmt [[ADDR_26:0x[a-z0-9]*]] +// CHECK-NEXT: `-ReturnStmt [[ADDR_27:0x[a-z0-9]*]] +// CHECK-NEXT: `-BinaryOperator [[ADDR_28:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: |-PseudoObjectExpr [[ADDR_29:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | |-CallExpr [[ADDR_30:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_31:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_32:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_20]] 'also_after' 'int ({{.*}})' +// CHECK-NEXT: | `-CallExpr [[ADDR_33:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_12]] 'int ({{.*}})' Function [[ADDR_13]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: `-PseudoObjectExpr [[ADDR_35:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: |-CallExpr [[ADDR_36:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})' +// CHECK-NEXT: `-CallExpr [[ADDR_39:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_40:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: `-DeclRefExpr [[ADDR_5]] 'int ({{.*}})' Function [[ADDR_6]] '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 af61859..b2ab2fac 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 @@ -36,149 +36,147 @@ int main() { // - 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]*]] -// C-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] -// C-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 0 -// C-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' -// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} -// C-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// C-NEXT: |-FunctionDecl [[ADDR_7]] line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' -// C-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] -// C-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] -// C-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] 'int' 1 -// C-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] col:5 implicit used also_before 'int ({{.*}})' -// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} -// C-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' -// C-NEXT: |-FunctionDecl [[ADDR_14]] line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' -// C-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] -// C-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] -// C-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] 'int' 2 -// C-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] line:18:5 used also_after 'int ({{.*}})' -// C-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] -// C-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] -// C-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] 'int' 0 -// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} -// C-NEXT: | `-DeclRefExpr [[ADDR_6]] 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// C-NEXT: |-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] col:6 used foo 'void ({{.*}})' -// C-NEXT: |-TypedefDecl [[ADDR_24:0x[a-z0-9]*]] 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:5 main 'int ({{.*}})' -// C-NEXT: `-CompoundStmt [[ADDR_30:0x[a-z0-9]*]] -// C-NEXT: |-DeclStmt [[ADDR_31:0x[a-z0-9]*]] -// C-NEXT: | `-VarDecl [[ADDR_32:0x[a-z0-9]*]] col:6 used fns 'fd [2]' -// C-NEXT: |-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' '=' -// C-NEXT: | |-ArraySubscriptExpr [[ADDR_34:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue -// C-NEXT: | | |-ImplicitCastExpr [[ADDR_35:0x[a-z0-9]*]] 'fd *' -// C-NEXT: | | | `-DeclRefExpr [[ADDR_36:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]' -// C-NEXT: | | `-IntegerLiteral [[ADDR_37:0x[a-z0-9]*]] 'int' 0 -// C-NEXT: | `-UnaryOperator [[ADDR_38:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow -// C-NEXT: | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_11]] 'also_before' 'int ({{.*}})' -// C-NEXT: |-BinaryOperator [[ADDR_40:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' '=' -// C-NEXT: | |-ArraySubscriptExpr [[ADDR_41:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue -// C-NEXT: | | |-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] 'fd *' -// C-NEXT: | | | `-DeclRefExpr [[ADDR_43:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]' -// C-NEXT: | | `-IntegerLiteral [[ADDR_44:0x[a-z0-9]*]] 'int' 1 -// C-NEXT: | `-ImplicitCastExpr [[ADDR_45:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | `-DeclRefExpr [[ADDR_46:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// C-NEXT: `-ReturnStmt [[ADDR_47:0x[a-z0-9]*]] -// C-NEXT: `-BinaryOperator [[ADDR_48:0x[a-z0-9]*]] 'int' '+' -// C-NEXT: |-BinaryOperator [[ADDR_49:0x[a-z0-9]*]] 'int' '+' -// C-NEXT: | |-CallExpr [[ADDR_50:0x[a-z0-9]*]] 'int' -// C-NEXT: | | `-ParenExpr [[ADDR_51:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | | `-BinaryOperator [[ADDR_52:0x[a-z0-9]*]] 'int (*)({{.*}})' ',' -// C-NEXT: | | |-CallExpr [[ADDR_53:0x[a-z0-9]*]] 'void' -// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_54:0x[a-z0-9]*]] 'void (*)({{.*}})' -// C-NEXT: | | | `-DeclRefExpr [[ADDR_55:0x[a-z0-9]*]] 'void ({{.*}})' Function [[ADDR_23]] 'foo' 'void ({{.*}})' -// C-NEXT: | | `-ImplicitCastExpr [[ADDR_56:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | | `-DeclRefExpr [[ADDR_57:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// C-NEXT: | `-CallExpr [[ADDR_58:0x[a-z0-9]*]] 'int' -// C-NEXT: | `-ImplicitCastExpr [[ADDR_59:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' -// C-NEXT: | `-ParenExpr [[ADDR_60:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue -// C-NEXT: | `-ArraySubscriptExpr [[ADDR_61:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue -// C-NEXT: | |-ImplicitCastExpr [[ADDR_62:0x[a-z0-9]*]] 'fd *' -// C-NEXT: | | `-DeclRefExpr [[ADDR_63:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]' -// C-NEXT: | `-IntegerLiteral [[ADDR_64:0x[a-z0-9]*]] 'int' 0 -// C-NEXT: `-CallExpr [[ADDR_65:0x[a-z0-9]*]] 'int' -// C-NEXT: `-ImplicitCastExpr [[ADDR_66:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' -// C-NEXT: `-ParenExpr [[ADDR_67:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue -// C-NEXT: `-ArraySubscriptExpr [[ADDR_68:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue -// C-NEXT: |-IntegerLiteral [[ADDR_69:0x[a-z0-9]*]] 'int' 1 -// C-NEXT: `-ImplicitCastExpr [[ADDR_70:0x[a-z0-9]*]] 'fd *' -// C-NEXT: `-DeclRefExpr [[ADDR_71:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]' +// C-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_10]] line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' +// C-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] +// C-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] +// C-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] 'int' 1 +// C-NEXT: |-FunctionDecl [[ADDR_6]] line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' +// C-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] +// C-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] +// C-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] 'int' 2 +// C-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_7]] line:18:5 used also_after 'int ({{.*}})' +// C-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] +// C-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] +// C-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// C-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// C-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] col:6 used foo 'void ({{.*}})' +// C-NEXT: |-TypedefDecl [[ADDR_23:0x[a-z0-9]*]] 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:5 main 'int ({{.*}})' +// C-NEXT: `-CompoundStmt [[ADDR_29:0x[a-z0-9]*]] +// C-NEXT: |-DeclStmt [[ADDR_30:0x[a-z0-9]*]] +// C-NEXT: | `-VarDecl [[ADDR_31:0x[a-z0-9]*]] col:6 used fns 'fd [2]' +// C-NEXT: |-BinaryOperator [[ADDR_32:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' '=' +// C-NEXT: | |-ArraySubscriptExpr [[ADDR_33:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue +// C-NEXT: | | |-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] 'fd *' +// C-NEXT: | | | `-DeclRefExpr [[ADDR_35:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]' +// C-NEXT: | | `-IntegerLiteral [[ADDR_36:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: | `-UnaryOperator [[ADDR_37:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow +// C-NEXT: | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_0]] 'also_before' 'int ({{.*}})' +// C-NEXT: |-BinaryOperator [[ADDR_39:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' '=' +// C-NEXT: | |-ArraySubscriptExpr [[ADDR_40:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue +// C-NEXT: | | |-ImplicitCastExpr [[ADDR_41:0x[a-z0-9]*]] 'fd *' +// C-NEXT: | | | `-DeclRefExpr [[ADDR_42:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]' +// C-NEXT: | | `-IntegerLiteral [[ADDR_43:0x[a-z0-9]*]] 'int' 1 +// C-NEXT: | `-ImplicitCastExpr [[ADDR_44:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | `-DeclRefExpr [[ADDR_45:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_17]] 'also_after' 'int ({{.*}})' +// C-NEXT: `-ReturnStmt [[ADDR_46:0x[a-z0-9]*]] +// C-NEXT: `-BinaryOperator [[ADDR_47:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: |-BinaryOperator [[ADDR_48:0x[a-z0-9]*]] 'int' '+' +// C-NEXT: | |-CallExpr [[ADDR_49:0x[a-z0-9]*]] 'int' +// C-NEXT: | | `-ParenExpr [[ADDR_50:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | `-BinaryOperator [[ADDR_51:0x[a-z0-9]*]] 'int (*)({{.*}})' ',' +// C-NEXT: | | |-CallExpr [[ADDR_52:0x[a-z0-9]*]] 'void' +// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_53:0x[a-z0-9]*]] 'void (*)({{.*}})' +// C-NEXT: | | | `-DeclRefExpr [[ADDR_54:0x[a-z0-9]*]] 'void ({{.*}})' Function [[ADDR_22]] 'foo' 'void ({{.*}})' +// C-NEXT: | | `-ImplicitCastExpr [[ADDR_55:0x[a-z0-9]*]] 'int (*)({{.*}})' +// C-NEXT: | | `-DeclRefExpr [[ADDR_56:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_17]] 'also_after' 'int ({{.*}})' +// C-NEXT: | `-CallExpr [[ADDR_57:0x[a-z0-9]*]] 'int' +// C-NEXT: | `-ImplicitCastExpr [[ADDR_58:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' +// C-NEXT: | `-ParenExpr [[ADDR_59:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue +// C-NEXT: | `-ArraySubscriptExpr [[ADDR_60:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue +// C-NEXT: | |-ImplicitCastExpr [[ADDR_61:0x[a-z0-9]*]] 'fd *' +// C-NEXT: | | `-DeclRefExpr [[ADDR_62:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]' +// C-NEXT: | `-IntegerLiteral [[ADDR_63:0x[a-z0-9]*]] 'int' 0 +// C-NEXT: `-CallExpr [[ADDR_64:0x[a-z0-9]*]] 'int' +// C-NEXT: `-ImplicitCastExpr [[ADDR_65:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' +// C-NEXT: `-ParenExpr [[ADDR_66:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue +// C-NEXT: `-ArraySubscriptExpr [[ADDR_67:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue +// C-NEXT: |-IntegerLiteral [[ADDR_68:0x[a-z0-9]*]] 'int' 1 +// C-NEXT: `-ImplicitCastExpr [[ADDR_69:0x[a-z0-9]*]] 'fd *' +// C-NEXT: `-DeclRefExpr [[ADDR_70:0x[a-z0-9]*]] '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]*]] -// CXX-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] -// CXX-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 0 -// CXX-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' -// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} -// CXX-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CXX-NEXT: |-FunctionDecl [[ADDR_7]] line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' -// CXX-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] -// CXX-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] -// CXX-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] 'int' 1 -// CXX-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] col:5 implicit used also_before 'int ({{.*}})' -// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} -// CXX-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CXX-NEXT: |-FunctionDecl [[ADDR_14]] line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' -// CXX-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] -// CXX-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] -// CXX-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] 'int' 2 -// CXX-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] line:18:5 used also_after 'int ({{.*}})' -// CXX-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] -// CXX-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] -// CXX-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] 'int' 0 -// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} -// CXX-NEXT: | `-DeclRefExpr [[ADDR_6]] 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CXX-NEXT: |-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] col:6 used foo 'void ({{.*}})' -// CXX-NEXT: |-TypedefDecl [[ADDR_24:0x[a-z0-9]*]] 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:5 main 'int ({{.*}})' -// CXX-NEXT: `-CompoundStmt [[ADDR_30:0x[a-z0-9]*]] -// CXX-NEXT: |-DeclStmt [[ADDR_31:0x[a-z0-9]*]] -// CXX-NEXT: | `-VarDecl [[ADDR_32:0x[a-z0-9]*]] col:6 used fns 'fd [2]' -// CXX-NEXT: |-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' {{.*}}'=' -// CXX-NEXT: | |-ArraySubscriptExpr [[ADDR_34:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue -// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_35:0x[a-z0-9]*]] 'fd *' -// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_36:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]' -// CXX-NEXT: | | `-IntegerLiteral [[ADDR_37:0x[a-z0-9]*]] 'int' 0 -// CXX-NEXT: | `-UnaryOperator [[ADDR_38:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow -// CXX-NEXT: | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_11]] 'also_before' 'int ({{.*}})' -// CXX-NEXT: |-BinaryOperator [[ADDR_40:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' {{.*}}'=' -// CXX-NEXT: | |-ArraySubscriptExpr [[ADDR_41:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue -// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] 'fd *' -// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_43:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]' -// CXX-NEXT: | | `-IntegerLiteral [[ADDR_44:0x[a-z0-9]*]] 'int' 1 -// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_45:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: | `-DeclRefExpr [[ADDR_46:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// CXX-NEXT: `-ReturnStmt [[ADDR_47:0x[a-z0-9]*]] -// CXX-NEXT: `-BinaryOperator [[ADDR_48:0x[a-z0-9]*]] 'int' '+' -// CXX-NEXT: |-BinaryOperator [[ADDR_49:0x[a-z0-9]*]] 'int' '+' -// CXX-NEXT: | |-CallExpr [[ADDR_50:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_51:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: | | `-ParenExpr [[ADDR_52:0x[a-z0-9]*]] 'int ({{.*}})' lvalue -// CXX-NEXT: | | `-BinaryOperator [[ADDR_53:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}',' -// CXX-NEXT: | | |-CallExpr [[ADDR_54:0x[a-z0-9]*]] 'void' -// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_55:0x[a-z0-9]*]] 'void (*)({{.*}})' -// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_56:0x[a-z0-9]*]] 'void ({{.*}})' {{.*}}Function [[ADDR_23]] 'foo' 'void ({{.*}})' -// CXX-NEXT: | | `-DeclRefExpr [[ADDR_57:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// CXX-NEXT: | `-CallExpr [[ADDR_58:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_59:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' -// CXX-NEXT: | `-ParenExpr [[ADDR_60:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue -// CXX-NEXT: | `-ArraySubscriptExpr [[ADDR_61:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue -// CXX-NEXT: | |-ImplicitCastExpr [[ADDR_62:0x[a-z0-9]*]] 'fd *' -// CXX-NEXT: | | `-DeclRefExpr [[ADDR_63:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]' -// CXX-NEXT: | `-IntegerLiteral [[ADDR_64:0x[a-z0-9]*]] 'int' 0 -// CXX-NEXT: `-CallExpr [[ADDR_65:0x[a-z0-9]*]] 'int' -// CXX-NEXT: `-ImplicitCastExpr [[ADDR_66:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' -// CXX-NEXT: `-ParenExpr [[ADDR_67:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue -// CXX-NEXT: `-ArraySubscriptExpr [[ADDR_68:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue -// CXX-NEXT: |-IntegerLiteral [[ADDR_69:0x[a-z0-9]*]] 'int' 1 -// CXX-NEXT: `-ImplicitCastExpr [[ADDR_70:0x[a-z0-9]*]] 'fd *' -// CXX-NEXT: `-DeclRefExpr [[ADDR_71:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_32]] 'fns' 'fd [2]' +// CXX-NEXT: | |-CompoundStmt [[ADDR_1:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: |-FunctionDecl [[ADDR_10]] line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' +// CXX-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] 'int' 1 +// CXX-NEXT: |-FunctionDecl [[ADDR_6]] line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' +// CXX-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] +// CXX-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] +// CXX-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] 'int' 2 +// CXX-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_7]] line:18:5 used also_after 'int ({{.*}})' +// CXX-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] +// CXX-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// CXX-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CXX-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] col:6 used foo 'void ({{.*}})' +// CXX-NEXT: |-TypedefDecl [[ADDR_23:0x[a-z0-9]*]] 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:5 main 'int ({{.*}})' +// CXX-NEXT: `-CompoundStmt [[ADDR_29:0x[a-z0-9]*]] +// CXX-NEXT: |-DeclStmt [[ADDR_30:0x[a-z0-9]*]] +// CXX-NEXT: | `-VarDecl [[ADDR_31:0x[a-z0-9]*]] col:6 used fns 'fd [2]' +// CXX-NEXT: |-BinaryOperator [[ADDR_32:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' {{.*}}'=' +// CXX-NEXT: | |-ArraySubscriptExpr [[ADDR_33:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue +// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_34:0x[a-z0-9]*]] 'fd *' +// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_35:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]' +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_36:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: | `-UnaryOperator [[ADDR_37:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow +// CXX-NEXT: | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})' +// CXX-NEXT: |-BinaryOperator [[ADDR_39:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' {{.*}}'=' +// CXX-NEXT: | |-ArraySubscriptExpr [[ADDR_40:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue +// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_41:0x[a-z0-9]*]] 'fd *' +// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_42:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]' +// CXX-NEXT: | | `-IntegerLiteral [[ADDR_43:0x[a-z0-9]*]] 'int' 1 +// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_44:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | `-DeclRefExpr [[ADDR_45:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})' +// CXX-NEXT: `-ReturnStmt [[ADDR_46:0x[a-z0-9]*]] +// CXX-NEXT: `-BinaryOperator [[ADDR_47:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: |-BinaryOperator [[ADDR_48:0x[a-z0-9]*]] 'int' '+' +// CXX-NEXT: | |-CallExpr [[ADDR_49:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_50:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CXX-NEXT: | | `-ParenExpr [[ADDR_51:0x[a-z0-9]*]] 'int ({{.*}})' lvalue +// CXX-NEXT: | | `-BinaryOperator [[ADDR_52:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}',' +// CXX-NEXT: | | |-CallExpr [[ADDR_53:0x[a-z0-9]*]] 'void' +// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_54:0x[a-z0-9]*]] 'void (*)({{.*}})' +// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_55:0x[a-z0-9]*]] 'void ({{.*}})' {{.*}}Function [[ADDR_22]] 'foo' 'void ({{.*}})' +// CXX-NEXT: | | `-DeclRefExpr [[ADDR_56:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})' +// CXX-NEXT: | `-CallExpr [[ADDR_57:0x[a-z0-9]*]] 'int' +// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_58:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' +// CXX-NEXT: | `-ParenExpr [[ADDR_59:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue +// CXX-NEXT: | `-ArraySubscriptExpr [[ADDR_60:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue +// CXX-NEXT: | |-ImplicitCastExpr [[ADDR_61:0x[a-z0-9]*]] 'fd *' +// CXX-NEXT: | | `-DeclRefExpr [[ADDR_62:0x[a-z0-9]*]] 'fd [2]' {{.*}}Var [[ADDR_31]] 'fns' 'fd [2]' +// CXX-NEXT: | `-IntegerLiteral [[ADDR_63:0x[a-z0-9]*]] 'int' 0 +// CXX-NEXT: `-CallExpr [[ADDR_64:0x[a-z0-9]*]] 'int' +// CXX-NEXT: `-ImplicitCastExpr [[ADDR_65:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' +// CXX-NEXT: `-ParenExpr [[ADDR_66:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue +// CXX-NEXT: `-ArraySubscriptExpr [[ADDR_67:0x[a-z0-9]*]] 'fd':'int (*)({{.*}})' lvalue +// CXX-NEXT: |-IntegerLiteral [[ADDR_68:0x[a-z0-9]*]] 'int' 1 +// CXX-NEXT: `-ImplicitCastExpr [[ADDR_69:0x[a-z0-9]*]] 'fd *' +// CXX-NEXT: `-DeclRefExpr [[ADDR_70:0x[a-z0-9]*]] '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 1cb39da..903cd79 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 @@ -1,5 +1,5 @@ -// 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 +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify -ast-dump %s -x c++| FileCheck %s // expected-no-diagnostics int also_before(void) { @@ -34,118 +34,59 @@ 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]*]] -// CXX-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] -// CXX-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 0 -// CXX-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' -// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} -// CXX-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CXX-NEXT: |-FunctionDecl [[ADDR_7]] line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' -// CXX-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] -// CXX-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] -// CXX-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] 'int' 1 -// CXX-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] col:5 implicit used also_before 'int ({{.*}})' -// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} -// CXX-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CXX-NEXT: |-FunctionDecl [[ADDR_14]] line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' -// CXX-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] -// CXX-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] -// CXX-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] 'int' 2 -// CXX-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] line:18:5 used also_after 'int ({{.*}})' -// CXX-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] -// CXX-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] -// CXX-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] 'int' 0 -// CXX-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} -// CXX-NEXT: | `-DeclRefExpr [[ADDR_6]] 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// CXX-NEXT: |-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] line:22:5 used test 'int (int (*)({{.*}}))' -// CXX-NEXT: | |-ParmVarDecl [[ADDR_24:0x[a-z0-9]*]] col:16 used fd 'int (*)({{.*}})' -// CXX-NEXT: | `-CompoundStmt [[ADDR_25:0x[a-z0-9]*]] -// CXX-NEXT: | `-ReturnStmt [[ADDR_26:0x[a-z0-9]*]] -// CXX-NEXT: | `-CallExpr [[ADDR_27:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | `-ImplicitCastExpr [[ADDR_28:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: | `-DeclRefExpr [[ADDR_29:0x[a-z0-9]*]] 'int (*)({{.*}})' {{.*}}ParmVar [[ADDR_24]] 'fd' 'int (*)({{.*}})' -// CXX-NEXT: `-FunctionDecl [[ADDR_30:0x[a-z0-9]*]] line:25:5 main 'int ({{.*}})' -// CXX-NEXT: `-CompoundStmt [[ADDR_31:0x[a-z0-9]*]] -// CXX-NEXT: `-ReturnStmt [[ADDR_32:0x[a-z0-9]*]] -// CXX-NEXT: `-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] 'int' '+' -// CXX-NEXT: |-BinaryOperator [[ADDR_34:0x[a-z0-9]*]] 'int' '+' -// CXX-NEXT: | |-BinaryOperator [[ADDR_35:0x[a-z0-9]*]] 'int' '+' -// CXX-NEXT: | | |-CallExpr [[ADDR_36:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | | | |-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] 'int (*)(int (*)({{.*}}))' -// CXX-NEXT: | | | | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))' -// CXX-NEXT: | | | `-ImplicitCastExpr [[ADDR_39:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// CXX-NEXT: | | `-CallExpr [[ADDR_41:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | | |-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] 'int (*)(int (*)({{.*}}))' -// CXX-NEXT: | | | `-DeclRefExpr [[ADDR_43:0x[a-z0-9]*]] 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))' -// CXX-NEXT: | | `-ImplicitCastExpr [[ADDR_44:0x[a-z0-9]*]] 'int (*)({{.*}})' -// CXX-NEXT: | | `-DeclRefExpr [[ADDR_45:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_11]] 'also_before' 'int ({{.*}})' -// CXX-NEXT: | `-CallExpr [[ADDR_46:0x[a-z0-9]*]] 'int' -// CXX-NEXT: | |-ImplicitCastExpr [[ADDR_47:0x[a-z0-9]*]] 'int (*)(int (*)({{.*}}))' -// CXX-NEXT: | | `-DeclRefExpr [[ADDR_48:0x[a-z0-9]*]] 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))' -// CXX-NEXT: | `-UnaryOperator [[ADDR_49:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow -// CXX-NEXT: | `-DeclRefExpr [[ADDR_50:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// CXX-NEXT: `-CallExpr [[ADDR_51:0x[a-z0-9]*]] 'int' -// CXX-NEXT: |-ImplicitCastExpr [[ADDR_52:0x[a-z0-9]*]] 'int (*)(int (*)({{.*}}))' -// CXX-NEXT: | `-DeclRefExpr [[ADDR_53:0x[a-z0-9]*]] 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))' -// CXX-NEXT: `-UnaryOperator [[ADDR_54:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow -// CXX-NEXT: `-DeclRefExpr [[ADDR_55:0x[a-z0-9]*]] '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]*]] -// C-NEXT: | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] -// C-NEXT: | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 0 -// C-NEXT: |-FunctionDecl [[ADDR_4:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' -// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_5:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} -// C-NEXT: | `-DeclRefExpr [[ADDR_6:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_7:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// C-NEXT: |-FunctionDecl [[ADDR_7]] line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' -// C-NEXT: | `-CompoundStmt [[ADDR_8:0x[a-z0-9]*]] -// C-NEXT: | `-ReturnStmt [[ADDR_9:0x[a-z0-9]*]] -// C-NEXT: | `-IntegerLiteral [[ADDR_10:0x[a-z0-9]*]] 'int' 1 -// C-NEXT: |-FunctionDecl [[ADDR_11:0x[a-z0-9]*]] prev [[ADDR_0]] col:5 implicit used also_before 'int ({{.*}})' -// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_12:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} -// C-NEXT: | `-DeclRefExpr [[ADDR_13:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_14:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' -// C-NEXT: |-FunctionDecl [[ADDR_14]] line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' -// C-NEXT: | `-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] -// C-NEXT: | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] -// C-NEXT: | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] 'int' 2 -// C-NEXT: |-FunctionDecl [[ADDR_18:0x[a-z0-9]*]] prev [[ADDR_4]] line:18:5 used also_after 'int ({{.*}})' -// C-NEXT: | |-CompoundStmt [[ADDR_19:0x[a-z0-9]*]] -// C-NEXT: | | `-ReturnStmt [[ADDR_20:0x[a-z0-9]*]] -// C-NEXT: | | `-IntegerLiteral [[ADDR_21:0x[a-z0-9]*]] 'int' 0 -// C-NEXT: | `-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} -// C-NEXT: | `-DeclRefExpr [[ADDR_6]] 'int ({{.*}})' Function [[ADDR_7]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' -// C-NEXT: |-FunctionDecl [[ADDR_23:0x[a-z0-9]*]] line:22:5 used test 'int (int (*)({{.*}}))' -// C-NEXT: | |-ParmVarDecl [[ADDR_24:0x[a-z0-9]*]] col:16 used fd 'int (*)({{.*}})' -// C-NEXT: | `-CompoundStmt [[ADDR_25:0x[a-z0-9]*]] -// C-NEXT: | `-ReturnStmt [[ADDR_26:0x[a-z0-9]*]] -// C-NEXT: | `-CallExpr [[ADDR_27:0x[a-z0-9]*]] 'int' -// C-NEXT: | `-ImplicitCastExpr [[ADDR_28:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | `-DeclRefExpr [[ADDR_29:0x[a-z0-9]*]] 'int (*)({{.*}})' {{.*}}ParmVar [[ADDR_24]] 'fd' 'int (*)({{.*}})' -// C-NEXT: `-FunctionDecl [[ADDR_30:0x[a-z0-9]*]] line:25:5 main 'int ({{.*}})' -// C-NEXT: `-CompoundStmt [[ADDR_31:0x[a-z0-9]*]] -// C-NEXT: `-ReturnStmt [[ADDR_32:0x[a-z0-9]*]] -// C-NEXT: `-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] 'int' '+' -// C-NEXT: |-BinaryOperator [[ADDR_34:0x[a-z0-9]*]] 'int' '+' -// C-NEXT: | |-BinaryOperator [[ADDR_35:0x[a-z0-9]*]] 'int' '+' -// C-NEXT: | | |-CallExpr [[ADDR_36:0x[a-z0-9]*]] 'int' -// C-NEXT: | | | |-ImplicitCastExpr [[ADDR_37:0x[a-z0-9]*]] 'int (*)(int (*)({{.*}}))' -// C-NEXT: | | | | `-DeclRefExpr [[ADDR_38:0x[a-z0-9]*]] 'int (int (*)({{.*}}))' Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))' -// C-NEXT: | | | `-ImplicitCastExpr [[ADDR_39:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | | | `-DeclRefExpr [[ADDR_40:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// C-NEXT: | | `-CallExpr [[ADDR_41:0x[a-z0-9]*]] 'int' -// C-NEXT: | | |-ImplicitCastExpr [[ADDR_42:0x[a-z0-9]*]] 'int (*)(int (*)({{.*}}))' -// C-NEXT: | | | `-DeclRefExpr [[ADDR_43:0x[a-z0-9]*]] 'int (int (*)({{.*}}))' Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))' -// C-NEXT: | | `-ImplicitCastExpr [[ADDR_44:0x[a-z0-9]*]] 'int (*)({{.*}})' -// C-NEXT: | | `-DeclRefExpr [[ADDR_45:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_11]] 'also_before' 'int ({{.*}})' -// C-NEXT: | `-CallExpr [[ADDR_46:0x[a-z0-9]*]] 'int' -// C-NEXT: | |-ImplicitCastExpr [[ADDR_47:0x[a-z0-9]*]] 'int (*)(int (*)({{.*}}))' -// C-NEXT: | | `-DeclRefExpr [[ADDR_48:0x[a-z0-9]*]] 'int (int (*)({{.*}}))' Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))' -// C-NEXT: | `-UnaryOperator [[ADDR_49:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow -// C-NEXT: | `-DeclRefExpr [[ADDR_50:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_18]] 'also_after' 'int ({{.*}})' -// C-NEXT: `-CallExpr [[ADDR_51:0x[a-z0-9]*]] 'int' -// C-NEXT: |-ImplicitCastExpr [[ADDR_52:0x[a-z0-9]*]] 'int (*)(int (*)({{.*}}))' -// C-NEXT: | `-DeclRefExpr [[ADDR_53:0x[a-z0-9]*]] 'int (int (*)({{.*}}))' Function [[ADDR_23]] 'test' 'int (int (*)({{.*}}))' -// C-NEXT: `-UnaryOperator [[ADDR_54:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow -// C-NEXT: `-DeclRefExpr [[ADDR_55:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_11]] 'also_before' 'int ({{.*}})' +// 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]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_2:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_3:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_4:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_5:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_6:0x[a-z0-9]*]] 'also_before[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_7:0x[a-z0-9]*]] col:5 implicit used also_after 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_8:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_10:0x[a-z0-9]*]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_10]] line:10:1 also_after[implementation={vendor(llvm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_11:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_12:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_13:0x[a-z0-9]*]] 'int' 1 +// CHECK-NEXT: |-FunctionDecl [[ADDR_6]] line:13:1 also_before[implementation={vendor(llvm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_14:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_15:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_16:0x[a-z0-9]*]] 'int' 2 +// CHECK-NEXT: |-FunctionDecl [[ADDR_17:0x[a-z0-9]*]] prev [[ADDR_7]] line:18:5 used also_after 'int ({{.*}})' +// CHECK-NEXT: | |-CompoundStmt [[ADDR_18:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_19:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_20:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_21:0x[a-z0-9]*]] <> Inherited Implicit implementation={vendor(llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_9]] 'int ({{.*}})' Function [[ADDR_10]] 'also_after[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_22:0x[a-z0-9]*]] line:22:5 used test 'int (int (*)({{.*}}))' +// CHECK-NEXT: | |-ParmVarDecl [[ADDR_23:0x[a-z0-9]*]] col:16 used fd 'int (*)({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_24:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_25:0x[a-z0-9]*]] +// CHECK-NEXT: | `-CallExpr [[ADDR_26:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_27:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_28:0x[a-z0-9]*]] 'int (*)({{.*}})' {{.*}}ParmVar [[ADDR_23]] 'fd' 'int (*)({{.*}})' +// CHECK-NEXT: `-FunctionDecl [[ADDR_29:0x[a-z0-9]*]] line:25:5 main 'int ({{.*}})' +// CHECK-NEXT: `-CompoundStmt [[ADDR_30:0x[a-z0-9]*]] +// CHECK-NEXT: `-ReturnStmt [[ADDR_31:0x[a-z0-9]*]] +// CHECK-NEXT: `-BinaryOperator [[ADDR_32:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: |-BinaryOperator [[ADDR_33:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: | |-BinaryOperator [[ADDR_34:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: | | |-CallExpr [[ADDR_35:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | | |-ImplicitCastExpr [[ADDR_36:0x[a-z0-9]*]] 'int (*)(int (*)({{.*}}))' +// CHECK-NEXT: | | | | `-DeclRefExpr [[ADDR_37:0x[a-z0-9]*]] 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_22]] 'test' 'int (int (*)({{.*}}))' +// CHECK-NEXT: | | | `-ImplicitCastExpr [[ADDR_38:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | | `-DeclRefExpr [[ADDR_39:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})' +// CHECK-NEXT: | | `-CallExpr [[ADDR_40:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | |-ImplicitCastExpr [[ADDR_41:0x[a-z0-9]*]] 'int (*)(int (*)({{.*}}))' +// CHECK-NEXT: | | | `-DeclRefExpr [[ADDR_42:0x[a-z0-9]*]] 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_22]] 'test' 'int (int (*)({{.*}}))' +// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_43:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_44:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_0]] 'also_before' 'int ({{.*}})' +// CHECK-NEXT: | `-CallExpr [[ADDR_45:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | |-ImplicitCastExpr [[ADDR_46:0x[a-z0-9]*]] 'int (*)(int (*)({{.*}}))' +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_47:0x[a-z0-9]*]] 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_22]] 'test' 'int (int (*)({{.*}}))' +// CHECK-NEXT: | `-UnaryOperator [[ADDR_48:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_49:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_17]] 'also_after' 'int ({{.*}})' +// CHECK-NEXT: `-CallExpr [[ADDR_50:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: |-ImplicitCastExpr [[ADDR_51:0x[a-z0-9]*]] 'int (*)(int (*)({{.*}}))' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_52:0x[a-z0-9]*]] 'int (int (*)({{.*}}))' {{.*}}Function [[ADDR_22]] 'test' 'int (int (*)({{.*}}))' +// CHECK-NEXT: `-UnaryOperator [[ADDR_53:0x[a-z0-9]*]] 'int (*)({{.*}})' prefix '&' cannot overflow +// CHECK-NEXT: `-DeclRefExpr [[ADDR_54:0x[a-z0-9]*]] '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 0000000..3cad174 --- /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:5 used foo 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_2:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_3:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_4:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: |-NamespaceDecl [[ADDR_5:0x[a-z0-9]*]] line:9:11 B +// CHECK-NEXT: | `-FunctionDecl [[ADDR_6:0x[a-z0-9]*]] line:10:5 used bar 'int ({{.*}})' +// CHECK-NEXT: | |-CompoundStmt [[ADDR_7:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_8:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_9:0x[a-z0-9]*]] 'int' 1 +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_10:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_11:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_12:0x[a-z0-9]*]] 'bar[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-NamespaceDecl [[ADDR_13:0x[a-z0-9]*]] line:15:11 C +// CHECK-NEXT: | `-FunctionDecl [[ADDR_14:0x[a-z0-9]*]] line:16:5 used baz 'int ({{.*}})' +// CHECK-NEXT: | |-CompoundStmt [[ADDR_15:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_16:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_17:0x[a-z0-9]*]] 'int' 2 +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_18:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_19:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_20:0x[a-z0-9]*]] 'baz[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_21:0x[a-z0-9]*]] col:5 implicit foo 'int ({{.*}})' +// CHECK-NEXT: | |-OMPDeclareVariantAttr [[ADDR_22:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_23:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_24:0x[a-z0-9]*]] 'foo[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: | `-OMPDeclareVariantAttr [[ADDR_25:0x[a-z0-9]*]] <> Implicit implementation={vendor(llvm)} +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_26:0x[a-z0-9]*]] 'int ({{.*}})' Function [[ADDR_27:0x[a-z0-9]*]] 'foo[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_24]] line:24:1 foo[implementation={vendor(llvm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_28:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_29:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_30:0x[a-z0-9]*]] 'int' 3 +// CHECK-NEXT: |-NamespaceDecl [[ADDR_31:0x[a-z0-9]*]] prev [[ADDR_5]] line:28:11 B +// CHECK-NEXT: | |-original Namespace [[ADDR_5]] 'B' +// CHECK-NEXT: | |-FunctionDecl [[ADDR_27]] line:30:1 foo[implementation={vendor(llvm)}] 'int ({{.*}})' +// CHECK-NEXT: | | `-CompoundStmt [[ADDR_32:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-ReturnStmt [[ADDR_33:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-IntegerLiteral [[ADDR_34:0x[a-z0-9]*]] 'int' 4 +// CHECK-NEXT: | `-FunctionDecl [[ADDR_12]] line:34:1 bar[implementation={vendor(llvm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_35:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_36:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_37:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: |-UsingDirectiveDecl [[ADDR_38:0x[a-z0-9]*]] col:17 Namespace [[ADDR_13]] 'C' +// CHECK-NEXT: |-FunctionDecl [[ADDR_20]] line:42:1 baz[implementation={vendor(llvm)}] 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_39:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_40:0x[a-z0-9]*]] +// CHECK-NEXT: | `-IntegerLiteral [[ADDR_41:0x[a-z0-9]*]] 'int' 0 +// CHECK-NEXT: |-FunctionDecl [[ADDR_42:0x[a-z0-9]*]] line:48:5 used explicit1 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_43:0x[a-z0-9]*]] +// CHECK-NEXT: | `-ReturnStmt [[ADDR_44:0x[a-z0-9]*]] +// CHECK-NEXT: | `-BinaryOperator [[ADDR_45:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: | |-BinaryOperator [[ADDR_46:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: | | |-CallExpr [[ADDR_47:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | | `-ImplicitCastExpr [[ADDR_48:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | | `-DeclRefExpr [[ADDR_49:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_1]] 'foo' 'int ({{.*}})' +// CHECK-NEXT: | | `-PseudoObjectExpr [[ADDR_50:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | |-CallExpr [[ADDR_51:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | | `-ImplicitCastExpr [[ADDR_52:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | | `-DeclRefExpr [[ADDR_53:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_6]] 'bar' 'int ({{.*}})' +// CHECK-NEXT: | | `-CallExpr [[ADDR_54:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_55:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_11]] 'int ({{.*}})' Function [[ADDR_12]] 'bar[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: | `-PseudoObjectExpr [[ADDR_56:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | |-CallExpr [[ADDR_57:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_58:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_59:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'baz' 'int ({{.*}})' +// CHECK-NEXT: | `-CallExpr [[ADDR_60:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_61:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_19]] 'int ({{.*}})' Function [[ADDR_20]] 'baz[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: |-FunctionDecl [[ADDR_62:0x[a-z0-9]*]] line:53:5 used implicit2 'int ({{.*}})' +// CHECK-NEXT: | `-CompoundStmt [[ADDR_63:0x[a-z0-9]*]] +// CHECK-NEXT: | |-DeclStmt [[ADDR_64:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-UsingDirectiveDecl [[ADDR_65:0x[a-z0-9]*]] col:19 Namespace [[ADDR_0]] 'A' +// CHECK-NEXT: | |-DeclStmt [[ADDR_66:0x[a-z0-9]*]] +// CHECK-NEXT: | | `-UsingDirectiveDecl [[ADDR_67:0x[a-z0-9]*]] col:19 Namespace [[ADDR_5]] 'B' +// CHECK-NEXT: | `-ReturnStmt [[ADDR_68:0x[a-z0-9]*]] +// CHECK-NEXT: | `-BinaryOperator [[ADDR_69:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: | |-PseudoObjectExpr [[ADDR_70:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | |-CallExpr [[ADDR_71:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | | `-ImplicitCastExpr [[ADDR_72:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | | `-DeclRefExpr [[ADDR_73:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_6]] 'bar' 'int ({{.*}})' +// CHECK-NEXT: | | `-CallExpr [[ADDR_74:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_75:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_11]] 'int ({{.*}})' Function [[ADDR_12]] 'bar[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: | `-PseudoObjectExpr [[ADDR_76:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | |-CallExpr [[ADDR_77:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | | `-ImplicitCastExpr [[ADDR_78:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | | `-DeclRefExpr [[ADDR_79:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_14]] 'baz' 'int ({{.*}})' +// CHECK-NEXT: | `-CallExpr [[ADDR_80:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_81:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_19]] 'int ({{.*}})' Function [[ADDR_20]] 'baz[implementation={vendor(llvm)}]' 'int ({{.*}})' +// CHECK-NEXT: `-FunctionDecl [[ADDR_82:0x[a-z0-9]*]] line:61:5 main 'int ({{.*}})' +// CHECK-NEXT: `-CompoundStmt [[ADDR_83:0x[a-z0-9]*]] +// CHECK-NEXT: `-ReturnStmt [[ADDR_84:0x[a-z0-9]*]] +// CHECK-NEXT: `-BinaryOperator [[ADDR_85:0x[a-z0-9]*]] 'int' '+' +// CHECK-NEXT: |-CallExpr [[ADDR_86:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: | `-ImplicitCastExpr [[ADDR_87:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: | `-DeclRefExpr [[ADDR_88:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_42]] 'explicit1' 'int ({{.*}})' +// CHECK-NEXT: `-CallExpr [[ADDR_89:0x[a-z0-9]*]] 'int' +// CHECK-NEXT: `-ImplicitCastExpr [[ADDR_90:0x[a-z0-9]*]] 'int (*)({{.*}})' +// CHECK-NEXT: `-DeclRefExpr [[ADDR_91:0x[a-z0-9]*]] 'int ({{.*}})' {{.*}}Function [[ADDR_62]] 'implicit2' 'int ({{.*}})' -- 2.7.4