1// clang-format off
2// REQUIRES: lld, x86
3
4// RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -GR- -c /Fo%t.obj -- %s
5// RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe -pdb:%t.pdb
6// RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
7// RUN: %p/Inputs/ast-methods.lldbinit 2>&1 | FileCheck %s --check-prefix=AST
8
9// RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb-test symbols --dump-ast %t.exe | FileCheck %s --check-prefix=SYMBOL
10
11struct Struct {
12 void simple_method() {}
13
14 virtual void virtual_method() {}
15
16 static void static_method() {}
17
18 int overloaded_method() {}
19 int overloaded_method(char c) {}
20 int overloaded_method(char c, int i, ...) {}
21};
22
23Struct s;
24
25int main(int argc, char **argv) {
26 s.simple_method();
27 s.static_method();
28 s.virtual_method();
29 s.overloaded_method();
30 s.overloaded_method(c: 'a');
31 s.overloaded_method(c: 'a', i: 1);
32 return 0;
33}
34
35// AST: TranslationUnitDecl
36// AST: |-CXXRecordDecl {{.*}} struct Struct definition
37// AST: | |-CXXMethodDecl {{.*}} simple_method 'void (){{.*}}'
38// AST: | |-CXXMethodDecl {{.*}} virtual_method 'void (){{.*}}' virtual
39// AST: | |-CXXMethodDecl {{.*}} static_method 'void ()' static
40// AST: | |-CXXMethodDecl {{.*}} overloaded_method 'int (){{.*}}'
41// AST: | |-CXXMethodDecl {{.*}} overloaded_method 'int (char){{.*}}'
42// AST: | | `-ParmVarDecl {{.*}} 'char'
43// AST: | `-CXXMethodDecl {{.*}} overloaded_method 'int (char, int, ...)'
44// AST: | |-ParmVarDecl {{.*}} 'char'
45// AST: | `-ParmVarDecl {{.*}} 'int'
46
47// SYMBOL: int main(int argc, char **argv);
48// SYMBOL-NEXT: struct Struct {
49// SYMBOL-NEXT: void simple_method();
50// SYMBOL-NEXT: static void static_method();
51// SYMBOL-NEXT: virtual void virtual_method();
52// SYMBOL-NEXT: int overloaded_method();
53// SYMBOL-NEXT: int overloaded_method(char);
54// SYMBOL-NEXT: int overloaded_method(char, int, ...);
55// SYMBOL-NEXT: };
56

source code of lldb/test/Shell/SymbolFile/NativePDB/ast-methods.cpp