1 | // Purpose: |
2 | // Check that \DexExpectStepKind correctly handles recursive calls. |
3 | // Specifically, ensure recursive calls count towards 'FUNC' and not |
4 | // 'VERTICAL_BACKWARD'. |
5 | // |
6 | // UNSUPPORTED: system-darwin |
7 | // |
8 | // RUN: %dexter_regression_test_build %s -o %t |
9 | // RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s |
10 | // CHECK: recursive.cpp: |
11 | |
12 | int func(int i) { |
13 | if (i > 1) |
14 | return i + func(i: i - 1); |
15 | return i; |
16 | } |
17 | |
18 | int main() |
19 | { |
20 | return func(i: 3); |
21 | } |
22 | |
23 | // main, func, func, func |
24 | // DexExpectStepKind('FUNC', 4) |
25 | // DexExpectStepKind('VERTICAL_BACKWARD', 0) |
26 | |