1volatile int x;
2
3void __attribute__((noinline)) sink() {
4 x++; //% self.filecheck("bt", "main.cpp")
5 // CHECK-NOT: func{{[23]}}_amb
6}
7
8void __attribute__((noinline)) func3_amb() { sink(); /* tail */ }
9
10void __attribute__((noinline)) func2_amb() { sink(); /* tail */ }
11
12void __attribute__((noinline)) func1() {
13 if (x > 0)
14 func2_amb(); /* tail */
15 else
16 func3_amb(); /* tail */
17}
18
19int __attribute__((disable_tail_calls)) main(int argc, char **) {
20 // The sequences `main -> func1 -> f{2,3}_amb -> sink` are both plausible. Test
21 // that lldb doesn't attempt to guess which one occurred.
22 func1();
23 return 0;
24}
25

source code of lldb/test/API/functionalities/tail_call_frames/ambiguous_tail_call_seq1/main.cpp