1 | volatile int x; |
2 | |
3 | void __attribute__((noinline)) sink() { |
4 | x++; //% self.filecheck("bt", "main.cpp", "-implicit-check-not=artificial") |
5 | // CHECK: frame #0: 0x{{[0-9a-f]+}} a.out`sink() at main.cpp:[[@LINE-1]]:4 |
6 | // CHECK-NEXT: func2{{.*}} [artificial] |
7 | // CHECK-NEXT: main{{.*}} |
8 | } |
9 | |
10 | void __attribute__((noinline)) func2() { |
11 | sink(); /* tail */ |
12 | } |
13 | |
14 | void __attribute__((noinline)) func1() { sink(); /* tail */ } |
15 | |
16 | int __attribute__((disable_tail_calls)) main(int argc, char **) { |
17 | // The sequences `main -> f{1,2} -> sink` are both plausible. Test that |
18 | // return-pc call site info allows lldb to pick the correct sequence. |
19 | func2(); |
20 | if (argc == 100) |
21 | func1(); |
22 | return 0; |
23 | } |
24 | |