Home | History | Annotate | Download | only in Misc
      1 // RUN: %clang_cc1 -std=c++11 -triple x86_64-linux-gnu -fms-extensions -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix CHECK -strict-whitespace %s
      2 
      3 class testEnumDecl {
      4   enum class TestEnumDeclScoped;
      5   enum TestEnumDeclFixed : int;
      6 };
      7 // CHECK: EnumDecl{{.*}} class TestEnumDeclScoped 'int'
      8 // CHECK: EnumDecl{{.*}} TestEnumDeclFixed 'int'
      9 
     10 class testFieldDecl {
     11   int TestFieldDeclInit = 0;
     12 };
     13 // CHECK:      FieldDecl{{.*}} TestFieldDeclInit 'int'
     14 // CHECK-NEXT:   IntegerLiteral
     15 
     16 namespace testVarDeclNRVO {
     17   class A { };
     18   A foo() {
     19     A TestVarDeclNRVO;
     20     return TestVarDeclNRVO;
     21   }
     22 }
     23 // CHECK: VarDecl{{.*}} TestVarDeclNRVO 'class testVarDeclNRVO::A' nrvo
     24 
     25 void testParmVarDeclInit(int TestParmVarDeclInit = 0);
     26 // CHECK:      ParmVarDecl{{.*}} TestParmVarDeclInit 'int'
     27 // CHECK-NEXT:   IntegerLiteral{{.*}}
     28 
     29 namespace TestNamespaceDecl {
     30   int i;
     31 }
     32 // CHECK:      NamespaceDecl{{.*}} TestNamespaceDecl
     33 // CHECK-NEXT:   VarDecl
     34 
     35 namespace TestNamespaceDecl {
     36   int j;
     37 }
     38 // CHECK:      NamespaceDecl{{.*}} TestNamespaceDecl
     39 // CHECK-NEXT:   original Namespace
     40 // CHECK-NEXT:   VarDecl
     41 
     42 inline namespace TestNamespaceDeclInline {
     43 }
     44 // CHECK:      NamespaceDecl{{.*}} TestNamespaceDeclInline inline
     45 
     46 namespace testUsingDirectiveDecl {
     47   namespace A {
     48   }
     49 }
     50 namespace TestUsingDirectiveDecl {
     51   using namespace testUsingDirectiveDecl::A;
     52 }
     53 // CHECK:      NamespaceDecl{{.*}} TestUsingDirectiveDecl
     54 // CHECK-NEXT:   UsingDirectiveDecl{{.*}} Namespace{{.*}} 'A'
     55 
     56 namespace testNamespaceAlias {
     57   namespace A {
     58   }
     59 }
     60 namespace TestNamespaceAlias = testNamespaceAlias::A;
     61 // CHECK:      NamespaceAliasDecl{{.*}} TestNamespaceAlias
     62 // CHECK-NEXT:   Namespace{{.*}} 'A'
     63 
     64 using TestTypeAliasDecl = int;
     65 // CHECK: TypeAliasDecl{{.*}} TestTypeAliasDecl 'int'
     66 
     67 namespace testTypeAliasTemplateDecl {
     68   template<typename T> class A;
     69   template<typename T> using TestTypeAliasTemplateDecl = A<T>;
     70 }
     71 // CHECK:      TypeAliasTemplateDecl{{.*}} TestTypeAliasTemplateDecl
     72 // CHECK-NEXT:   TemplateTypeParmDecl
     73 // CHECK-NEXT:   TypeAliasDecl{{.*}} TestTypeAliasTemplateDecl 'A<T>'
     74 
     75 namespace testCXXRecordDecl {
     76   class A { };
     77   class B { };
     78   class TestCXXRecordDecl : virtual A, public B {
     79     int i;
     80   };
     81 }
     82 // CHECK:      CXXRecordDecl{{.*}} class TestCXXRecordDecl
     83 // CHECK-NEXT:   virtual private 'class testCXXRecordDecl::A'
     84 // CHECK-NEXT:   public 'class testCXXRecordDecl::B'
     85 // CHECK-NEXT:   CXXRecordDecl{{.*}} class TestCXXRecordDecl
     86 // CHECK-NEXT:   FieldDecl
     87 
     88 template<class...T>
     89 class TestCXXRecordDeclPack : public T... {
     90 };
     91 // CHECK:      CXXRecordDecl{{.*}} class TestCXXRecordDeclPack
     92 // CHECK-NEXT:   public 'T'...
     93 // CHECK-NEXT:   CXXRecordDecl{{.*}} class TestCXXRecordDeclPack
     94 
     95 thread_local int TestThreadLocalInt;
     96 // CHECK: TestThreadLocalInt {{.*}} tls_dynamic
     97 
     98 __module_private__ class TestCXXRecordDeclPrivate;
     99 // CHECK: CXXRecordDecl{{.*}} class TestCXXRecordDeclPrivate __module_private__
    100 
    101 class testCXXMethodDecl {
    102   __module_private__ void TestCXXMethodDeclPrivate();
    103   virtual void TestCXXMethodDeclPure() = 0;
    104   void TestCXXMethodDeclDelete() = delete;
    105   void TestCXXMethodDeclThrow() throw();
    106   void TestCXXMethodDeclThrowType() throw(int);
    107 };
    108 // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclPrivate 'void (void)' __module_private__
    109 // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclPure 'void (void)' virtual pure
    110 // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclDelete 'void (void)' delete
    111 // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclThrow 'void (void) throw()'
    112 // CHECK: CXXMethodDecl{{.*}} TestCXXMethodDeclThrowType 'void (void) throw(int)'
    113 
    114 namespace testCXXConstructorDecl {
    115   class A { };
    116   class TestCXXConstructorDecl : public A {
    117     int I;
    118     TestCXXConstructorDecl(A &a, int i) : A(a), I(i) { }
    119     TestCXXConstructorDecl(A &a) : TestCXXConstructorDecl(a, 0) { }
    120   };
    121 }
    122 // CHECK:      CXXConstructorDecl{{.*}} TestCXXConstructorDecl 'void {{.*}}'
    123 // CHECK-NEXT:   ParmVarDecl{{.*}} a
    124 // CHECK-NEXT:   ParmVarDecl{{.*}} i
    125 // CHECK-NEXT:   CXXCtorInitializer{{.*}}A
    126 // CHECK-NEXT:     Expr
    127 // CHECK:        CXXCtorInitializer{{.*}}I
    128 // CHECK-NEXT:     Expr
    129 // CHECK:        CompoundStmt
    130 // CHECK:      CXXConstructorDecl{{.*}} TestCXXConstructorDecl 'void {{.*}}'
    131 // CHECK-NEXT:   ParmVarDecl{{.*}} a
    132 // CHECK-NEXT:   CXXCtorInitializer{{.*}}TestCXXConstructorDecl
    133 // CHECK-NEXT:     CXXConstructExpr{{.*}}TestCXXConstructorDecl
    134 
    135 class TestCXXDestructorDecl {
    136   ~TestCXXDestructorDecl() { }
    137 };
    138 // CHECK:      CXXDestructorDecl{{.*}} ~TestCXXDestructorDecl 'void (void) noexcept'
    139 // CHECK-NEXT:   CompoundStmt
    140 
    141 // Test that the range of a defaulted members is computed correctly.
    142 class TestMemberRanges {
    143 public:
    144   TestMemberRanges() = default;
    145   TestMemberRanges(const TestMemberRanges &Other) = default;
    146   TestMemberRanges(TestMemberRanges &&Other) = default;
    147   ~TestMemberRanges() = default;
    148   TestMemberRanges &operator=(const TestMemberRanges &Other) = default;
    149   TestMemberRanges &operator=(TestMemberRanges &&Other) = default;
    150 };
    151 void SomeFunction() {
    152   TestMemberRanges A;
    153   TestMemberRanges B(A);
    154   B = A;
    155   A = static_cast<TestMemberRanges &&>(B);
    156   TestMemberRanges C(static_cast<TestMemberRanges &&>(A));
    157 }
    158 // CHECK:      CXXConstructorDecl{{.*}} <line:{{.*}}:3, col:30>
    159 // CHECK:      CXXConstructorDecl{{.*}} <line:{{.*}}:3, col:59>
    160 // CHECK:      CXXConstructorDecl{{.*}} <line:{{.*}}:3, col:54>
    161 // CHECK:      CXXDestructorDecl{{.*}} <line:{{.*}}:3, col:31>
    162 // CHECK:      CXXMethodDecl{{.*}} <line:{{.*}}:3, col:70>
    163 // CHECK:      CXXMethodDecl{{.*}} <line:{{.*}}:3, col:65>
    164 
    165 class TestCXXConversionDecl {
    166   operator int() { return 0; }
    167 };
    168 // CHECK:      CXXConversionDecl{{.*}} operator int 'int (void)'
    169 // CHECK-NEXT:   CompoundStmt
    170 
    171 namespace TestStaticAssertDecl {
    172   static_assert(true, "msg");
    173 }
    174 // CHECK:      NamespaceDecl{{.*}} TestStaticAssertDecl
    175 // CHECK-NEXT:   StaticAssertDecl{{.*> .*$}}
    176 // CHECK-NEXT:     CXXBoolLiteralExpr
    177 // CHECK-NEXT:     StringLiteral
    178 
    179 namespace testFunctionTemplateDecl {
    180   class A { };
    181   class B { };
    182   class C { };
    183   class D { };
    184   template<typename T> void TestFunctionTemplate(T) { }
    185 
    186   // implicit instantiation
    187   void bar(A a) { TestFunctionTemplate(a); }
    188 
    189   // explicit specialization
    190   template<> void TestFunctionTemplate(B);
    191 
    192   // explicit instantiation declaration
    193   extern template void TestFunctionTemplate(C);
    194 
    195   // explicit instantiation definition
    196   template void TestFunctionTemplate(D);
    197 }
    198 // CHECK:      FunctionTemplateDecl{{.*}} TestFunctionTemplate
    199 // CHECK-NEXT:   TemplateTypeParmDecl
    200 // CHECK-NEXT:   FunctionDecl{{.*}} TestFunctionTemplate 'void (T)'
    201 // CHECK-NEXT:     ParmVarDecl{{.*}} 'T'
    202 // CHECK-NEXT:     CompoundStmt
    203 // CHECK-NEXT:   FunctionDecl{{.*}} TestFunctionTemplate {{.*}}A
    204 // CHECK-NEXT:     TemplateArgument
    205 // CHECK-NEXT:     ParmVarDecl
    206 // CHECK-NEXT:     CompoundStmt
    207 // CHECK-NEXT:   Function{{.*}} 'TestFunctionTemplate' {{.*}}B
    208 // CHECK-NEXT:   FunctionDecl{{.*}} TestFunctionTemplate {{.*}}C
    209 // CHECK-NEXT:     TemplateArgument
    210 // CHECK-NEXT:     ParmVarDecl
    211 // CHECK-NEXT:   FunctionDecl{{.*}} TestFunctionTemplate {{.*}}D
    212 // CHECK-NEXT:     TemplateArgument
    213 // CHECK-NEXT:     ParmVarDecl
    214 // CHECK-NEXT:     CompoundStmt
    215 // CHECK:      FunctionDecl{{.*}} TestFunctionTemplate {{.*}}B
    216 // CHECK-NEXT:   TemplateArgument
    217 // CHECK-NEXT:   ParmVarDecl
    218 
    219 namespace testClassTemplateDecl {
    220   class A { };
    221   class B { };
    222   class C { };
    223   class D { };
    224 
    225   template<typename T> class TestClassTemplate {
    226     int i;
    227   };
    228 
    229   // implicit instantiation
    230   TestClassTemplate<A> a;
    231 
    232   // explicit specialization
    233   template<> class TestClassTemplate<B> {
    234     int j;
    235   };
    236 
    237   // explicit instantiation declaration
    238   extern template class TestClassTemplate<C>;
    239 
    240   // explicit instantiation definition
    241   template class TestClassTemplate<D>;
    242 
    243   // partial explicit specialization
    244   template<typename T1, typename T2> class TestClassTemplatePartial {
    245     int i;
    246   };
    247   template<typename T1> class TestClassTemplatePartial<T1, A> {
    248     int j;
    249   };
    250 }
    251 // CHECK:      ClassTemplateDecl{{.*}} TestClassTemplate
    252 // CHECK-NEXT:   TemplateTypeParmDecl
    253 // CHECK-NEXT:   CXXRecordDecl{{.*}} class TestClassTemplate
    254 // CHECK-NEXT:     CXXRecordDecl{{.*}} class TestClassTemplate
    255 // CHECK-NEXT:     FieldDecl{{.*}} i
    256 // CHECK-NEXT:   ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate
    257 // CHECK-NEXT:     TemplateArgument{{.*}}A
    258 // CHECK-NEXT:     CXXRecordDecl{{.*}} class TestClassTemplate
    259 // CHECK-NEXT:     FieldDecl{{.*}} i
    260 // CHECK:        ClassTemplateSpecialization{{.*}} 'TestClassTemplate'
    261 // CHECK-NEXT:   ClassTemplateSpecialization{{.*}} 'TestClassTemplate'
    262 // CHECK-NEXT:   ClassTemplateSpecialization{{.*}} 'TestClassTemplate'
    263 
    264 // CHECK:      ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate
    265 // CHECK-NEXT:   TemplateArgument{{.*}}B
    266 // CHECK-NEXT:   CXXRecordDecl{{.*}} class TestClassTemplate
    267 // CHECK-NEXT:   FieldDecl{{.*}} j
    268 
    269 // CHECK:      ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate
    270 // CHECK-NEXT:   TemplateArgument{{.*}}C
    271 // CHECK-NEXT:   CXXRecordDecl{{.*}} class TestClassTemplate
    272 // CHECK-NEXT:   FieldDecl{{.*}} i
    273 
    274 // CHECK:      ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate
    275 // CHECK-NEXT:   TemplateArgument{{.*}}D
    276 // CHECK-NEXT:   CXXRecordDecl{{.*}} class TestClassTemplate
    277 // CHECK-NEXT:   FieldDecl{{.*}} i
    278 
    279 // CHECK:      ClassTemplatePartialSpecializationDecl{{.*}} class TestClassTemplatePartial
    280 // CHECK-NEXT:   TemplateArgument
    281 // CHECK-NEXT:   TemplateArgument{{.*}}A
    282 // CHECK-NEXT:   TemplateTypeParmDecl
    283 // CHECK-NEXT:   CXXRecordDecl{{.*}} class TestClassTemplatePartial
    284 // CHECK-NEXT:   FieldDecl{{.*}} j
    285 
    286 // PR15220 dump instantiation only once
    287 namespace testCanonicalTemplate {
    288   class A {};
    289 
    290   template<typename T> void TestFunctionTemplate(T);
    291   template<typename T> void TestFunctionTemplate(T);
    292   void bar(A a) { TestFunctionTemplate(a); }
    293   // CHECK:      FunctionTemplateDecl{{.*}} TestFunctionTemplate
    294   // CHECK-NEXT:   TemplateTypeParmDecl
    295   // CHECK-NEXT:   FunctionDecl{{.*}} TestFunctionTemplate 'void (T)'
    296   // CHECK-NEXT:     ParmVarDecl{{.*}} 'T'
    297   // CHECK-NEXT:   FunctionDecl{{.*}} TestFunctionTemplate {{.*}}A
    298   // CHECK-NEXT:     TemplateArgument
    299   // CHECK-NEXT:     ParmVarDecl
    300   // CHECK:      FunctionTemplateDecl{{.*}} TestFunctionTemplate
    301   // CHECK-NEXT:   TemplateTypeParmDecl
    302   // CHECK-NEXT:   FunctionDecl{{.*}} TestFunctionTemplate 'void (T)'
    303   // CHECK-NEXT:     ParmVarDecl{{.*}} 'T'
    304   // CHECK-NEXT:   Function{{.*}} 'TestFunctionTemplate'
    305   // CHECK-NOT:      TemplateArgument
    306 
    307   template<typename T1> class TestClassTemplate {
    308     template<typename T2> friend class TestClassTemplate;
    309   };
    310   TestClassTemplate<A> a;
    311   // CHECK:      ClassTemplateDecl{{.*}} TestClassTemplate
    312   // CHECK-NEXT:   TemplateTypeParmDecl
    313   // CHECK-NEXT:   CXXRecordDecl{{.*}} class TestClassTemplate
    314   // CHECK-NEXT:     CXXRecordDecl{{.*}} class TestClassTemplate
    315   // CHECK-NEXT:     FriendDecl
    316   // CHECK-NEXT:       ClassTemplateDecl{{.*}} TestClassTemplate
    317   // CHECK-NEXT:         TemplateTypeParmDecl
    318   // CHECK-NEXT:         CXXRecordDecl{{.*}} class TestClassTemplate
    319   // CHECK-NEXT:         ClassTemplateSpecialization{{.*}} 'TestClassTemplate'
    320   // CHECK-NEXT:   ClassTemplateSpecializationDecl{{.*}} class TestClassTemplate
    321   // CHECK-NEXT:     TemplateArgument{{.*}}A
    322   // CHECK-NEXT:     CXXRecordDecl{{.*}} class TestClassTemplate
    323 }
    324 
    325 template <class T>
    326 class TestClassScopeFunctionSpecialization {
    327   template<class U> void foo(U a) { }
    328   template<> void foo<int>(int a) { }
    329 };
    330 // CHECK:      ClassScopeFunctionSpecializationDecl
    331 // CHECK-NEXT:   CXXMethod{{.*}} 'foo' 'void (int)'
    332 // CHECK-NEXT:   TemplateArgument{{.*}} 'int'
    333 
    334 namespace TestTemplateTypeParmDecl {
    335   template<typename ... T, class U = int> void foo();
    336 }
    337 // CHECK:      NamespaceDecl{{.*}} TestTemplateTypeParmDecl
    338 // CHECK-NEXT:   FunctionTemplateDecl
    339 // CHECK-NEXT:     TemplateTypeParmDecl{{.*}} typename ... T
    340 // CHECK-NEXT:     TemplateTypeParmDecl{{.*}} class U
    341 // CHECK-NEXT:       TemplateArgument type 'int'
    342 
    343 namespace TestNonTypeTemplateParmDecl {
    344   template<int I = 1, int ... J> void foo();
    345 }
    346 // CHECK:      NamespaceDecl{{.*}} TestNonTypeTemplateParmDecl
    347 // CHECK-NEXT:   FunctionTemplateDecl
    348 // CHECK-NEXT:     NonTypeTemplateParmDecl{{.*}} 'int' I
    349 // CHECK-NEXT:       TemplateArgument expr
    350 // CHECK-NEXT:         IntegerLiteral{{.*}} 'int' 1
    351 // CHECK-NEXT:     NonTypeTemplateParmDecl{{.*}} 'int' ... J
    352 
    353 namespace TestTemplateTemplateParmDecl {
    354   template<typename T> class A;
    355   template <template <typename> class T = A, template <typename> class ... U> void foo();
    356 }
    357 // CHECK:      NamespaceDecl{{.*}} TestTemplateTemplateParmDecl
    358 // CHECK:        FunctionTemplateDecl
    359 // CHECK-NEXT:     TemplateTemplateParmDecl{{.*}} T
    360 // CHECK-NEXT:       TemplateTypeParmDecl{{.*}} typename
    361 // CHECK-NEXT:       TemplateArgument{{.*}} template A
    362 // CHECK-NEXT:     TemplateTemplateParmDecl{{.*}} ... U
    363 // CHECK-NEXT:       TemplateTypeParmDecl{{.*}} typename
    364 
    365 namespace TestTemplateArgument {
    366   template<typename> class A { };
    367   template<template<typename> class ...> class B { };
    368   int foo();
    369 
    370   template<typename> class testType { };
    371   template class testType<int>;
    372   // CHECK:      ClassTemplateSpecializationDecl{{.*}} class testType
    373   // CHECK-NEXT:   TemplateArgument{{.*}} type 'int'
    374 
    375   template<int fp(void)> class testDecl { };
    376   template class testDecl<foo>;
    377   // CHECK:      ClassTemplateSpecializationDecl{{.*}} class testDecl
    378   // CHECK-NEXT:   TemplateArgument{{.*}} decl
    379   // CHECK-NEXT:     Function{{.*}}foo
    380 
    381   template class testDecl<nullptr>;
    382   // CHECK:      ClassTemplateSpecializationDecl{{.*}} class testDecl
    383   // CHECK-NEXT:   TemplateArgument{{.*}} nullptr
    384 
    385   template<int> class testIntegral { };
    386   template class testIntegral<1>;
    387   // CHECK:      ClassTemplateSpecializationDecl{{.*}} class testIntegral
    388   // CHECK-NEXT:   TemplateArgument{{.*}} integral 1
    389 
    390   template<template<typename> class> class testTemplate { };
    391   template class testTemplate<A>;
    392   // CHECK:      ClassTemplateSpecializationDecl{{.*}} class testTemplate
    393   // CHECK-NEXT:   TemplateArgument{{.*}} A
    394 
    395   template<template<typename> class ...T> class C {
    396     B<T...> testTemplateExpansion;
    397   };
    398   // FIXME: Need TemplateSpecializationType dumping to test TemplateExpansion.
    399 
    400   template<int, int = 0> class testExpr;
    401   template<int I> class testExpr<I> { };
    402   // CHECK:      ClassTemplatePartialSpecializationDecl{{.*}} class testExpr
    403   // CHECK-NEXT:   TemplateArgument{{.*}} expr
    404   // CHECK-NEXT:     DeclRefExpr{{.*}}I
    405 
    406   template<int, int ...> class testPack { };
    407   template class testPack<0, 1, 2>;
    408   // CHECK:      ClassTemplateSpecializationDecl{{.*}} class testPack
    409   // CHECK-NEXT:   TemplateArgument{{.*}} integral 0
    410   // CHECK-NEXT:   TemplateArgument{{.*}} pack
    411   // CHECK-NEXT:     TemplateArgument{{.*}} integral 1
    412   // CHECK-NEXT:     TemplateArgument{{.*}} integral 2
    413 }
    414 
    415 namespace testUsingDecl {
    416   int i;
    417 }
    418 namespace TestUsingDecl {
    419   using testUsingDecl::i;
    420 }
    421 // CHECK:      NamespaceDecl{{.*}} TestUsingDecl
    422 // CHECK-NEXT:   UsingDecl{{.*}} testUsingDecl::i
    423 // CHECK-NEXT:   UsingShadowDecl{{.*}} Var{{.*}} 'i' 'int'
    424 
    425 namespace testUnresolvedUsing {
    426   class A { };
    427   template<class T> class B {
    428   public:
    429     A a;
    430   };
    431   template<class T> class TestUnresolvedUsing : public B<T> {
    432     using typename B<T>::a;
    433     using B<T>::a;
    434   };
    435 }
    436 // CHECK: CXXRecordDecl{{.*}} TestUnresolvedUsing
    437 // CHECK:   UnresolvedUsingTypenameDecl{{.*}} B<T>::a
    438 // CHECK:   UnresolvedUsingValueDecl{{.*}} B<T>::a
    439 
    440 namespace TestLinkageSpecDecl {
    441   extern "C" void test1();
    442   extern "C++" void test2();
    443 }
    444 // CHECK:      NamespaceDecl{{.*}} TestLinkageSpecDecl
    445 // CHECK-NEXT:   LinkageSpecDecl{{.*}} C
    446 // CHECK-NEXT:     FunctionDecl
    447 // CHECK-NEXT:   LinkageSpecDecl{{.*}} C++
    448 // CHECK-NEXT:     FunctionDecl
    449 
    450 class TestAccessSpecDecl {
    451 public:
    452 private:
    453 protected:
    454 };
    455 // CHECK:      CXXRecordDecl{{.*}} class TestAccessSpecDecl
    456 // CHECK-NEXT:    CXXRecordDecl{{.*}} class TestAccessSpecDecl
    457 // CHECK-NEXT:    AccessSpecDecl{{.*}} public
    458 // CHECK-NEXT:    AccessSpecDecl{{.*}} private
    459 // CHECK-NEXT:    AccessSpecDecl{{.*}} protected
    460 
    461 template<typename T> class TestFriendDecl {
    462   friend int foo();
    463   friend class A;
    464   friend T;
    465 };
    466 // CHECK:      CXXRecord{{.*}} TestFriendDecl
    467 // CHECK-NEXT:   CXXRecord{{.*}} TestFriendDecl
    468 // CHECK-NEXT:   FriendDecl
    469 // CHECK-NEXT:     FunctionDecl{{.*}} foo
    470 // CHECK-NEXT:   FriendDecl{{.*}} 'class A':'class A'
    471 // CHECK-NEXT:   FriendDecl{{.*}} 'T'
    472 
    473 namespace TestFileScopeAsmDecl {
    474   asm("ret");
    475 }
    476 // CHECK:      NamespaceDecl{{.*}} TestFileScopeAsmDecl{{$}}
    477 // CHECK:        FileScopeAsmDecl{{.*> .*$}}
    478 // CHECK-NEXT:     StringLiteral
    479 
    480 namespace TestFriendDecl2 {
    481   void f();
    482   struct S {
    483     friend void f();
    484   };
    485 }
    486 // CHECK: NamespaceDecl [[TestFriendDecl2:0x.*]] <{{.*}}> {{.*}} TestFriendDecl2
    487 // CHECK: |-FunctionDecl [[TestFriendDecl2_f:0x.*]] <{{.*}}> {{.*}} f 'void (void)'
    488 // CHECK: `-CXXRecordDecl {{.*}} struct S
    489 // CHECK:   |-CXXRecordDecl {{.*}} struct S
    490 // CHECK:   `-FriendDecl
    491 // CHECK:     `-FunctionDecl {{.*}} parent [[TestFriendDecl2]] prev [[TestFriendDecl2_f]] <{{.*}}> {{.*}} f 'void (void)'
    492 
    493 namespace Comment {
    494   extern int Test;
    495   /// Something here.
    496   extern int Test;
    497   extern int Test;
    498 }
    499 
    500 // CHECK: VarDecl {{.*}} Test 'int' extern
    501 // CHECK-NOT: FullComment
    502 // CHECK: VarDecl {{.*}} Test 'int' extern
    503 // CHECK: `-FullComment
    504 // CHECK:   `-ParagraphComment
    505 // CHECK:       `-TextComment
    506 // CHECK: VarDecl {{.*}} Test 'int' extern
    507 // CHECK-NOT: FullComment
    508