1 | volatile int x; |
2 | |
3 | void __attribute__((noinline)) sink() { |
4 | x++; //% self.filecheck("finish", "main.cpp", "-implicit-check-not=artificial") |
5 | // CHECK: stop reason = step out |
6 | // CHECK-NEXT: Stepped out past: frame #1: 0x{{[0-9a-f]+}} a.out`func3{{.*}} [artificial] |
7 | // CHECK: frame #0: 0x{{[0-9a-f]+}} a.out`func2{{.*}} |
8 | } |
9 | |
10 | void __attribute__((noinline)) func3() { sink(); /* tail */ } |
11 | |
12 | void __attribute__((disable_tail_calls, noinline)) func2() { func3(); /* regular */ } |
13 | |
14 | void __attribute__((noinline)) func1() { func2(); /* tail */ } |
15 | |
16 | int __attribute__((disable_tail_calls)) main() { |
17 | func1(); /* regular */ |
18 | return 0; |
19 | } |
20 | |