57 lines · cpp
1// clang-format off2// REQUIRES: lld, x863 4// RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -GR- -c /Fo%t.obj -- %s5// RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe -pdb:%t.pdb6// RUN: %lldb -f %t.exe -s \7// RUN: %p/Inputs/ast-methods.lldbinit 2>&1 | FileCheck %s --check-prefix=AST8 9// RUN: lldb-test symbols --dump-ast %t.exe | FileCheck %s --check-prefix=SYMBOL10 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('a');31 s.overloaded_method('a', 1);32 return 0;33}34 35// AST: TranslationUnitDecl36// AST: |-CXXRecordDecl {{.*}} struct Struct definition37// AST: | |-CXXMethodDecl {{.*}} simple_method 'void (){{.*}}'38// AST: | |-CXXMethodDecl {{.*}} virtual_method 'void (){{.*}}' virtual39// AST: | |-CXXMethodDecl {{.*}} static_method 'void ()' static40// 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: struct Struct {48// SYMBOL-NEXT: void simple_method();49// SYMBOL-NEXT: static void static_method();50// SYMBOL-NEXT: virtual void virtual_method();51// SYMBOL-NEXT: int overloaded_method();52// SYMBOL-NEXT: int overloaded_method(char);53// SYMBOL-NEXT: int overloaded_method(char, int, ...);54// SYMBOL-NEXT: };55// SYMBOL-NEXT: Struct s;56// SYMBOL-NEXT: int main(int argc, char **argv);57