1// clang-format off
2// REQUIRES: lld, x86
3
4// RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -c /Fo%t.obj -- %s
5// RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe -pdb:%t.pdb
6
7// RUN: %lldb -f %t.exe -s %p/Inputs/ast-functions.lldbinit 2>&1 | FileCheck %s
8
9static int static_fn() {
10 return 42;
11}
12
13int varargs_fn(int x, int y, ...) {
14 return x + y;
15}
16
17int main(int argc, char **argv) {
18 return static_fn() + varargs_fn(x: argc, y: argc);
19}
20
21// CHECK: TranslationUnitDecl
22// CHECK-NEXT: |-FunctionDecl {{.*}} main 'int (int, char **)'
23// CHECK-NEXT: | |-ParmVarDecl {{.*}} argc 'int'
24// CHECK-NEXT: | `-ParmVarDecl {{.*}} argv 'char **'
25// CHECK-NEXT: |-FunctionDecl {{.*}} static_fn 'int ()' static
26// CHECK-NEXT: `-FunctionDecl {{.*}} varargs_fn 'int (int, int, ...)'
27// CHECK-NEXT: |-ParmVarDecl {{.*}} x 'int'
28// CHECK-NEXT: `-ParmVarDecl {{.*}} y 'int'
29

Provided by KDAB

Privacy Policy
Improve your Profiling and Debugging skills
Find out more

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