| 1 | // Purpose: |
| 2 | // Check that \DexExpectStepKind correctly counts 'VERTICAL_BACKWARD' steps |
| 3 | // for a trivial test. Expect one 'VERTICAL_BACKWARD' for every step onto |
| 4 | // a lesser source line number in the same function. Expect one |
| 5 | // 'VERTICAL_FORWARD' for every step onto a greater source line number in |
| 6 | // the same function. |
| 7 | // |
| 8 | // UNSUPPORTED: system-darwin |
| 9 | // |
| 10 | // TODO: The dbgeng debugger does not support column step reporting at present. |
| 11 | // XFAIL: system-windows |
| 12 | // |
| 13 | // RUN: %dexter_regression_test_cxx_build %s -o %t |
| 14 | // RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s |
| 15 | // CHECK: direction.cpp: |
| 16 | |
| 17 | int func(int i) { |
| 18 | return i; // step 7, 9, 11 |
| 19 | } |
| 20 | |
| 21 | int main() |
| 22 | { |
| 23 | for (int i = 0; i < 2; ++i) { // step 1: FUNC, step 3, 5: VERTICAL_BACKWARD |
| 24 | i = i; // step 2, 4: VERTICAL_FORWARD |
| 25 | } |
| 26 | // ---------1 - step 6: VERTICAL_FORWARD |
| 27 | // ---------|---------2 - step 8: HORIZONTAL_FORWARD |
| 28 | // ----3----|---------| - step 10: HORIZONTAL_BACKWARD |
| 29 | return func(i: func(i: 0) + func(i: 1)); |
| 30 | } |
| 31 | |
| 32 | // DexExpectStepKind('VERTICAL_BACKWARD', 2) |
| 33 | // DexExpectStepKind('VERTICAL_FORWARD', 3) |
| 34 | // DexExpectStepKind('HORIZONTAL_FORWARD', 1) |
| 35 | // DexExpectStepKind('HORIZONTAL_BACKWARD', 1) |
| 36 | |