1 // clang-format off
2 // REQUIRES: lld, x86
3 
4 // Test that we can set display source of functions.
5 // RUN: %clang_cl --target=x86_64-windows-msvc -Od -Z7 -c /Fo%t.obj -- %s
6 // RUN: lld-link -debug:full -nodefaultlib -entry:main %t.obj -out:%t.exe -pdb:%t.pdb
7 // RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
8 // RUN:     %p/Inputs/source-list.lldbinit | FileCheck %s
9 
10 
11 // Some context lines before
12 // the function.
13 
14 
main(int argc,char ** argv)15 int main(int argc, char **argv) {
16   // Here are some comments.
17   // That we should print when listing source.
18   return 0;
19 }
20 
21 // Some context lines after
22 // the function.
23 
24 // check lines go at the end so that line numbers stay stable when
25 // changing this file.
26 
27 // CHECK: (lldb) source list -n main
28 // CHECK: File: {{.*}}source-list.cpp
29 // CHECK:    10
30 // CHECK:    11    // Some context lines before
31 // CHECK:    12   // the function.
32 // CHECK:    13
33 // CHECK:    14
34 // CHECK:    15   int main(int argc, char **argv) {
35 // CHECK:    16     // Here are some comments.
36 // CHECK:    17     // That we should print when listing source.
37 // CHECK:    18     return 0;
38 // CHECK:    19   }
39 // CHECK:    20
40 // CHECK:    21   // Some context lines after
41 // CHECK:    22   // the function.
42 // CHECK:    23
43