blob: e7668cc36f0e8016a17fb75398ab4f211024a499 [file] [log] [blame]
Raphael Isemann4e4c0662019-01-21 10:14:31 +00001// RUN: clang-import-test -dump-ast -import %S/Inputs/F.cpp -expression %s | FileCheck %s
2
3// The implicit UsingDirectiveDecls for the anonymous namespaces are created by the Sema.
4
Raphael Isemanned5a8972019-10-01 11:53:20 +00005// There might be another builtin namespace before our first namespace, so we can't
6// just look for NamespaceDecl. Instead look for the first line of F.cpp (which only
7// contains the namespace we are looking for but no other decl).
8// CHECK: F.cpp:1:1
Raphael Isemann4e4c0662019-01-21 10:14:31 +00009// The nested anonymous namespace.
10// CHECK-NEXT: NamespaceDecl
Balázs Kéria9f10eb2019-12-05 16:21:21 +010011// CHECK-SAME: line:21:11
Raphael Isemann4e4c0662019-01-21 10:14:31 +000012// CHECK: FunctionDecl
13// CHECK-SAME: func4
14// CHECK-NEXT: CompoundStmt
15// This is for the nested anonymous namespace.
16// CHECK-NEXT: UsingDirectiveDecl
17// CHECK-SAME: ''
18// CHECK: FunctionDecl
19// CHECK-SAME: func1
20// CHECK-NEXT: CompoundStmt
21// CHECK-NEXT: UsingDirectiveDecl
22// CHECK-SAME: ''
23
24// CHECK: NamespaceDecl
25// CHECK-SAME: test_namespace1
26// CHECK-NEXT: NamespaceDecl
27// CHECK: FunctionDecl
28// CHECK-SAME: func2
29// CHECK-NEXT: CompoundStmt
30// CHECK-NEXT: UsingDirectiveDecl
31// CHECK-SAME: ''
32
33// CHECK-NEXT: NamespaceDecl
34// CHECK-SAME: test_namespace2
35// CHECK-NEXT: NamespaceDecl
36// CHECK-NEXT: NamespaceDecl
37// CHECK-SAME: test_namespace3
38// CHECK: FunctionDecl
39// CHECK-SAME: func3
40// CHECK-NEXT: CompoundStmt
41// CHECK-NEXT: UsingDirectiveDecl
42// CHECK-SAME: ''
43
44void expr() {
45 func1();
46 test_namespace1::func2();
47 test_namespace2::test_namespace3::func3();
48 func4();
49}