1 // clang-format off
2 // REQUIRES: lld, system-windows
3
4 // RUN: %build --compiler=clang-cl --nodefaultlib -o %t.exe -- %s
5 // RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
6 // RUN: %p/Inputs/stack_unwinding01.lldbinit 2>&1 | FileCheck %s
7
8
9 struct Struct {
simple_methodStruct10 void simple_method(int a, int b) {
11 a += 1;
12 simple_method(a, b);
13 }
14 };
15
16
17
main(int argc,char ** argv)18 int main(int argc, char **argv) {
19 Struct s;
20 s.simple_method(1,2);
21 return 0;
22 }
23
24
25 // CHECK: (lldb) thread backtrace
26 // CHECK-NEXT: * thread #1, stop reason = breakpoint 1.1
27 // CHECK-NEXT: * frame #0: {{.*}} stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
28 // CHECK-NEXT: frame #1: {{.*}} stack_unwinding01.cpp.tmp.exe`main(argc={{.*}}, argv={{.*}}) at stack_unwinding01.cpp:20
29
30
31 // CHECK: (lldb) thread backtrace
32 // CHECK-NEXT: * thread #1, stop reason = breakpoint 1.1
33 // CHECK-NEXT: * frame #0: {{.*}} stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
34 // CHECK-NEXT: frame #1: {{.*}} stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
35 // CHECK-NEXT: frame #2: {{.*}} stack_unwinding01.cpp.tmp.exe`main(argc={{.*}}, argv={{.*}}) at stack_unwinding01.cpp:20
36
37 // CHECK: (lldb) thread backtrace
38 // CHECK-NEXT: * thread #1, stop reason = breakpoint 1.1
39 // CHECK-NEXT: * frame #0: {{.*}} stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
40 // CHECK-NEXT: frame #1: {{.*}} stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
41 // CHECK-NEXT: frame #2: {{.*}} stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
42 // CHECK-NEXT: frame #3: {{.*}} stack_unwinding01.cpp.tmp.exe`main(argc={{.*}}, argv={{.*}}) at stack_unwinding01.cpp:20
43