| 1 | volatile int x; |
|---|---|
| 2 | |
| 3 | void __attribute__((noinline)) sink() { |
| 4 | x++; //% self.filecheck("bt", "main.cpp") |
| 5 | // CHECK-NOT: func{{[23]}} |
| 6 | } |
| 7 | |
| 8 | void func2(); |
| 9 | |
| 10 | void __attribute__((noinline)) func1() { |
| 11 | if (x < 1) |
| 12 | func2(); |
| 13 | else |
| 14 | sink(); |
| 15 | } |
| 16 | |
| 17 | void __attribute__((noinline)) func2() { |
| 18 | if (x < 1) |
| 19 | sink(); |
| 20 | else |
| 21 | func1(); |
| 22 | } |
| 23 | |
| 24 | int main() { |
| 25 | // Tail recursion creates ambiguous execution histories. |
| 26 | x = 0; |
| 27 | func1(); |
| 28 | return 0; |
| 29 | } |
| 30 |
