• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
8 // RUN:     %p/Inputs/ast-functions.lldbinit 2>&1 | FileCheck %s
9 
static_fn()10 static int static_fn() {
11   return 42;
12 }
13 
varargs_fn(int x,int y,...)14 int varargs_fn(int x, int y, ...) {
15   return x + y;
16 }
17 
main(int argc,char ** argv)18 int main(int argc, char **argv) {
19   return static_fn() + varargs_fn(argc, argc);
20 }
21 
22 // CHECK:      TranslationUnitDecl
23 // CHECK-NEXT: |-FunctionDecl {{.*}} main 'int (int, char **)'
24 // CHECK-NEXT: | |-ParmVarDecl {{.*}} argc 'int'
25 // CHECK-NEXT: | `-ParmVarDecl {{.*}} argv 'char **'
26 // CHECK-NEXT: |-FunctionDecl {{.*}} static_fn 'int ()' static
27 // CHECK-NEXT: `-FunctionDecl {{.*}} varargs_fn 'int (int, int, ...)'
28 // CHECK-NEXT:   |-ParmVarDecl {{.*}} x 'int'
29 // CHECK-NEXT:   `-ParmVarDecl {{.*}} y 'int'
30