brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · 9a2df03 Raw
50 lines · cpp
1// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s2 3// The implicit UsingDirectiveDecls for the anonymous namespaces are created by the Sema.4 5// There might be another builtin namespace before our first namespace, so we can't6// just look for NamespaceDecl. Instead look for the first line of F.cpp (which only7// contains the namespace we are looking for but no other decl).8// CHECK: F.cpp:1:19// The nested anonymous namespace.10// CHECK-NEXT: NamespaceDecl11// CHECK-SAME: line:21:1112// CHECK: FunctionDecl13// CHECK-SAME: func414// CHECK-NEXT: CompoundStmt15// This is for the nested anonymous namespace.16// CHECK-NEXT: UsingDirectiveDecl17// CHECK-SAME: <col:1, line:24:1>18// CHECK: FunctionDecl19// CHECK-SAME: func120// CHECK-NEXT: CompoundStmt21// CHECK-NEXT: UsingDirectiveDecl22// CHECK-SAME: <col:1, line:4:1>23 24// CHECK: NamespaceDecl25// CHECK-SAME: test_namespace126// CHECK-NEXT: NamespaceDecl27// CHECK: FunctionDecl28// CHECK-SAME: func229// CHECK-NEXT: CompoundStmt30// CHECK-NEXT: UsingDirectiveDecl31// CHECK-SAME: <col:1, line:9:1>32 33// CHECK-NEXT: NamespaceDecl34// CHECK-SAME: test_namespace235// CHECK-NEXT: NamespaceDecl36// CHECK-NEXT: NamespaceDecl37// CHECK-SAME: test_namespace338// CHECK: FunctionDecl39// CHECK-SAME: func340// CHECK-NEXT: CompoundStmt41// CHECK-NEXT: UsingDirectiveDecl42// CHECK-SAME: <col:1, line:17:1>43 44void expr() {45  func1();46  test_namespace1::func2();47  test_namespace2::test_namespace3::func3();48  func4();49}50