xref: /llvm-project/lldb/test/Shell/SymbolFile/NativePDB/ast-functions.cpp (revision cf3464bbb796d492bcd4e764ada945304e0c874f)
187aa9c9eSJonas Devlieghere // clang-format off
2eb50b643SPavel Labath // REQUIRES: lld, x86
387aa9c9eSJonas Devlieghere 
4eb50b643SPavel Labath // RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -c /Fo%t.obj -- %s
5eb50b643SPavel Labath // RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe -pdb:%t.pdb
687aa9c9eSJonas Devlieghere 
7*cf3464bbSJonas Devlieghere // RUN: %lldb -f %t.exe -s %p/Inputs/ast-functions.lldbinit 2>&1 | FileCheck %s
887aa9c9eSJonas Devlieghere 
987aa9c9eSJonas Devlieghere static int static_fn() {
1087aa9c9eSJonas Devlieghere   return 42;
1187aa9c9eSJonas Devlieghere }
1287aa9c9eSJonas Devlieghere 
1387aa9c9eSJonas Devlieghere int varargs_fn(int x, int y, ...) {
1487aa9c9eSJonas Devlieghere   return x + y;
1587aa9c9eSJonas Devlieghere }
1687aa9c9eSJonas Devlieghere 
1787aa9c9eSJonas Devlieghere int main(int argc, char **argv) {
1887aa9c9eSJonas Devlieghere   return static_fn() + varargs_fn(argc, argc);
1987aa9c9eSJonas Devlieghere }
2087aa9c9eSJonas Devlieghere 
2187aa9c9eSJonas Devlieghere // CHECK:      TranslationUnitDecl
2287aa9c9eSJonas Devlieghere // CHECK-NEXT: |-FunctionDecl {{.*}} main 'int (int, char **)'
2387aa9c9eSJonas Devlieghere // CHECK-NEXT: | |-ParmVarDecl {{.*}} argc 'int'
2487aa9c9eSJonas Devlieghere // CHECK-NEXT: | `-ParmVarDecl {{.*}} argv 'char **'
2587aa9c9eSJonas Devlieghere // CHECK-NEXT: |-FunctionDecl {{.*}} static_fn 'int ()' static
2687aa9c9eSJonas Devlieghere // CHECK-NEXT: `-FunctionDecl {{.*}} varargs_fn 'int (int, int, ...)'
2787aa9c9eSJonas Devlieghere // CHECK-NEXT:   |-ParmVarDecl {{.*}} x 'int'
2887aa9c9eSJonas Devlieghere // CHECK-NEXT:   `-ParmVarDecl {{.*}} y 'int'
29