Index: lib/AST/DeclPrinter.cpp =================================================================== --- lib/AST/DeclPrinter.cpp +++ lib/AST/DeclPrinter.cpp @@ -78,6 +78,10 @@ void VisitTemplateDecl(const TemplateDecl *D); void VisitFunctionTemplateDecl(FunctionTemplateDecl *D); void VisitClassTemplateDecl(ClassTemplateDecl *D); + void VisitClassTemplateSpecializationDecl( + ClassTemplateSpecializationDecl *D); + void VisitClassTemplatePartialSpecializationDecl( + ClassTemplatePartialSpecializationDecl *D); void VisitObjCMethodDecl(ObjCMethodDecl *D); void VisitObjCImplementationDecl(ObjCImplementationDecl *D); void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D); @@ -95,8 +99,9 @@ void VisitOMPDeclareReductionDecl(OMPDeclareReductionDecl *D); void VisitOMPCapturedExprDecl(OMPCapturedExprDecl *D); - void PrintTemplateParameters(const TemplateParameterList *Params, - const TemplateArgumentList *Args = nullptr); + void printTemplateParameters(const TemplateParameterList *Params); + void printTemplateArguments(const TemplateArgumentList &Args, + const TemplateParameterList *Params = nullptr); void prettyPrintAttributes(Decl *D); void prettyPrintPragmas(Decl *D); void printDeclType(QualType T, StringRef DeclName, bool Pack = false); @@ -290,6 +295,13 @@ if (D->isImplicit()) continue; + // Don't print implicit specializations, as they are printed when visiting + // corresponding templates. + if (auto FD = dyn_cast(*D)) + if (FD->getTemplateSpecializationKind() == TSK_ImplicitInstantiation && + !isa(DC)) + continue; + // The next bits of code handles stuff like "struct {int x;} a,b"; we're // forced to merge the declarations because there's no other way to // refer to the struct in question. This limited merging is safe without @@ -337,11 +349,19 @@ const char *Terminator = nullptr; if (isa(*D) || isa(*D)) Terminator = nullptr; - else if (isa(*D) && cast(*D)->hasBody()) - Terminator = nullptr; else if (isa(*D) && cast(*D)->hasBody()) Terminator = nullptr; - else if (isa(*D) || isa(*D) || + else if (auto FD = dyn_cast(*D)) { + if (FD->isThisDeclarationADefinition()) + Terminator = nullptr; + else + Terminator = ";"; + } else if (auto TD = dyn_cast(*D)) { + if (TD->getTemplatedDecl()->isThisDeclarationADefinition()) + Terminator = nullptr; + else + Terminator = ";"; + } else if (isa(*D) || isa(*D) || isa(*D) || isa(*D) || isa(*D) || @@ -358,7 +378,14 @@ if (Terminator) Out << Terminator; - Out << "\n"; + if (!Policy.TerseOutput && + ((isa(*D) && + cast(*D)->doesThisDeclarationHaveABody()) || + (isa(*D) && + cast(*D)->getTemplatedDecl()->doesThisDeclarationHaveABody()))) + ; // StmtPrinter already added '\n' after CompoundStmt. + else + Out << "\n"; // Declare target attribute is special one, natural spelling for the pragma // assumes "ending" construct so print it here. @@ -448,6 +475,9 @@ !D->isFunctionTemplateSpecialization()) prettyPrintPragmas(D); + if (D->isFunctionTemplateSpecialization()) + Out << "template<> "; + CXXConstructorDecl *CDecl = dyn_cast(D); CXXConversionDecl *ConversionDecl = dyn_cast(D); if (!Policy.SuppressSpecifiers) { @@ -472,6 +502,11 @@ PrintingPolicy SubPolicy(Policy); SubPolicy.SuppressSpecifiers = false; std::string Proto = D->getNameInfo().getAsString(); + if (const TemplateArgumentList *TArgs = D->getTemplateSpecializationArgs()) { + llvm::raw_string_ostream POut(Proto); + DeclPrinter TArgPrinter(POut, SubPolicy, Indentation); + TArgPrinter.printTemplateArguments(*TArgs); + } QualType Ty = D->getType(); while (const ParenType *PT = dyn_cast(Ty)) { @@ -635,25 +670,29 @@ Out << " = delete"; else if (D->isExplicitlyDefaulted()) Out << " = default"; - else if (D->doesThisDeclarationHaveABody() && !Policy.TerseOutput) { - if (!D->hasPrototype() && D->getNumParams()) { - // This is a K&R function definition, so we need to print the - // parameters. - Out << '\n'; - DeclPrinter ParamPrinter(Out, SubPolicy, Indentation); - Indentation += Policy.Indentation; - for (unsigned i = 0, e = D->getNumParams(); i != e; ++i) { - Indent(); - ParamPrinter.VisitParmVarDecl(D->getParamDecl(i)); - Out << ";\n"; - } - Indentation -= Policy.Indentation; - } else - Out << ' '; + else if (D->doesThisDeclarationHaveABody()) { + if (!Policy.TerseOutput) { + if (!D->hasPrototype() && D->getNumParams()) { + // This is a K&R function definition, so we need to print the + // parameters. + Out << '\n'; + DeclPrinter ParamPrinter(Out, SubPolicy, Indentation); + Indentation += Policy.Indentation; + for (unsigned i = 0, e = D->getNumParams(); i != e; ++i) { + Indent(); + ParamPrinter.VisitParmVarDecl(D->getParamDecl(i)); + Out << ";\n"; + } + Indentation -= Policy.Indentation; + } else + Out << ' '; - if (D->getBody()) - D->getBody()->printPretty(Out, nullptr, SubPolicy, Indentation); - Out << '\n'; + if (D->getBody()) + D->getBody()->printPretty(Out, nullptr, SubPolicy, Indentation); + } else { + if (isa(*D)) + Out << " {}"; + } } } @@ -661,7 +700,7 @@ if (TypeSourceInfo *TSI = D->getFriendType()) { unsigned NumTPLists = D->getFriendTypeNumTemplateParameterLists(); for (unsigned i = 0; i < NumTPLists; ++i) - PrintTemplateParameters(D->getFriendTypeTemplateParameterList(i)); + printTemplateParameters(D->getFriendTypeTemplateParameterList(i)); Out << "friend "; Out << " " << TSI->getType().getAsString(Policy); } @@ -838,9 +877,15 @@ prettyPrintAttributes(D); - if (D->getIdentifier()) + if (D->getIdentifier()) { Out << ' ' << *D; + if (auto S = dyn_cast(D)) + printTemplateArguments(S->getTemplateArgs(), S->getTemplateParameters()); + else if (auto S = dyn_cast(D)) + printTemplateArguments(S->getTemplateArgs()); + } + if (D->isCompleteDefinition()) { // Print the base classes if (D->getNumBases()) { @@ -867,9 +912,13 @@ // Print the class definition // FIXME: Doesn't print access specifiers, e.g., "public:" - Out << " {\n"; - VisitDeclContext(D); - Indent() << "}"; + if (Policy.TerseOutput) { + Out << " {}"; + } else { + Out << " {\n"; + VisitDeclContext(D); + Indent() << "}"; + } } } @@ -892,10 +941,8 @@ Visit(*D->decls_begin()); } -void DeclPrinter::PrintTemplateParameters(const TemplateParameterList *Params, - const TemplateArgumentList *Args) { +void DeclPrinter::printTemplateParameters(const TemplateParameterList *Params) { assert(Params); - assert(!Args || Params->size() == Args->size()); Out << "template <"; @@ -904,8 +951,7 @@ Out << ", "; const Decl *Param = Params->getParam(i); - if (const TemplateTypeParmDecl *TTP = - dyn_cast(Param)) { + if (auto TTP = dyn_cast(Param)) { if (TTP->wasDeclaredWithTypename()) Out << "typename "; @@ -917,30 +963,22 @@ Out << *TTP; - if (Args) { - Out << " = "; - Args->get(i).print(Policy, Out); - } else if (TTP->hasDefaultArgument()) { + if (TTP->hasDefaultArgument()) { Out << " = "; Out << TTP->getDefaultArgument().getAsString(Policy); }; - } else if (const NonTypeTemplateParmDecl *NTTP = - dyn_cast(Param)) { + } else if (auto NTTP = dyn_cast(Param)) { StringRef Name; if (IdentifierInfo *II = NTTP->getIdentifier()) Name = II->getName(); printDeclType(NTTP->getType(), Name, NTTP->isParameterPack()); - if (Args) { - Out << " = "; - Args->get(i).print(Policy, Out); - } else if (NTTP->hasDefaultArgument()) { + if (NTTP->hasDefaultArgument()) { Out << " = "; NTTP->getDefaultArgument()->printPretty(Out, nullptr, Policy, Indentation); } - } else if (const TemplateTemplateParmDecl *TTPD = - dyn_cast(Param)) { + } else if (auto TTPD = dyn_cast(Param)) { VisitTemplateDecl(TTPD); // FIXME: print the default argument, if present. } @@ -949,8 +987,46 @@ Out << "> "; } +void DeclPrinter::printTemplateArguments(const TemplateArgumentList &Args, + const TemplateParameterList *Params) { + Out << "<"; + for (size_t I = 0, E = Args.size(); I < E; ++I) { + const TemplateArgument &A = Args[I]; + if (I) + Out << ", "; + if (Params) { + if (A.getKind() == TemplateArgument::Type) + if (auto T = A.getAsType()->getAs()) { + auto P = cast(Params->getParam(T->getIndex())); + Out << *P; + continue; + } + if (A.getKind() == TemplateArgument::Template) { + if (auto T = A.getAsTemplate().getAsTemplateDecl()) + if (auto TD = dyn_cast(T)) { + auto P = cast( + Params->getParam(TD->getIndex())); + Out << *P; + continue; + } + } + if (A.getKind() == TemplateArgument::Expression) { + if (auto E = dyn_cast(A.getAsExpr())) + if (auto N = dyn_cast(E->getDecl())) { + auto P = cast( + Params->getParam(N->getIndex())); + Out << *P; + continue; + } + } + } + A.print(Policy, Out); + } + Out << ">"; +} + void DeclPrinter::VisitTemplateDecl(const TemplateDecl *D) { - PrintTemplateParameters(D->getTemplateParameters()); + printTemplateParameters(D->getTemplateParameters()); if (const TemplateTemplateParmDecl *TTP = dyn_cast(D)) { @@ -964,30 +1040,49 @@ } void DeclPrinter::VisitFunctionTemplateDecl(FunctionTemplateDecl *D) { + prettyPrintPragmas(D->getTemplatedDecl()); + VisitRedeclarableTemplateDecl(D); + if (PrintInstantiation) { - TemplateParameterList *Params = D->getTemplateParameters(); - for (auto *I : D->specializations()) { - prettyPrintPragmas(I); - PrintTemplateParameters(Params, I->getTemplateSpecializationArgs()); - Visit(I); - } + FunctionDecl *PrevDecl = D->getTemplatedDecl(); + const FunctionDecl *Def; + if (PrevDecl->isDefined(Def) && Def != PrevDecl) + return; + for (auto *I : D->specializations()) + if (I->getTemplateSpecializationKind() == TSK_ImplicitInstantiation) { + if (!PrevDecl->isThisDeclarationADefinition()) + Out << ";\n"; + Indent(); + prettyPrintPragmas(I); + Visit(I); + } } - - prettyPrintPragmas(D->getTemplatedDecl()); - return VisitRedeclarableTemplateDecl(D); } void DeclPrinter::VisitClassTemplateDecl(ClassTemplateDecl *D) { + VisitRedeclarableTemplateDecl(D); + if (PrintInstantiation) { - TemplateParameterList *Params = D->getTemplateParameters(); - for (auto *I : D->specializations()) { - PrintTemplateParameters(Params, &I->getTemplateArgs()); - Visit(I); - Out << ";\n"; - } + for (auto *I : D->specializations()) + if (I->getSpecializationKind() == TSK_ImplicitInstantiation) { + if (D->isThisDeclarationADefinition()) + Out << ";"; + Out << "\n"; + Visit(I); + } } +} + +void DeclPrinter::VisitClassTemplateSpecializationDecl( + ClassTemplateSpecializationDecl *D) { + Out << "template<> "; + VisitCXXRecordDecl(D); +} - return VisitRedeclarableTemplateDecl(D); +void DeclPrinter::VisitClassTemplatePartialSpecializationDecl( + ClassTemplatePartialSpecializationDecl *D) { + printTemplateParameters(D->getTemplateParameters()); + VisitCXXRecordDecl(D); } //---------------------------------------------------------------------------- Index: test/Analysis/cfg.cpp =================================================================== --- test/Analysis/cfg.cpp +++ test/Analysis/cfg.cpp @@ -432,7 +432,7 @@ } -// CHECK-LABEL: int *PR18472() +// CHECK-LABEL: template<> int *PR18472() // CHECK: [B2 (ENTRY)] // CHECK-NEXT: Succs (1): B1 // CHECK: [B1] Index: test/Coverage/ast-print-func.cpp =================================================================== --- /dev/null +++ test/Coverage/ast-print-func.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -ast-print -std=c++14 %s -o %t.1.cpp +// RUN: %clang_cc1 -ast-print -std=c++14 %t.1.cpp -o %t.2.cpp +// RUN: diff %t.1.cpp %t.2.cpp + +auto func_01(int, char) -> double; + +auto func_02(int x) -> int { return 2 + x; } + +void func_03() { + extern void g(), h(); + return; +} Index: test/Coverage/ast-print-temp-class.cpp =================================================================== --- /dev/null +++ test/Coverage/ast-print-temp-class.cpp @@ -0,0 +1,64 @@ +// RUN: %clang_cc1 -ast-print -std=c++14 %s -v -o %t.1.cpp +// RUN: %clang_cc1 -ast-print -std=c++14 %t.1.cpp -o %t.2.cpp +// RUN: diff %t.1.cpp %t.2.cpp + +// Specializations + +template class C0 {}; +template<> class C0 {}; +template<> class C0 {}; +C0 c0; + +template class C1 {}; +template<> class C1<11> {}; +C1<2> c1a; +C1<4> c1b; + +template class C2a {}; +template class C2b {}; +template class TC> class C2 {}; +template<> class C2 {}; +C2 c2; + + +// Default arguments + +template class C10 {}; +template class C11 {}; +template class C12a {}; +//FIXME: template class TC = C12a> class C12 {}; +//FIXME: template class TC = C12a> class C13 {}; + + +// Partial specializations + +template struct C20 { + T a; + U b; +}; +template struct C20 { + T a; +}; + +template struct C21 { + U a; + U b[N]; +}; +template struct C21 { + int a[N]; +}; + +template class TC, typename U> struct C22 { + TC a; + U b; +}; +template class TC> struct C22 { + TC a; +}; + + +// Declaration only +template class C30; +template<> class C30; +template<> class C30; +extern C30 c30; Index: test/Coverage/ast-print-temp-func.cpp =================================================================== --- /dev/null +++ test/Coverage/ast-print-temp-func.cpp @@ -0,0 +1,25 @@ +// RUN: %clang_cc1 -ast-print -std=c++14 %s -o %t.1.cpp +// RUN: %clang_cc1 -ast-print -std=c++14 %t.1.cpp -o %t.2.cpp +// RUN: diff %t.1.cpp %t.2.cpp + +template void func_01(); +template void func_01() {} +template<> void func_01() {} +template<> void func_01() {} +template void func_01(); + +void main_01() { + func_01(); + func_01(); +} + +template void func_02(); +template void func_02(); +template<> void func_02(); +template<> void func_02(); +template void func_02(); + +void main_02() { + func_02(); + func_02(); +} Index: test/Coverage/ast-printing.cpp =================================================================== --- test/Coverage/ast-printing.cpp +++ test/Coverage/ast-printing.cpp @@ -1,5 +1,7 @@ // RUN: %clang_cc1 -fsyntax-only %s -// RUN: %clang_cc1 -ast-print %s +// RUN: %clang_cc1 -ast-print %s -o %t.1.cpp +// RUN: %clang_cc1 -ast-print %t.1.cpp -o %t.2.cpp +// RUN: diff %t.1.cpp %t.2.cpp // RUN: %clang_cc1 -ast-dump %s // RUN: %clang_cc1 -print-decl-contexts %s // RUN: %clang_cc1 -fdump-record-layouts %s Index: test/Index/comment-cplus-decls.cpp =================================================================== --- test/Index/comment-cplus-decls.cpp +++ test/Index/comment-cplus-decls.cpp @@ -40,7 +40,7 @@ data* reserved; }; // CHECK: class Test {} -// CHECK: Test() : reserved(new Test::data()) +// CHECK: Test() : reserved(new Test::data()) {} // CHECK: unsigned int getID() const // CHECK: ~Test() // CHECK: Test::data *reserved Index: test/Index/comment-to-html-xml-conversion.cpp =================================================================== --- test/Index/comment-to-html-xml-conversion.cpp +++ test/Index/comment-to-html-xml-conversion.cpp @@ -813,7 +813,7 @@ template<> void comment_to_xml_conversion_10(int aaa, int bbb); -// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_xml_conversion_10:{{.*}} FullCommentAsXML=[comment_to_xml_conversion_10c:@F@comment_to_xml_conversion_10<#I#I>#I#I#void comment_to_xml_conversion_10(int aaa, int bbb) Aaa.] +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:6: FunctionDecl=comment_to_xml_conversion_10:{{.*}} FullCommentAsXML=[comment_to_xml_conversion_10c:@F@comment_to_xml_conversion_10<#I#I>#I#I#template <> void comment_to_xml_conversion_10<int, int>(int aaa, int bbb) Aaa.] /// Aaa. template @@ -825,13 +825,13 @@ template class comment_to_xml_conversion_11 { }; -// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:7: ClassTemplatePartialSpecialization=comment_to_xml_conversion_11:{{.*}} FullCommentAsXML=[comment_to_xml_conversion_11c:@SP>1#T@comment_to_xml_conversion_11>#t0.0#Iclass comment_to_xml_conversion_11 {} Aaa.] +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:7: ClassTemplatePartialSpecialization=comment_to_xml_conversion_11:{{.*}} FullCommentAsXML=[comment_to_xml_conversion_11c:@SP>1#T@comment_to_xml_conversion_11>#t0.0#Itemplate <typename T> class comment_to_xml_conversion_11<T, int> {} Aaa.] /// Aaa. template<> class comment_to_xml_conversion_11 { }; -// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:7: ClassDecl=comment_to_xml_conversion_11:{{.*}} FullCommentAsXML=[comment_to_xml_conversion_11c:@S@comment_to_xml_conversion_11>#I#Iclass comment_to_xml_conversion_11 {} Aaa.] +// CHECK: comment-to-html-xml-conversion.cpp:[[@LINE-2]]:7: ClassDecl=comment_to_xml_conversion_11:{{.*}} FullCommentAsXML=[comment_to_xml_conversion_11c:@S@comment_to_xml_conversion_11>#I#Itemplate <> class comment_to_xml_conversion_11<int, int> {} Aaa.] /// Aaa. int comment_to_xml_conversion_12; Index: test/Misc/ast-dump-templates.cpp =================================================================== --- test/Misc/ast-dump-templates.cpp +++ test/Misc/ast-dump-templates.cpp @@ -21,24 +21,24 @@ double z = foo<2, double, 3>().getSum(); } -// Template instantiation - foo -// Since the order of instantiation may vary during runs, run FileCheck twice -// to make sure each instantiation is in the correct spot. -// CHECK1: template struct foo { -// CHECK2: template struct foo { - // Template definition - foo // CHECK1: template struct foo { // CHECK2: template struct foo { -// Template instantiation - bar -// CHECK1: template int bar() -// CHECK2: template int bar() +// Template instantiation - foo +// Since the order of instantiation may vary during runs, run FileCheck twice +// to make sure each instantiation is in the correct spot. +// CHECK1: template<> struct foo<5, int, 5> { +// CHECK2: template<> struct foo<2, double, 3> { // Template definition - bar // CHECK1: template B bar() // CHECK2: template B bar() +// Template instantiation - bar +// CHECK1: template<> int bar<5, int>() +// CHECK2: template<> int bar<5, int>() + // CHECK1-LABEL: template struct A { // CHECK1-NEXT: template struct B { template struct A { Index: test/OpenMP/atomic_ast_print.cpp =================================================================== --- test/OpenMP/atomic_ast_print.cpp +++ test/OpenMP/atomic_ast_print.cpp @@ -43,7 +43,7 @@ return T(); } -// CHECK: int a = int(); +// CHECK: T a = T(); // CHECK-NEXT: #pragma omp atomic // CHECK-NEXT: a++; // CHECK-NEXT: #pragma omp atomic read @@ -74,7 +74,7 @@ // CHECK-NEXT: a = b; // CHECK-NEXT: b++; // CHECK-NEXT: } -// CHECK: T a = T(); +// CHECK: int a = int(); // CHECK-NEXT: #pragma omp atomic // CHECK-NEXT: a++; // CHECK-NEXT: #pragma omp atomic read Index: test/OpenMP/barrier_ast_print.cpp =================================================================== --- test/OpenMP/barrier_ast_print.cpp +++ test/OpenMP/barrier_ast_print.cpp @@ -23,12 +23,12 @@ } return a + argc; } +// CHECK: static T a; +// CHECK-NEXT: #pragma omp barrier // CHECK: static int a; // CHECK-NEXT: #pragma omp barrier // CHECK: static char a; // CHECK-NEXT: #pragma omp barrier -// CHECK: static T a; -// CHECK-NEXT: #pragma omp barrier // CHECK-NEXT: switch (argc) { // CHECK-NEXT: case 0: // CHECK-NEXT: #pragma omp barrier Index: test/OpenMP/critical_ast_print.cpp =================================================================== --- test/OpenMP/critical_ast_print.cpp +++ test/OpenMP/critical_ast_print.cpp @@ -9,6 +9,14 @@ void foo() {} // CHECK: template int tmain(T argc, char **argv) +// CHECK: static int a; +// CHECK-NEXT: #pragma omp critical +// CHECK-NEXT: a = 2; +// CHECK-NEXT: ++a; +// CHECK-NEXT: #pragma omp critical (the_name) hint(N) +// CHECK-NEXT: foo(); +// CHECK-NEXT: return N; +// CHECK: template<> int tmain(int argc, char **argv) template int tmain (T argc, char **argv) { T b = argc, c, d, e, f, g; @@ -22,9 +30,9 @@ ++a; #pragma omp critical (the_name) hint(N) foo(); -// CHECK-NEXT: #pragma omp critical (the_name) hint(N) +// CHECK-NEXT: #pragma omp critical (the_name) hint(4) // CHECK-NEXT: foo(); -// CHECK-NEXT: return N; +// CHECK-NEXT: return 4; return N; } Index: test/OpenMP/declare_reduction_ast_print.cpp =================================================================== --- test/OpenMP/declare_reduction_ast_print.cpp +++ test/OpenMP/declare_reduction_ast_print.cpp @@ -10,13 +10,12 @@ // CHECK: #pragma omp declare reduction (+ : int : omp_out *= omp_in) // CHECK-NEXT: #pragma omp declare reduction (+ : char : omp_out *= omp_in) -// CHECK: #pragma omp declare reduction (fun : int : omp_out += omp_in) initializer(omp_priv = omp_orig + 15) - template class SSS { public: #pragma omp declare reduction(fun : T : omp_out += omp_in) initializer(omp_priv = omp_orig + 15) // CHECK: #pragma omp declare reduction (fun : T : omp_out += omp_in) initializer(omp_priv = omp_orig + 15) + // CHECK: #pragma omp declare reduction (fun : int : omp_out += omp_in) initializer(omp_priv = omp_orig + 15) }; SSS d; @@ -26,18 +25,18 @@ #pragma omp declare reduction(fun : SSS < int > : omp_out = omp_in) initializer(init(omp_priv, omp_orig)) // CHECK: #pragma omp declare reduction (fun : SSS : omp_out = omp_in) initializer(init(omp_priv, omp_orig)) -// CHECK: template int foo(int a) { -// CHECK: #pragma omp declare reduction (fun : int : omp_out += omp_in) initializer(omp_priv = omp_orig + 15); +// CHECK: template T foo(T a) { +// CHECK: #pragma omp declare reduction (fun : T : omp_out += omp_in) initializer(omp_priv = omp_orig + 15); // CHECK: { -// CHECK: #pragma omp declare reduction (fun : int : omp_out += omp_in) initializer(omp_priv = omp_orig + 15); +// CHECK: #pragma omp declare reduction (fun : T : omp_out += omp_in) initializer(omp_priv = omp_orig + 15); // CHECK: } // CHECK: return a; // CHECK: } -// CHECK: template T foo(T a) { -// CHECK: #pragma omp declare reduction (fun : T : omp_out += omp_in) initializer(omp_priv = omp_orig + 15); +// CHECK: template<> int foo(int a) { +// CHECK: #pragma omp declare reduction (fun : int : omp_out += omp_in) initializer(omp_priv = omp_orig + 15); // CHECK: { -// CHECK: #pragma omp declare reduction (fun : T : omp_out += omp_in) initializer(omp_priv = omp_orig + 15); +// CHECK: #pragma omp declare reduction (fun : int : omp_out += omp_in) initializer(omp_priv = omp_orig + 15); // CHECK: } // CHECK: return a; // CHECK: } Index: test/OpenMP/declare_simd_ast_print.cpp =================================================================== --- test/OpenMP/declare_simd_ast_print.cpp +++ test/OpenMP/declare_simd_ast_print.cpp @@ -22,18 +22,16 @@ } // CHECK: #pragma omp declare simd aligned(hp) aligned(hp2) -// CHECK-NEXT: template void h(int *hp, int *hp2, int *hq, int *lin) { -// CHECK-NEXT: h((float *)hp, (float *)hp2, (float *)hq, (float *)lin); +// CHECK-NEXT: template void h(C *hp, C *hp2, C *hq, C *lin) { // CHECK-NEXT: } -// CHECK: #pragma omp declare simd aligned(hp) aligned(hp2) -// CHECK-NEXT: template void h(float *hp, float *hp2, float *hq, float *lin) { +// CHECK: #pragma omp declare simd aligned(hp) aligned(hp2) +// CHECK-NEXT: template<> void h(float *hp, float *hp2, float *hq, float *lin) { // CHECK-NEXT: } -// CHECK: #pragma omp declare simd aligned(hp) aligned(hp2) -// CHECK: template void h(C *hp, C *hp2, C *hq, C *lin) { +// CHECK-NEXT: template<> void h(int *hp, int *hp2, int *hq, int *lin) { +// CHECK-NEXT: h((float *)hp, (float *)hp2, (float *)hq, (float *)lin); // CHECK-NEXT: } -// // Explicit specialization with . // Pragmas need to be same, otherwise standard says that's undefined behavior. @@ -75,11 +73,11 @@ int x[10]; }; -// CHECK: template class TVV { -// CHECK: #pragma omp declare simd -// CHECK-NEXT: int tadd(int a, int b); -// CHECK: #pragma omp declare simd aligned(a: 16 * 2) aligned(b) linear(ref(b): 16) -// CHECK-NEXT: float taddpf(float *a, float *&b) { +// CHECK: template class TVV { +// CHECK: #pragma omp declare simd simdlen(X) +// CHECK-NEXT: int tadd(int a, int b) { +// CHECK: #pragma omp declare simd aligned(a: X * 2) aligned(b) linear(ref(b): X) +// CHECK-NEXT: float taddpf(float *a, T *&b) { // CHECK-NEXT: return *a + *b; // CHECK-NEXT: } // CHECK: #pragma omp declare simd @@ -91,20 +89,18 @@ template class TVV { public: -// CHECK: template class TVV { +// CHECK: template<> class TVV<16, float> { #pragma omp declare simd simdlen(X) int tadd(int a, int b) { return a + b; } -// CHECK: #pragma omp declare simd simdlen(X) -// CHECK-NEXT: int tadd(int a, int b) { -// CHECK-NEXT: return a + b; -// CHECK-NEXT: } +// CHECK: #pragma omp declare simd simdlen(16) +// CHECK-NEXT: int tadd(int a, int b); #pragma omp declare simd aligned(a : X * 2) aligned(b) linear(ref(b): X) float taddpf(float *a, T *&b) { return *a + *b; } -// CHECK: #pragma omp declare simd aligned(a: X * 2) aligned(b) -// CHECK-NEXT: float taddpf(float *a, T *&b) { +// CHECK: #pragma omp declare simd aligned(a: 16 * 2) aligned(b) linear(ref(b): 16) +// CHECK-NEXT: float taddpf(float *a, float *&b) { // CHECK-NEXT: return *a + *b; // CHECK-NEXT: } @@ -123,10 +119,10 @@ }; // CHECK: }; -// CHECK: #pragma omp declare simd simdlen(64) aligned(b: 64 * 2) linear(uval(c): 64) -// CHECK: template void foo(int (&b)[64], float *&c) // CHECK: #pragma omp declare simd simdlen(N) aligned(b: N * 2) linear(uval(c): N) // CHECK: template void foo(int (&b)[N], float *&c) +// CHECK: #pragma omp declare simd simdlen(64) aligned(b: 64 * 2) linear(uval(c): 64) +// CHECK: template<> void foo<64>(int (&b)[64], float *&c) #pragma omp declare simd simdlen(N) aligned(b : N * 2) linear(uval(c): N) template void foo(int (&b)[N], float *&c); Index: test/OpenMP/declare_target_ast_print.cpp =================================================================== --- test/OpenMP/declare_target_ast_print.cpp +++ test/OpenMP/declare_target_ast_print.cpp @@ -34,7 +34,12 @@ #pragma omp declare target template struct C { -// CHECK: template struct C +// CHECK: template struct C { +// CHECK: #pragma omp declare target +// CHECK-NEXT: static T ts; +// CHECK-NEXT: #pragma omp end declare target + +// CHECK: template<> struct C T t; // CHECK-NEXT: int t; static T ts; @@ -59,11 +64,6 @@ // CHECK: #pragma omp end declare target }; -// CHECK: template struct C { -// CHECK: #pragma omp declare target -// CHECK-NEXT: static T ts; -// CHECK-NEXT: #pragma omp end declare target - template T C::ts = 1; // CHECK: #pragma omp declare target Index: test/OpenMP/distribute_ast_print.cpp =================================================================== --- test/OpenMP/distribute_ast_print.cpp +++ test/OpenMP/distribute_ast_print.cpp @@ -41,13 +41,13 @@ // CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams -// CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) private(this->S::a) -// CHECK: #pragma omp target -// CHECK-NEXT: #pragma omp teams // CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams // CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) +// CHECK: #pragma omp target +// CHECK-NEXT: #pragma omp teams +// CHECK-NEXT: #pragma omp distribute private(this->a) private(this->a) private(this->S::a) class S8 : public S7 { S8() {} Index: test/OpenMP/distribute_dist_schedule_ast_print.cpp =================================================================== --- test/OpenMP/distribute_dist_schedule_ast_print.cpp +++ test/OpenMP/distribute_dist_schedule_ast_print.cpp @@ -57,6 +57,7 @@ } int main (int argc, char **argv) { +// CHECK: int main(int argc, char **argv) { int b = argc, c, d, e, f, g; static int a; // CHECK: static int a; Index: test/OpenMP/distribute_parallel_for_ast_print.cpp =================================================================== --- test/OpenMP/distribute_parallel_for_ast_print.cpp +++ test/OpenMP/distribute_parallel_for_ast_print.cpp @@ -37,9 +37,9 @@ } }; -// CHECK: #pragma omp distribute parallel for private(this->a) private(this->a) private(this->S::a) // CHECK: #pragma omp distribute parallel for private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp distribute parallel for private(this->a) private(this->a) +// CHECK: #pragma omp distribute parallel for private(this->a) private(this->a) private(this->S::a) class S8 : public S7 { S8() {} Index: test/OpenMP/distribute_parallel_for_simd_ast_print.cpp =================================================================== --- test/OpenMP/distribute_parallel_for_simd_ast_print.cpp +++ test/OpenMP/distribute_parallel_for_simd_ast_print.cpp @@ -37,9 +37,9 @@ } }; -// CHECK: #pragma omp distribute parallel for simd private(this->a) private(this->a) private(this->S::a) // CHECK: #pragma omp distribute parallel for simd private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp distribute parallel for simd private(this->a) private(this->a) +// CHECK: #pragma omp distribute parallel for simd private(this->a) private(this->a) private(this->S::a) class S8 : public S7 { S8() {} Index: test/OpenMP/distribute_simd_ast_print.cpp =================================================================== --- test/OpenMP/distribute_simd_ast_print.cpp +++ test/OpenMP/distribute_simd_ast_print.cpp @@ -37,9 +37,9 @@ } }; -// CHECK: #pragma omp distribute simd private(this->a) private(this->a) private(this->S::a) // CHECK: #pragma omp distribute simd private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp distribute simd private(this->a) private(this->a) +// CHECK: #pragma omp distribute simd private(this->a) private(this->a) private(this->S::a) class S8 : public S7 { S8() {} Index: test/OpenMP/flush_ast_print.cpp =================================================================== --- test/OpenMP/flush_ast_print.cpp +++ test/OpenMP/flush_ast_print.cpp @@ -15,13 +15,13 @@ #pragma omp flush(a) return a + argc; } -// CHECK: static int a; +// CHECK: static T a; // CHECK-NEXT: #pragma omp flush // CHECK-NEXT: #pragma omp flush (a) -// CHECK: static char a; +// CHECK: static int a; // CHECK-NEXT: #pragma omp flush // CHECK-NEXT: #pragma omp flush (a) -// CHECK: static T a; +// CHECK: static char a; // CHECK-NEXT: #pragma omp flush // CHECK-NEXT: #pragma omp flush (a) Index: test/OpenMP/for_ast_print.cpp =================================================================== --- test/OpenMP/for_ast_print.cpp +++ test/OpenMP/for_ast_print.cpp @@ -50,15 +50,15 @@ } }; -// CHECK: #pragma omp for private(this->a) private(this->a) private(this->S::a) -// CHECK: #pragma omp for lastprivate(this->a) lastprivate(this->a) lastprivate(this->S::a) -// CHECK: #pragma omp for linear(val(this->c)) // CHECK: #pragma omp for private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp for lastprivate(this->a) lastprivate(this->a) lastprivate(T::a) // CHECK: #pragma omp for linear(val(this->c)) // CHECK: #pragma omp for private(this->a) private(this->a) // CHECK: #pragma omp for lastprivate(this->a) lastprivate(this->a) // CHECK: #pragma omp for linear(uval(this->b)) +// CHECK: #pragma omp for private(this->a) private(this->a) private(this->S::a) +// CHECK: #pragma omp for lastprivate(this->a) lastprivate(this->a) lastprivate(this->S::a) +// CHECK: #pragma omp for linear(val(this->c)) class S8 : public S7 { S8() {} @@ -137,6 +137,7 @@ } int main(int argc, char **argv) { +// CHECK: int main(int argc, char **argv) { int b = argc, c, d, e, f, g; static int a; // CHECK: static int a; Index: test/OpenMP/for_simd_ast_print.cpp =================================================================== --- test/OpenMP/for_simd_ast_print.cpp +++ test/OpenMP/for_simd_ast_print.cpp @@ -33,9 +33,9 @@ } }; -// CHECK: #pragma omp for simd private(this->a) private(this->a) private(this->S1::a) // CHECK: #pragma omp for simd private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp for simd private(this->a) private(this->a) +// CHECK: #pragma omp for simd private(this->a) private(this->a) private(this->S1::a) class S8 : public S7 { S8() {} @@ -125,7 +125,7 @@ }; // S2<4>::func is called below in main. -// CHECK: template struct S2 { +// CHECK: template<> struct S2<4> { // CHECK-NEXT: static void func(int n, float *a, float *b, float *c) { // CHECK-NEXT: int k1 = 0, k2 = 0; // CHECK-NEXT: #pragma omp for simd safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4) Index: test/OpenMP/ordered_ast_print.cpp =================================================================== --- test/OpenMP/ordered_ast_print.cpp +++ test/OpenMP/ordered_ast_print.cpp @@ -51,7 +51,7 @@ return (0); } -// CHECK: static int a; +// CHECK: static T a; // CHECK-NEXT: #pragma omp for ordered // CHECK-NEXT: for (int i = 0; i < argc; ++i) // CHECK-NEXT: #pragma omp ordered @@ -85,10 +85,10 @@ // CHECK-NEXT: #pragma omp parallel for ordered(1) // CHECK-NEXT: for (int i = 0; i < argc; ++i) { // CHECK-NEXT: #pragma omp ordered depend(source) -// CHECK-NEXT: #pragma omp ordered depend(sink : i + 3) +// CHECK-NEXT: #pragma omp ordered depend(sink : i + N) // CHECK-NEXT: a = 2; // CHECK-NEXT: } -// CHECK: static T a; +// CHECK: static int a; // CHECK-NEXT: #pragma omp for ordered // CHECK-NEXT: for (int i = 0; i < argc; ++i) // CHECK-NEXT: #pragma omp ordered @@ -122,7 +122,7 @@ // CHECK-NEXT: #pragma omp parallel for ordered(1) // CHECK-NEXT: for (int i = 0; i < argc; ++i) { // CHECK-NEXT: #pragma omp ordered depend(source) -// CHECK-NEXT: #pragma omp ordered depend(sink : i + N) +// CHECK-NEXT: #pragma omp ordered depend(sink : i + 3) // CHECK-NEXT: a = 2; // CHECK-NEXT: } Index: test/OpenMP/parallel_ast_print.cpp =================================================================== --- test/OpenMP/parallel_ast_print.cpp +++ test/OpenMP/parallel_ast_print.cpp @@ -58,10 +58,6 @@ } }; -// CHECK: #pragma omp parallel private(this->a) private(this->a) private(this->S1::a) -// CHECK: #pragma omp parallel firstprivate(this->a) firstprivate(this->a) firstprivate(this->S1::a) -// CHECK: #pragma omp parallel shared(this->a) shared(this->a) shared(this->S1::a) -// CHECK: #pragma omp parallel reduction(+: this->a) reduction(*: this->b[:]) // CHECK: #pragma omp parallel private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp parallel firstprivate(this->a) firstprivate(this->a) firstprivate(T::a) // CHECK: #pragma omp parallel shared(this->a) shared(this->a) shared(T::a) @@ -70,6 +66,10 @@ // CHECK: #pragma omp parallel firstprivate(this->a) firstprivate(this->a) // CHECK: #pragma omp parallel shared(this->a) shared(this->a) // CHECK: #pragma omp parallel reduction(&&: this->a) reduction(^: this->b[s.a.a]) +// CHECK: #pragma omp parallel private(this->a) private(this->a) private(this->S1::a) +// CHECK: #pragma omp parallel firstprivate(this->a) firstprivate(this->a) firstprivate(this->S1::a) +// CHECK: #pragma omp parallel shared(this->a) shared(this->a) shared(this->S1::a) +// CHECK: #pragma omp parallel reduction(+: this->a) reduction(*: this->b[:]) class S8 : public S7 { S8() {} @@ -122,18 +122,18 @@ #pragma omp threadprivate(TS) }; -// CHECK: template struct S { +// CHECK: template struct S { +// CHECK: static T TS; +// CHECK-NEXT: #pragma omp threadprivate(S::TS) +// CHECK: }; +// CHECK: template<> struct S { // CHECK: static int TS; // CHECK-NEXT: #pragma omp threadprivate(S::TS) // CHECK-NEXT: } -// CHECK: template struct S { +// CHECK: template<> struct S { // CHECK: static long TS; // CHECK-NEXT: #pragma omp threadprivate(S::TS) // CHECK-NEXT: } -// CHECK: template struct S { -// CHECK: static T TS; -// CHECK-NEXT: #pragma omp threadprivate(S::TS) -// CHECK: }; template T tmain(T argc, T *argv) { @@ -150,7 +150,18 @@ return 0; } -// CHECK: template int tmain(int argc, int *argv) { +// CHECK: template T tmain(T argc, T *argv) { +// CHECK-NEXT: T b = argc, c, d, e, f, g; +// CHECK-NEXT: static T a; +// CHECK-NEXT: S s; +// CHECK-NEXT: T arr[C][10], arr1[C]; +// CHECK-NEXT: #pragma omp parallel +// CHECK-NEXT: a = 2; +// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) copyin(S::TS) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10]) +// CHECK-NEXT: foo() +// CHECK-NEXT: #pragma omp parallel if(C) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:C][:argc]) reduction(&&: g) +// CHECK-NEXT: foo() +// CHECK: template<> int tmain(int argc, int *argv) { // CHECK-NEXT: int b = argc, c, d, e, f, g; // CHECK-NEXT: static int a; // CHECK-NEXT: S s; @@ -161,7 +172,7 @@ // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp parallel if(5) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:5][:argc]) reduction(&&: g) // CHECK-NEXT: foo() -// CHECK: template long tmain(long argc, long *argv) { +// CHECK: template<> long tmain(long argc, long *argv) { // CHECK-NEXT: long b = argc, c, d, e, f, g; // CHECK-NEXT: static long a; // CHECK-NEXT: S s; @@ -172,17 +183,6 @@ // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp parallel if(1) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:1][:argc]) reduction(&&: g) // CHECK-NEXT: foo() -// CHECK: template T tmain(T argc, T *argv) { -// CHECK-NEXT: T b = argc, c, d, e, f, g; -// CHECK-NEXT: static T a; -// CHECK-NEXT: S s; -// CHECK-NEXT: T arr[C][10], arr1[C]; -// CHECK-NEXT: #pragma omp parallel -// CHECK-NEXT: a = 2; -// CHECK-NEXT: #pragma omp parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) copyin(S::TS) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10]) -// CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp parallel if(C) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:C][:argc]) reduction(&&: g) -// CHECK-NEXT: foo() enum Enum { }; Index: test/OpenMP/parallel_for_ast_print.cpp =================================================================== --- test/OpenMP/parallel_for_ast_print.cpp +++ test/OpenMP/parallel_for_ast_print.cpp @@ -35,9 +35,9 @@ } }; -// CHECK: #pragma omp parallel for private(this->a) private(this->a) private(this->S::a) // CHECK: #pragma omp parallel for private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp parallel for private(this->a) private(this->a) +// CHECK: #pragma omp parallel for private(this->a) private(this->a) private(this->S::a) class S8 : public S7 { S8() {} Index: test/OpenMP/parallel_for_simd_ast_print.cpp =================================================================== --- test/OpenMP/parallel_for_simd_ast_print.cpp +++ test/OpenMP/parallel_for_simd_ast_print.cpp @@ -35,9 +35,9 @@ } }; -// CHECK: #pragma omp parallel for simd private(this->a) private(this->a) private(this->S1::a) // CHECK: #pragma omp parallel for simd private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp parallel for simd private(this->a) private(this->a) +// CHECK: #pragma omp parallel for simd private(this->a) private(this->a) private(this->S1::a) class S8 : public S7 { S8() {} @@ -126,7 +126,7 @@ }; // S2<4>::func is called below in main. -// CHECK: template struct S2 { +// CHECK: template<> struct S2<4> { // CHECK-NEXT: static void func(int n, float *a, float *b, float *c) { // CHECK-NEXT: int k1 = 0, k2 = 0; // CHECK-NEXT: #pragma omp parallel for simd safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4) Index: test/OpenMP/parallel_sections_ast_print.cpp =================================================================== --- test/OpenMP/parallel_sections_ast_print.cpp +++ test/OpenMP/parallel_sections_ast_print.cpp @@ -15,18 +15,18 @@ #pragma omp threadprivate(TS) }; -// CHECK: template struct S { +// CHECK: template struct S { +// CHECK: static T TS; +// CHECK-NEXT: #pragma omp threadprivate(S::TS) +// CHECK: }; +// CHECK: template<> struct S { // CHECK: static int TS; // CHECK-NEXT: #pragma omp threadprivate(S::TS) // CHECK-NEXT: } -// CHECK: template struct S { +// CHECK: template<> struct S { // CHECK: static long TS; // CHECK-NEXT: #pragma omp threadprivate(S::TS) // CHECK-NEXT: } -// CHECK: template struct S { -// CHECK: static T TS; -// CHECK-NEXT: #pragma omp threadprivate(S::TS) -// CHECK: }; template T tmain(T argc, T *argv) { @@ -50,55 +50,55 @@ return 0; } -// CHECK: template int tmain(int argc, int *argv) { -// CHECK-NEXT: int b = argc, c, d, e, f, g; -// CHECK-NEXT: static int a; -// CHECK-NEXT: S s; +// CHECK: template T tmain(T argc, T *argv) { +// CHECK-NEXT: T b = argc, c, d, e, f, g; +// CHECK-NEXT: static T a; +// CHECK-NEXT: S s; // CHECK-NEXT: #pragma omp parallel sections // CHECK-NEXT: { // CHECK-NEXT: a = 2; // CHECK-NEXT: } -// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) copyin(S::TS) proc_bind(master) reduction(+: c) reduction(max: e) +// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) copyin(S::TS) proc_bind(master) reduction(+: c) reduction(max: e) // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: } -// CHECK-NEXT: #pragma omp parallel sections if(5) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c) +// CHECK-NEXT: #pragma omp parallel sections if(C) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c) // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: #pragma omp section // CHECK-NEXT: foo(); // CHECK-NEXT: } -// CHECK: template long tmain(long argc, long *argv) { -// CHECK-NEXT: long b = argc, c, d, e, f, g; -// CHECK-NEXT: static long a; -// CHECK-NEXT: S s; +// CHECK: template<> int tmain(int argc, int *argv) { +// CHECK-NEXT: int b = argc, c, d, e, f, g; +// CHECK-NEXT: static int a; +// CHECK-NEXT: S s; // CHECK-NEXT: #pragma omp parallel sections // CHECK-NEXT: { // CHECK-NEXT: a = 2; // CHECK-NEXT: } -// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) copyin(S::TS) proc_bind(master) reduction(+: c) reduction(max: e) +// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) copyin(S::TS) proc_bind(master) reduction(+: c) reduction(max: e) // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: } -// CHECK-NEXT: #pragma omp parallel sections if(1) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c) +// CHECK-NEXT: #pragma omp parallel sections if(5) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c) // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: #pragma omp section // CHECK-NEXT: foo(); // CHECK-NEXT: } -// CHECK: template T tmain(T argc, T *argv) { -// CHECK-NEXT: T b = argc, c, d, e, f, g; -// CHECK-NEXT: static T a; -// CHECK-NEXT: S s; +// CHECK: template<> long tmain(long argc, long *argv) { +// CHECK-NEXT: long b = argc, c, d, e, f, g; +// CHECK-NEXT: static long a; +// CHECK-NEXT: S s; // CHECK-NEXT: #pragma omp parallel sections // CHECK-NEXT: { // CHECK-NEXT: a = 2; // CHECK-NEXT: } -// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) copyin(S::TS) proc_bind(master) reduction(+: c) reduction(max: e) +// CHECK-NEXT: #pragma omp parallel sections default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) copyin(S::TS) proc_bind(master) reduction(+: c) reduction(max: e) // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: } -// CHECK-NEXT: #pragma omp parallel sections if(C) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c) +// CHECK-NEXT: #pragma omp parallel sections if(1) num_threads(s) proc_bind(close) reduction(^: e,f) reduction(&&: g) lastprivate(b,c) // CHECK-NEXT: { // CHECK-NEXT: foo(); // CHECK-NEXT: #pragma omp section Index: test/OpenMP/sections_ast_print.cpp =================================================================== --- test/OpenMP/sections_ast_print.cpp +++ test/OpenMP/sections_ast_print.cpp @@ -27,6 +27,7 @@ } int main(int argc, char **argv) { +// CHECK: int main(int argc, char **argv) { int b = argc, c, d, e, f, g; static int a; // CHECK: static int a; Index: test/OpenMP/simd_ast_print.cpp =================================================================== --- test/OpenMP/simd_ast_print.cpp +++ test/OpenMP/simd_ast_print.cpp @@ -35,8 +35,8 @@ }; // CHECK: #pragma omp simd aligned(this->a) -// CHECK: #pragma omp simd aligned(this->a) // CHECK: #pragma omp simd aligned(this->b: 8) +// CHECK: #pragma omp simd aligned(this->a) class S8 : public S7 { S8() {} @@ -129,7 +129,7 @@ }; // S2<4>::func is called below in main. -// CHECK: template struct S2 { +// CHECK: template<> struct S2<4> { // CHECK-NEXT: static void func(int n, float *a, float *b, float *c) { // CHECK-NEXT: int k1 = 0, k2 = 0; // CHECK-NEXT: #pragma omp simd safelen(4) linear(k1,k2: 4) aligned(a: 4) simdlen(4) Index: test/OpenMP/single_ast_print.cpp =================================================================== --- test/OpenMP/single_ast_print.cpp +++ test/OpenMP/single_ast_print.cpp @@ -57,6 +57,7 @@ } int main(int argc, char **argv) { +// CHECK: int main(int argc, char **argv) { int b = argc, c, d, e, f, g; static int a; SS ss(a); Index: test/OpenMP/target_ast_print.cpp =================================================================== --- test/OpenMP/target_ast_print.cpp +++ test/OpenMP/target_ast_print.cpp @@ -34,13 +34,13 @@ return 0; } -// CHECK: template int tmain(int argc, int *argv) { -// CHECK-NEXT: int i, j, a[20] +// CHECK: template T tmain(T argc, T *argv) { +// CHECK-NEXT: T i, j, a[20] // CHECK-NEXT: #pragma omp target // CHECK-NEXT: foo(); // CHECK-NEXT: #pragma omp target if(target: argc > 0) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target if(5) +// CHECK-NEXT: #pragma omp target if(C) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target map(tofrom: i) // CHECK-NEXT: foo() @@ -56,13 +56,13 @@ // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target defaultmap(tofrom: scalar) // CHECK-NEXT: foo() -// CHECK: template char tmain(char argc, char *argv) { -// CHECK-NEXT: char i, j, a[20] +// CHECK: template<> int tmain(int argc, int *argv) { +// CHECK-NEXT: int i, j, a[20] // CHECK-NEXT: #pragma omp target // CHECK-NEXT: foo(); // CHECK-NEXT: #pragma omp target if(target: argc > 0) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target if(1) +// CHECK-NEXT: #pragma omp target if(5) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target map(tofrom: i) // CHECK-NEXT: foo() @@ -78,13 +78,13 @@ // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target defaultmap(tofrom: scalar) // CHECK-NEXT: foo() -// CHECK: template T tmain(T argc, T *argv) { -// CHECK-NEXT: T i, j, a[20] +// CHECK: template<> char tmain(char argc, char *argv) { +// CHECK-NEXT: char i, j, a[20] // CHECK-NEXT: #pragma omp target // CHECK-NEXT: foo(); // CHECK-NEXT: #pragma omp target if(target: argc > 0) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target if(C) +// CHECK-NEXT: #pragma omp target if(1) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target map(tofrom: i) // CHECK-NEXT: foo() Index: test/OpenMP/target_data_ast_print.cpp =================================================================== --- test/OpenMP/target_data_ast_print.cpp +++ test/OpenMP/target_data_ast_print.cpp @@ -46,8 +46,8 @@ return 0; } -// CHECK: template int tmain(int argc, int *argv) { -// CHECK-NEXT: int i, j, b, c, d, e, x[20]; +// CHECK: template T tmain(T argc, T *argv) { +// CHECK-NEXT: T i, j, b, c, d, e, x[20]; // CHECK-NEXT: #pragma omp target data map(to: c) // CHECK-NEXT: i = argc; // CHECK-NEXT: #pragma omp target data map(to: c) if(target data: j > 0) @@ -68,8 +68,8 @@ // CHECK-NEXT: { // CHECK-NEXT: #pragma omp target map(always,alloc: e) // CHECK-NEXT: foo(); -// CHECK: template char tmain(char argc, char *argv) { -// CHECK-NEXT: char i, j, b, c, d, e, x[20]; +// CHECK: template<> int tmain(int argc, int *argv) { +// CHECK-NEXT: int i, j, b, c, d, e, x[20]; // CHECK-NEXT: #pragma omp target data map(to: c) // CHECK-NEXT: i = argc; // CHECK-NEXT: #pragma omp target data map(to: c) if(target data: j > 0) @@ -90,8 +90,8 @@ // CHECK-NEXT: { // CHECK-NEXT: #pragma omp target map(always,alloc: e) // CHECK-NEXT: foo(); -// CHECK: template T tmain(T argc, T *argv) { -// CHECK-NEXT: T i, j, b, c, d, e, x[20]; +// CHECK: template<> char tmain(char argc, char *argv) { +// CHECK-NEXT: char i, j, b, c, d, e, x[20]; // CHECK-NEXT: #pragma omp target data map(to: c) // CHECK-NEXT: i = argc; // CHECK-NEXT: #pragma omp target data map(to: c) if(target data: j > 0) Index: test/OpenMP/target_data_use_device_ptr_ast_print.cpp =================================================================== --- test/OpenMP/target_data_use_device_ptr_ast_print.cpp +++ test/OpenMP/target_data_use_device_ptr_ast_print.cpp @@ -110,7 +110,7 @@ return 0; } -// CHECK: template int tmain(int argc) { +// CHECK: template<> int tmain(int argc) { // CHECK-NEXT: int i; // CHECK-NEXT: int &j = i; // CHECK-NEXT: int *k = &j; @@ -120,7 +120,7 @@ // CHECK-NEXT: } // CHECK-NEXT: #pragma omp target data map(tofrom: i) use_device_ptr(z) -// CHECK: template int *tmain(int *argc) { +// CHECK: template<> int *tmain(int *argc) { // CHECK-NEXT: int *i; // CHECK-NEXT: int *&j = i; // CHECK-NEXT: int **k = &j; Index: test/OpenMP/target_enter_data_ast_print.cpp =================================================================== --- test/OpenMP/target_enter_data_ast_print.cpp +++ test/OpenMP/target_enter_data_ast_print.cpp @@ -62,8 +62,8 @@ return 0; } -// CHECK: template int tmain(int argc, int *argv) { -// CHECK-NEXT: int i, j, b, c, d, e, x[20]; +// CHECK: template T tmain(T argc, T *argv) { +// CHECK-NEXT: T i, j, b, c, d, e, x[20]; // CHECK-NEXT: i = argc; // CHECK-NEXT: #pragma omp target enter data map(to: i) // CHECK-NEXT: #pragma omp target enter data map(to: i) if(target enter data: j > 0) @@ -89,8 +89,8 @@ // CHECK-NEXT: #pragma omp target enter data nowait map(alloc: x[0:10],c) depend(in : argc,argv[i:argc],x[:]) // CHECK-NEXT: #pragma omp target enter data nowait depend(in : argc,argv[i:argc],x[:]) map(to: c) map(alloc: d) // CHECK-NEXT: #pragma omp target enter data nowait map(always,alloc: e) depend(in : argc,argv[i:argc],x[:]) -// CHECK: template char tmain(char argc, char *argv) { -// CHECK-NEXT: char i, j, b, c, d, e, x[20]; +// CHECK: template<> int tmain(int argc, int *argv) { +// CHECK-NEXT: int i, j, b, c, d, e, x[20]; // CHECK-NEXT: i = argc; // CHECK-NEXT: #pragma omp target enter data map(to: i) // CHECK-NEXT: #pragma omp target enter data map(to: i) if(target enter data: j > 0) @@ -116,8 +116,8 @@ // CHECK-NEXT: #pragma omp target enter data nowait map(alloc: x[0:10],c) depend(in : argc,argv[i:argc],x[:]) // CHECK-NEXT: #pragma omp target enter data nowait depend(in : argc,argv[i:argc],x[:]) map(to: c) map(alloc: d) // CHECK-NEXT: #pragma omp target enter data nowait map(always,alloc: e) depend(in : argc,argv[i:argc],x[:]) -// CHECK: template T tmain(T argc, T *argv) { -// CHECK-NEXT: T i, j, b, c, d, e, x[20]; +// CHECK: template<> char tmain(char argc, char *argv) { +// CHECK-NEXT: char i, j, b, c, d, e, x[20]; // CHECK-NEXT: i = argc; // CHECK-NEXT: #pragma omp target enter data map(to: i) // CHECK-NEXT: #pragma omp target enter data map(to: i) if(target enter data: j > 0) Index: test/OpenMP/target_exit_data_ast_print.cpp =================================================================== --- test/OpenMP/target_exit_data_ast_print.cpp +++ test/OpenMP/target_exit_data_ast_print.cpp @@ -66,8 +66,8 @@ return 0; } -// CHECK: template int tmain(int argc, int *argv) { -// CHECK-NEXT: int i, j, b, c, d, e, x[20]; +// CHECK: template T tmain(T argc, T *argv) { +// CHECK-NEXT: T i, j, b, c, d, e, x[20]; // CHECK-NEXT: i = argc; // CHECK-NEXT: #pragma omp target exit data map(from: i) // CHECK-NEXT: #pragma omp target exit data map(from: i) if(target exit data: j > 0) @@ -95,8 +95,8 @@ // CHECK-NEXT: #pragma omp target exit data nowait map(release: x[0:10],c) depend(in : argc,argv[i:argc],x[:]) // CHECK-NEXT: #pragma omp target exit data nowait map(from: c) depend(in : argc,argv[i:argc],x[:]) map(release: d) // CHECK-NEXT: #pragma omp target exit data depend(in : argc,argv[i:argc],x[:]) nowait map(always,release: e) -// CHECK: template char tmain(char argc, char *argv) { -// CHECK-NEXT: char i, j, b, c, d, e, x[20]; +// CHECK: template<> int tmain(int argc, int *argv) { +// CHECK-NEXT: int i, j, b, c, d, e, x[20]; // CHECK-NEXT: i = argc; // CHECK-NEXT: #pragma omp target exit data map(from: i) // CHECK-NEXT: #pragma omp target exit data map(from: i) if(target exit data: j > 0) @@ -124,8 +124,8 @@ // CHECK-NEXT: #pragma omp target exit data nowait map(release: x[0:10],c) depend(in : argc,argv[i:argc],x[:]) // CHECK-NEXT: #pragma omp target exit data nowait map(from: c) depend(in : argc,argv[i:argc],x[:]) map(release: d) // CHECK-NEXT: #pragma omp target exit data depend(in : argc,argv[i:argc],x[:]) nowait map(always,release: e) -// CHECK: template T tmain(T argc, T *argv) { -// CHECK-NEXT: T i, j, b, c, d, e, x[20]; +// CHECK: template<> char tmain(char argc, char *argv) { +// CHECK-NEXT: char i, j, b, c, d, e, x[20]; // CHECK-NEXT: i = argc; // CHECK-NEXT: #pragma omp target exit data map(from: i) // CHECK-NEXT: #pragma omp target exit data map(from: i) if(target exit data: j > 0) Index: test/OpenMP/target_is_device_ptr_ast_print.cpp =================================================================== --- test/OpenMP/target_is_device_ptr_ast_print.cpp +++ test/OpenMP/target_is_device_ptr_ast_print.cpp @@ -172,7 +172,7 @@ return 0; } -// CHECK: template int tmain(int argc) { +// CHECK: template<> int tmain(int argc) { // CHECK-NEXT: const int da[5] = {0}; // CHECK-NEXT: S6 h[10]; // CHECK-NEXT: auto &rh = h; @@ -202,7 +202,7 @@ // CHECK-NEXT: } // CHECK-NEXT: #pragma omp target is_device_ptr(da) -// CHECK: template int *tmain(int *argc) { +// CHECK: template<> int *tmain(int *argc) { // CHECK-NEXT: int *const da[5] = {0}; // CHECK-NEXT: S6 h[10]; // CHECK-NEXT: auto &rh = h; Index: test/OpenMP/target_parallel_ast_print.cpp =================================================================== --- test/OpenMP/target_parallel_ast_print.cpp +++ test/OpenMP/target_parallel_ast_print.cpp @@ -15,18 +15,18 @@ #pragma omp threadprivate(TS) }; -// CHECK: template struct S { +// CHECK: template struct S { +// CHECK: static T TS; +// CHECK-NEXT: #pragma omp threadprivate(S::TS) +// CHECK: }; +// CHECK: template<> struct S { // CHECK: static int TS; // CHECK-NEXT: #pragma omp threadprivate(S::TS) // CHECK-NEXT: } -// CHECK: template struct S { +// CHECK: template<> struct S { // CHECK: static char TS; // CHECK-NEXT: #pragma omp threadprivate(S::TS) // CHECK-NEXT: } -// CHECK: template struct S { -// CHECK: static T TS; -// CHECK-NEXT: #pragma omp threadprivate(S::TS) -// CHECK: }; template T tmain(T argc, T *argv) { @@ -64,23 +64,23 @@ return 0; } -// CHECK: template int tmain(int argc, int *argv) { -// CHECK-NEXT: int b = argc, c, d, e, f, g; -// CHECK-NEXT: static int h; -// CHECK-NEXT: S s; -// CHECK-NEXT: int arr[5][10], arr1[5]; -// CHECK-NEXT: int i, j, a[20] +// CHECK: template T tmain(T argc, T *argv) { +// CHECK-NEXT: T b = argc, c, d, e, f, g; +// CHECK-NEXT: static T h; +// CHECK-NEXT: S s; +// CHECK-NEXT: T arr[C][10], arr1[C]; +// CHECK-NEXT: T i, j, a[20] // CHECK-NEXT: #pragma omp target parallel // CHECK-NEXT: h = 2; -// CHECK-NEXT: #pragma omp target parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:5][0:10]) +// CHECK-NEXT: #pragma omp target parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10]) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target parallel if(5) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:5][:argc]) reduction(&&: g) +// CHECK-NEXT: #pragma omp target parallel if(C) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:C][:argc]) reduction(&&: g) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel if(target: argc > 0) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel if(parallel: argc > 0) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target parallel if(5) +// CHECK-NEXT: #pragma omp target parallel if(C) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel map(tofrom: i) // CHECK-NEXT: foo() @@ -96,23 +96,23 @@ // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel defaultmap(tofrom: scalar) // CHECK-NEXT: foo() -// CHECK: template char tmain(char argc, char *argv) { -// CHECK-NEXT: char b = argc, c, d, e, f, g; -// CHECK-NEXT: static char h; -// CHECK-NEXT: S s; -// CHECK-NEXT: char arr[1][10], arr1[1]; -// CHECK-NEXT: char i, j, a[20] +// CHECK: template<> int tmain(int argc, int *argv) { +// CHECK-NEXT: int b = argc, c, d, e, f, g; +// CHECK-NEXT: static int h; +// CHECK-NEXT: S s; +// CHECK-NEXT: int arr[5][10], arr1[5]; +// CHECK-NEXT: int i, j, a[20] // CHECK-NEXT: #pragma omp target parallel // CHECK-NEXT: h = 2; -// CHECK-NEXT: #pragma omp target parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:1][0:10]) +// CHECK-NEXT: #pragma omp target parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(5) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:5][0:10]) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target parallel if(1) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:1][:argc]) reduction(&&: g) +// CHECK-NEXT: #pragma omp target parallel if(5) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:5][:argc]) reduction(&&: g) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel if(target: argc > 0) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel if(parallel: argc > 0) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target parallel if(1) +// CHECK-NEXT: #pragma omp target parallel if(5) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel map(tofrom: i) // CHECK-NEXT: foo() @@ -128,23 +128,23 @@ // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel defaultmap(tofrom: scalar) // CHECK-NEXT: foo() -// CHECK: template T tmain(T argc, T *argv) { -// CHECK-NEXT: T b = argc, c, d, e, f, g; -// CHECK-NEXT: static T h; -// CHECK-NEXT: S s; -// CHECK-NEXT: T arr[C][10], arr1[C]; -// CHECK-NEXT: T i, j, a[20] +// CHECK: template<> char tmain(char argc, char *argv) { +// CHECK-NEXT: char b = argc, c, d, e, f, g; +// CHECK-NEXT: static char h; +// CHECK-NEXT: S s; +// CHECK-NEXT: char arr[1][10], arr1[1]; +// CHECK-NEXT: char i, j, a[20] // CHECK-NEXT: #pragma omp target parallel // CHECK-NEXT: h = 2; -// CHECK-NEXT: #pragma omp target parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(C) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:C][0:10]) +// CHECK-NEXT: #pragma omp target parallel default(none) private(argc,b) firstprivate(argv) shared(d) if(parallel: argc > 0) num_threads(1) proc_bind(master) reduction(+: c,arr1[argc]) reduction(max: e,arr[:1][0:10]) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target parallel if(C) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:C][:argc]) reduction(&&: g) +// CHECK-NEXT: #pragma omp target parallel if(1) num_threads(s) proc_bind(close) reduction(^: e,f,arr[0:1][:argc]) reduction(&&: g) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel if(target: argc > 0) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel if(parallel: argc > 0) // CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp target parallel if(C) +// CHECK-NEXT: #pragma omp target parallel if(1) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target parallel map(tofrom: i) // CHECK-NEXT: foo() Index: test/OpenMP/target_parallel_for_ast_print.cpp =================================================================== --- test/OpenMP/target_parallel_for_ast_print.cpp +++ test/OpenMP/target_parallel_for_ast_print.cpp @@ -35,9 +35,9 @@ } }; -// CHECK: #pragma omp target parallel for private(this->a) private(this->a) private(this->S::a) // CHECK: #pragma omp target parallel for private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp target parallel for private(this->a) private(this->a) +// CHECK: #pragma omp target parallel for private(this->a) private(this->a) private(this->S::a) class S8 : public S7 { S8() {} Index: test/OpenMP/target_parallel_for_simd_ast_print.cpp =================================================================== --- test/OpenMP/target_parallel_for_simd_ast_print.cpp +++ test/OpenMP/target_parallel_for_simd_ast_print.cpp @@ -35,9 +35,9 @@ } }; -// CHECK: #pragma omp target parallel for simd private(this->a) private(this->a) private(this->S::a) // CHECK: #pragma omp target parallel for simd private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp target parallel for simd private(this->a) private(this->a) +// CHECK: #pragma omp target parallel for simd private(this->a) private(this->a) private(this->S::a) class S8 : public S7 { S8() {} Index: test/OpenMP/target_simd_ast_print.cpp =================================================================== --- test/OpenMP/target_simd_ast_print.cpp +++ test/OpenMP/target_simd_ast_print.cpp @@ -35,9 +35,9 @@ } }; -// CHECK: #pragma omp target simd private(this->a) private(this->a) private(this->S::a) // CHECK: #pragma omp target simd private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp target simd private(this->a) private(this->a) +// CHECK: #pragma omp target simd private(this->a) private(this->a) private(this->S::a) class S8 : public S7 { S8() {} Index: test/OpenMP/target_update_ast_print.cpp =================================================================== --- test/OpenMP/target_update_ast_print.cpp +++ test/OpenMP/target_update_ast_print.cpp @@ -18,18 +18,18 @@ #pragma omp target update from(b) if(l<5) device(l-1) nowait depend(inout:l) return a + targ + (T)b; } -// CHECK: static int a; -// CHECK-NEXT: float b; +// CHECK: static T a; +// CHECK-NEXT: U b; // CHECK-NEXT: int l; // CHECK-NEXT: #pragma omp target update to(a) if(l > 5) device(l) nowait depend(inout : l) // CHECK-NEXT: #pragma omp target update from(b) if(l < 5) device(l - 1) nowait depend(inout : l) -// CHECK: static char a; +// CHECK: static int a; // CHECK-NEXT: float b; // CHECK-NEXT: int l; // CHECK-NEXT: #pragma omp target update to(a) if(l > 5) device(l) nowait depend(inout : l) // CHECK-NEXT: #pragma omp target update from(b) if(l < 5) device(l - 1) nowait depend(inout : l) -// CHECK: static T a; -// CHECK-NEXT: U b; +// CHECK: static char a; +// CHECK-NEXT: float b; // CHECK-NEXT: int l; // CHECK-NEXT: #pragma omp target update to(a) if(l > 5) device(l) nowait depend(inout : l) // CHECK-NEXT: #pragma omp target update from(b) if(l < 5) device(l - 1) nowait depend(inout : l) Index: test/OpenMP/task_ast_print.cpp =================================================================== --- test/OpenMP/task_ast_print.cpp +++ test/OpenMP/task_ast_print.cpp @@ -35,9 +35,9 @@ } }; -// CHECK: #pragma omp task private(this->a) private(this->a) private(this->S1::a) // CHECK: #pragma omp task private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp task private(this->a) private(this->a) +// CHECK: #pragma omp task private(this->a) private(this->a) private(this->S1::a) class S8 : public S7 { S8() {} @@ -66,18 +66,18 @@ #pragma omp threadprivate(TS) }; -// CHECK: template struct S { +// CHECK: template struct S { +// CHECK: static T TS; +// CHECK-NEXT: #pragma omp threadprivate(S::TS) +// CHECK: }; +// CHECK: template<> struct S { // CHECK: static int TS; // CHECK-NEXT: #pragma omp threadprivate(S::TS) // CHECK-NEXT: } -// CHECK: template struct S { +// CHECK: template<> struct S { // CHECK: static long TS; // CHECK-NEXT: #pragma omp threadprivate(S::TS) // CHECK-NEXT: } -// CHECK: template struct S { -// CHECK: static T TS; -// CHECK-NEXT: #pragma omp threadprivate(S::TS) -// CHECK: }; template T tmain(T argc, T *argv) { @@ -94,7 +94,18 @@ return 0; } -// CHECK: template int tmain(int argc, int *argv) { +// CHECK: template T tmain(T argc, T *argv) { +// CHECK-NEXT: T b = argc, c, d, e, f, g; +// CHECK-NEXT: static T a; +// CHECK-NEXT: S s; +// CHECK-NEXT: T arr[argc]; +// CHECK-NEXT: #pragma omp task untied depend(in : argc,argv[b:argc],arr[:]) if(task: argc > 0) +// CHECK-NEXT: a = 2; +// CHECK-NEXT: #pragma omp task default(none) private(argc,b) firstprivate(argv) shared(d) if(argc > 0) final(S::TS > 0) priority(argc) +// CHECK-NEXT: foo() +// CHECK-NEXT: #pragma omp task if(C) mergeable priority(C) +// CHECK-NEXT: foo() +// CHECK: template<> int tmain(int argc, int *argv) { // CHECK-NEXT: int b = argc, c, d, e, f, g; // CHECK-NEXT: static int a; // CHECK-NEXT: S s; @@ -105,7 +116,7 @@ // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp task if(5) mergeable priority(5) // CHECK-NEXT: foo() -// CHECK: template long tmain(long argc, long *argv) { +// CHECK: template<> long tmain(long argc, long *argv) { // CHECK-NEXT: long b = argc, c, d, e, f, g; // CHECK-NEXT: static long a; // CHECK-NEXT: S s; @@ -116,17 +127,6 @@ // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp task if(1) mergeable priority(1) // CHECK-NEXT: foo() -// CHECK: template T tmain(T argc, T *argv) { -// CHECK-NEXT: T b = argc, c, d, e, f, g; -// CHECK-NEXT: static T a; -// CHECK-NEXT: S s; -// CHECK-NEXT: T arr[argc]; -// CHECK-NEXT: #pragma omp task untied depend(in : argc,argv[b:argc],arr[:]) if(task: argc > 0) -// CHECK-NEXT: a = 2; -// CHECK-NEXT: #pragma omp task default(none) private(argc,b) firstprivate(argv) shared(d) if(argc > 0) final(S::TS > 0) priority(argc) -// CHECK-NEXT: foo() -// CHECK-NEXT: #pragma omp task if(C) mergeable priority(C) -// CHECK-NEXT: foo() enum Enum {}; Index: test/OpenMP/taskloop_ast_print.cpp =================================================================== --- test/OpenMP/taskloop_ast_print.cpp +++ test/OpenMP/taskloop_ast_print.cpp @@ -48,6 +48,7 @@ return T(); } +// CHECK-LABEL: int main(int argc, char **argv) { int main(int argc, char **argv) { int b = argc, c, d, e, f, g; static int a; Index: test/OpenMP/taskloop_simd_ast_print.cpp =================================================================== --- test/OpenMP/taskloop_simd_ast_print.cpp +++ test/OpenMP/taskloop_simd_ast_print.cpp @@ -49,6 +49,7 @@ return T(); } +// CHECK-LABEL: int main(int argc, char **argv) { int main(int argc, char **argv) { int b = argc, c, d, e, f, g; static int a; Index: test/OpenMP/taskwait_ast_print.cpp =================================================================== --- test/OpenMP/taskwait_ast_print.cpp +++ test/OpenMP/taskwait_ast_print.cpp @@ -14,12 +14,12 @@ #pragma omp taskwait return a + argc; } +// CHECK: static T a; +// CHECK-NEXT: #pragma omp taskwait // CHECK: static int a; // CHECK-NEXT: #pragma omp taskwait // CHECK: static char a; // CHECK-NEXT: #pragma omp taskwait -// CHECK: static T a; -// CHECK-NEXT: #pragma omp taskwait int main(int argc, char **argv) { static int a; Index: test/OpenMP/taskyield_ast_print.cpp =================================================================== --- test/OpenMP/taskyield_ast_print.cpp +++ test/OpenMP/taskyield_ast_print.cpp @@ -14,12 +14,12 @@ #pragma omp taskyield return a + argc; } +// CHECK: static T a; +// CHECK-NEXT: #pragma omp taskyield // CHECK: static int a; // CHECK-NEXT: #pragma omp taskyield // CHECK: static char a; // CHECK-NEXT: #pragma omp taskyield -// CHECK: static T a; -// CHECK-NEXT: #pragma omp taskyield int main(int argc, char **argv) { static int a; Index: test/OpenMP/teams_ast_print.cpp =================================================================== --- test/OpenMP/teams_ast_print.cpp +++ test/OpenMP/teams_ast_print.cpp @@ -15,18 +15,18 @@ #pragma omp threadprivate(TS) }; -// CHECK: template struct S { +// CHECK: template struct S { +// CHECK: static T TS; +// CHECK-NEXT: #pragma omp threadprivate(S::TS) +// CHECK: }; +// CHECK: template<> struct S { // CHECK: static int TS; // CHECK-NEXT: #pragma omp threadprivate(S::TS) // CHECK-NEXT: } -// CHECK: template struct S { +// CHECK: template<> struct S { // CHECK: static long TS; // CHECK-NEXT: #pragma omp threadprivate(S::TS) // CHECK-NEXT: } -// CHECK: template struct S { -// CHECK: static T TS; -// CHECK-NEXT: #pragma omp threadprivate(S::TS) -// CHECK: }; template T tmain(T argc, T *argv) { @@ -45,41 +45,41 @@ return 0; } -// CHECK: template int tmain(int argc, int *argv) { -// CHECK-NEXT: int b = argc, c, d, e, f, g; -// CHECK-NEXT: static int a; -// CHECK-NEXT: S s; +// CHECK: template T tmain(T argc, T *argv) { +// CHECK-NEXT: T b = argc, c, d, e, f, g; +// CHECK-NEXT: static T a; +// CHECK-NEXT: S s; // CHECK-NEXT: #pragma omp target // CHECK-NEXT: #pragma omp teams // CHECK-NEXT: a = 2; // CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(5) thread_limit(d * 5) +// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(C) thread_limit(d * C) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target // CHECK-NEXT: #pragma omp teams reduction(^: e,f) reduction(&&: g) // CHECK-NEXT: foo() -// CHECK: template long tmain(long argc, long *argv) { -// CHECK-NEXT: long b = argc, c, d, e, f, g; -// CHECK-NEXT: static long a; -// CHECK-NEXT: S s; +// CHECK: template<> int tmain(int argc, int *argv) { +// CHECK-NEXT: int b = argc, c, d, e, f, g; +// CHECK-NEXT: static int a; +// CHECK-NEXT: S s; // CHECK-NEXT: #pragma omp target // CHECK-NEXT: #pragma omp teams // CHECK-NEXT: a = 2; // CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(1) thread_limit(d * 1) +// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(5) thread_limit(d * 5) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target // CHECK-NEXT: #pragma omp teams reduction(^: e,f) reduction(&&: g) // CHECK-NEXT: foo() -// CHECK: template T tmain(T argc, T *argv) { -// CHECK-NEXT: T b = argc, c, d, e, f, g; -// CHECK-NEXT: static T a; -// CHECK-NEXT: S s; +// CHECK: template<> long tmain(long argc, long *argv) { +// CHECK-NEXT: long b = argc, c, d, e, f, g; +// CHECK-NEXT: static long a; +// CHECK-NEXT: S s; // CHECK-NEXT: #pragma omp target // CHECK-NEXT: #pragma omp teams // CHECK-NEXT: a = 2; // CHECK-NEXT: #pragma omp target -// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(C) thread_limit(d * C) +// CHECK-NEXT: #pragma omp teams default(none) private(argc,b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(1) thread_limit(d * 1) // CHECK-NEXT: foo() // CHECK-NEXT: #pragma omp target // CHECK-NEXT: #pragma omp teams reduction(^: e,f) reduction(&&: g) Index: test/OpenMP/teams_distribute_ast_print.cpp =================================================================== --- test/OpenMP/teams_distribute_ast_print.cpp +++ test/OpenMP/teams_distribute_ast_print.cpp @@ -45,13 +45,13 @@ } }; // CHECK: #pragma omp target -// CHECK-NEXT: #pragma omp teams distribute private(this->a) private(this->a) private(this->S::a) -// CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams distribute private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams distribute private(this->a) private(this->a) // CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams distribute default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d) +// CHECK: #pragma omp target +// CHECK-NEXT: #pragma omp teams distribute private(this->a) private(this->a) private(this->S::a) class S8 : public S7 { S8() {} Index: test/OpenMP/teams_distribute_simd_ast_print.cpp =================================================================== --- test/OpenMP/teams_distribute_simd_ast_print.cpp +++ test/OpenMP/teams_distribute_simd_ast_print.cpp @@ -54,8 +54,6 @@ } }; // CHECK: #pragma omp target -// CHECK-NEXT: #pragma omp teams distribute simd private(this->a) private(this->a) private(this->S::a) -// CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams distribute simd private(this->a) private(this->a) private(T::a) // CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams distribute simd private(this->a) private(this->a) @@ -63,6 +61,8 @@ // CHECK-NEXT: #pragma omp teams distribute simd default(none) private(b) firstprivate(argv) shared(d) reduction(+: c) reduction(max: e) num_teams(f) thread_limit(d) // CHECK: #pragma omp target // CHECK-NEXT: #pragma omp teams distribute simd simdlen(slen1) safelen(slen2) aligned(arr: alen) +// CHECK: #pragma omp target +// CHECK-NEXT: #pragma omp teams distribute simd private(this->a) private(this->a) private(this->S::a) class S8 : public S7 { S8() {} Index: test/OpenMP/threadprivate_ast_print.cpp =================================================================== --- test/OpenMP/threadprivate_ast_print.cpp +++ test/OpenMP/threadprivate_ast_print.cpp @@ -43,12 +43,12 @@ v = ST::m; return v; } -//CHECK: template int foo() { -//CHECK-NEXT: static int v; -//CHECK-NEXT: #pragma omp threadprivate(v) //CHECK: template T foo() { //CHECK-NEXT: static T v; //CHECK-NEXT: #pragma omp threadprivate(v) +//CHECK: template<> int foo() { +//CHECK-NEXT: static int v; +//CHECK-NEXT: #pragma omp threadprivate(v) namespace ns{ int a; Index: test/SemaTemplate/temp_arg_enum_printing.cpp =================================================================== --- test/SemaTemplate/temp_arg_enum_printing.cpp +++ test/SemaTemplate/temp_arg_enum_printing.cpp @@ -13,11 +13,11 @@ void foo(); void test() { - // CHECK: template + // CHECK: template<> void foo() NamedEnumNS::foo(); - // CHECK: template + // CHECK: template<> void foo() NamedEnumNS::foo<(NamedEnum)1>(); - // CHECK: template + // CHECK: template<> void foo<2>() NamedEnumNS::foo<(NamedEnum)2>(); } Index: unittests/AST/ASTTypeTraitsTest.cpp =================================================================== --- unittests/AST/ASTTypeTraitsTest.cpp +++ unittests/AST/ASTTypeTraitsTest.cpp @@ -163,7 +163,7 @@ TEST(DynTypedNode, DeclPrint) { PrintVerifier Verifier; - Verifier.expectString("void f() {\n}\n\n"); + Verifier.expectString("void f() {\n}\n"); EXPECT_TRUE(Verifier.match("void f() {}", functionDecl())); } Index: unittests/AST/DeclPrinterTest.cpp =================================================================== --- unittests/AST/DeclPrinterTest.cpp +++ unittests/AST/DeclPrinterTest.cpp @@ -254,24 +254,21 @@ ASSERT_TRUE(PrintedDeclCXX98Matches( "class A { int a; };", "A", - "class A {\n}")); - // Should be: with semicolon, with { ... } + "class A {}")); } TEST(DeclPrinter, TestCXXRecordDecl2) { ASSERT_TRUE(PrintedDeclCXX98Matches( "struct A { int a; };", "A", - "struct A {\n}")); - // Should be: with semicolon, with { ... } + "struct A {}")); } TEST(DeclPrinter, TestCXXRecordDecl3) { ASSERT_TRUE(PrintedDeclCXX98Matches( "union A { int a; };", "A", - "union A {\n}")); - // Should be: with semicolon, with { ... } + "union A {}")); } TEST(DeclPrinter, TestCXXRecordDecl4) { @@ -279,8 +276,7 @@ "class Z { int a; };" "class A : Z { int b; };", "A", - "class A : Z {\n}")); - // Should be: with semicolon, with { ... } + "class A : Z {}")); } TEST(DeclPrinter, TestCXXRecordDecl5) { @@ -288,8 +284,7 @@ "struct Z { int a; };" "struct A : Z { int b; };", "A", - "struct A : Z {\n}")); - // Should be: with semicolon, with { ... } + "struct A : Z {}")); } TEST(DeclPrinter, TestCXXRecordDecl6) { @@ -297,8 +292,7 @@ "class Z { int a; };" "class A : public Z { int b; };", "A", - "class A : public Z {\n}")); - // Should be: with semicolon, with { ... } + "class A : public Z {}")); } TEST(DeclPrinter, TestCXXRecordDecl7) { @@ -306,8 +300,7 @@ "class Z { int a; };" "class A : protected Z { int b; };", "A", - "class A : protected Z {\n}")); - // Should be: with semicolon, with { ... } + "class A : protected Z {}")); } TEST(DeclPrinter, TestCXXRecordDecl8) { @@ -315,8 +308,7 @@ "class Z { int a; };" "class A : private Z { int b; };", "A", - "class A : private Z {\n}")); - // Should be: with semicolon, with { ... } + "class A : private Z {}")); } TEST(DeclPrinter, TestCXXRecordDecl9) { @@ -324,8 +316,7 @@ "class Z { int a; };" "class A : virtual Z { int b; };", "A", - "class A : virtual Z {\n}")); - // Should be: with semicolon, with { ... } + "class A : virtual Z {}")); } TEST(DeclPrinter, TestCXXRecordDecl10) { @@ -333,8 +324,7 @@ "class Z { int a; };" "class A : virtual public Z { int b; };", "A", - "class A : virtual public Z {\n}")); - // Should be: with semicolon, with { ... } + "class A : virtual public Z {}")); } TEST(DeclPrinter, TestCXXRecordDecl11) { @@ -343,8 +333,7 @@ "class Y : virtual public Z { int b; };" "class A : virtual public Z, private Y { int c; };", "A", - "class A : virtual public Z, private Y {\n}")); - // Should be: with semicolon, with { ... } + "class A : virtual public Z, private Y {}")); } TEST(DeclPrinter, TestFunctionDecl1) { @@ -352,7 +341,6 @@ "void A();", "A", "void A()")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl2) { @@ -360,7 +348,6 @@ "void A() {}", "A", "void A()")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl3) { @@ -369,7 +356,6 @@ "void A() { Z(); }", "A", "void A()")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl4) { @@ -377,7 +363,6 @@ "extern void A();", "A", "extern void A()")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl5) { @@ -385,7 +370,6 @@ "static void A();", "A", "static void A()")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl6) { @@ -393,7 +377,6 @@ "inline void A();", "A", "inline void A()")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl7) { @@ -401,7 +384,6 @@ "constexpr int A(int a);", "A", "constexpr int A(int a)")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl8) { @@ -409,7 +391,6 @@ "void A(int a);", "A", "void A(int a)")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl9) { @@ -417,7 +398,6 @@ "void A(...);", "A", "void A(...)")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl10) { @@ -425,7 +405,6 @@ "void A(int a, ...);", "A", "void A(int a, ...)")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl11) { @@ -435,7 +414,6 @@ "void A(int a, pInt b, ssize_t c);", "A", "void A(int a, pInt b, ssize_t c)")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl12) { @@ -443,7 +421,6 @@ "void A(int a, int b = 0);", "A", "void A(int a, int b = 0)")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl13) { @@ -451,7 +428,7 @@ "void (*A(int a))(int b);", "A", "void (*A(int a))(int)")); - // Should be: with semicolon, with parameter name (?) + // Should be: with parameter name (?) } TEST(DeclPrinter, TestFunctionDecl14) { @@ -461,8 +438,7 @@ "template<>" "void A(int N) { }", functionDecl(hasName("A"), isExplicitTemplateSpecialization()).bind("id"), - "void A(int N)")); - // WRONG; Should be: "template <> void A(int N);")); + "template<> void A(int N)")); } @@ -555,7 +531,6 @@ "};", cxxConstructorDecl(ofClass(hasName("A"))).bind("id"), "A(const A &a)")); - // WRONG; Should be: "A(const A &a);" } TEST(DeclPrinter, TestCXXConstructorDecl11) { @@ -565,8 +540,7 @@ " A(T&&... ts) : T(ts)... {}" "};", cxxConstructorDecl(ofClass(hasName("A"))).bind("id"), - "A(T &&...ts) : T(ts)...")); - // WRONG; Should be: "A(T &&...ts) : T(ts)... {}" + "A(T &&...ts) : T(ts)... {}")); } TEST(DeclPrinter, TestCXXDestructorDecl1) { @@ -623,7 +597,6 @@ "};", cxxMethodDecl(ofClass(hasName("Z"))).bind("id"), "void *operator new(std::size_t)")); - // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction2) { @@ -634,7 +607,6 @@ "};", cxxMethodDecl(ofClass(hasName("Z"))).bind("id"), "void *operator new[](std::size_t)")); - // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction3) { @@ -644,7 +616,7 @@ "};", cxxMethodDecl(ofClass(hasName("Z"))).bind("id"), "void operator delete(void *) noexcept")); - // Should be: with semicolon, without noexcept? + // Should be: without noexcept? } TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction4) { @@ -654,7 +626,6 @@ "};", cxxMethodDecl(ofClass(hasName("Z"))).bind("id"), "void operator delete(void *)")); - // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl_AllocationFunction5) { @@ -664,7 +635,7 @@ "};", cxxMethodDecl(ofClass(hasName("Z"))).bind("id"), "void operator delete[](void *) noexcept")); - // Should be: with semicolon, without noexcept? + // Should be: without noexcept? } TEST(DeclPrinter, TestCXXMethodDecl_Operator1) { @@ -686,7 +657,6 @@ Expected.append("void operator"); Expected.append(OperatorNames[i]); Expected.append("(Z z)"); - // Should be: with semicolon ASSERT_TRUE(PrintedDeclCXX98Matches( Code, @@ -710,7 +680,6 @@ Expected.append("void operator"); Expected.append(OperatorNames[i]); Expected.append("()"); - // Should be: with semicolon ASSERT_TRUE(PrintedDeclCXX98Matches( Code, @@ -726,7 +695,6 @@ "};", "A", "void A(int a)")); - // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl2) { @@ -736,7 +704,6 @@ "};", "A", "virtual void A(int a)")); - // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl3) { @@ -749,7 +716,6 @@ "};", "ZZ::A", "void A(int a)")); - // Should be: with semicolon // TODO: should we print "virtual"? } @@ -760,7 +726,6 @@ "};", "A", "inline void A(int a)")); - // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl5) { @@ -770,7 +735,6 @@ "};", "A", "virtual void A(int a) = 0")); - // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl_CVQualifier1) { @@ -780,7 +744,6 @@ "};", "A", "void A(int a) const")); - // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl_CVQualifier2) { @@ -790,7 +753,6 @@ "};", "A", "void A(int a) volatile")); - // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl_CVQualifier3) { @@ -800,7 +762,6 @@ "};", "A", "void A(int a) const volatile")); - // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl_RefQualifier1) { @@ -810,7 +771,6 @@ "};", "A", "void A(int a) &")); - // Should be: with semicolon } TEST(DeclPrinter, TestCXXMethodDecl_RefQualifier2) { @@ -820,7 +780,6 @@ "};", "A", "void A(int a) &&")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification1) { @@ -830,7 +789,6 @@ "};", "A", "void A(int a) throw()")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification2) { @@ -840,7 +798,6 @@ "};", "A", "void A(int a) throw(int)")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification3) { @@ -851,7 +808,6 @@ "};", "A", "void A(int a) throw(ZZ, int)")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification4) { @@ -861,7 +817,6 @@ "};", "A", "void A(int a) noexcept")); - // Should be: with semicolon } TEST(DeclPrinter, TestFunctionDecl_ExceptionSpecification5) { @@ -942,8 +897,7 @@ "template" "struct A { T a; };", classTemplateDecl(hasName("A")).bind("id"), - "template struct A {\n}")); - // Should be: with semicolon, with { ... } + "template struct A {}")); } TEST(DeclPrinter, TestClassTemplateDecl2) { @@ -951,8 +905,7 @@ "template" "struct A { T a; };", classTemplateDecl(hasName("A")).bind("id"), - "template struct A {\n}")); - // Should be: with semicolon, with { ... } + "template struct A {}")); } TEST(DeclPrinter, TestClassTemplateDecl3) { @@ -960,8 +913,7 @@ "template" "struct A { T a; };", classTemplateDecl(hasName("A")).bind("id"), - "template struct A {\n}")); - // Should be: with semicolon, with { ... } + "template struct A {}")); } TEST(DeclPrinter, TestClassTemplateDecl4) { @@ -969,8 +921,7 @@ "template" "struct A { T a; U b; };", classTemplateDecl(hasName("A")).bind("id"), - "template struct A {\n}")); - // Should be: with semicolon, with { ... } + "template struct A {}")); } TEST(DeclPrinter, TestClassTemplateDecl5) { @@ -978,8 +929,7 @@ "template" "struct A { int a[N]; };", classTemplateDecl(hasName("A")).bind("id"), - "template struct A {\n}")); - // Should be: with semicolon, with { ... } + "template struct A {}")); } TEST(DeclPrinter, TestClassTemplateDecl6) { @@ -987,8 +937,7 @@ "template" "struct A { int a[N]; };", classTemplateDecl(hasName("A")).bind("id"), - "template struct A {\n}")); - // Should be: with semicolon, with { ... } + "template struct A {}")); } TEST(DeclPrinter, TestClassTemplateDecl7) { @@ -997,16 +946,14 @@ "template" "struct A { int a[N]; };", classTemplateDecl(hasName("A")).bind("id"), - "template struct A {\n}")); - // Should be: with semicolon, with { ... } + "template struct A {}")); } TEST(DeclPrinter, TestClassTemplateDecl8) { ASSERT_TRUE(PrintedDeclCXX98Matches( "template class T> struct A { };", classTemplateDecl(hasName("A")).bind("id"), - "template