1 | volatile int x; |
2 | |
3 | void __attribute__((noinline)) sink() { |
4 | x++; //% self.filecheck("bt", "main.cpp") |
5 | // CHECK-NOT: func{{[23]}}_amb |
6 | } |
7 | |
8 | void __attribute__((noinline)) func3_amb() { sink(); /* tail */ } |
9 | |
10 | void __attribute__((noinline)) func2_amb() { sink(); /* tail */ } |
11 | |
12 | void __attribute__((noinline)) func1() { |
13 | if (x > 0) |
14 | func2_amb(); /* tail */ |
15 | else |
16 | func3_amb(); /* tail */ |
17 | } |
18 | |
19 | int __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 | |