| 1 | // Purpose: |
| 2 | // Test that a \DexDeclareAddress command can be passed 'hit_count' as an |
| 3 | // optional keyword argument that captures the value of the given |
| 4 | // expression after the target line has been stepped on a given number of |
| 5 | // times. |
| 6 | // |
| 7 | // RUN: %dexter_regression_test_cxx_build %s -o %t |
| 8 | // RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s |
| 9 | // CHECK: address_hit_count.cpp |
| 10 | |
| 11 | int main() { |
| 12 | int *x = new int[3]; |
| 13 | for (int *y = x; y < x + 3; ++y) |
| 14 | *y = 0; // DexLabel('test_line') |
| 15 | delete x; |
| 16 | } |
| 17 | |
| 18 | // DexDeclareAddress('y', 'y', on_line=ref('test_line'), hit_count=2) |
| 19 | // DexExpectWatchValue('y', address('y', -8), address('y', -4), address('y'), on_line=ref('test_line')) |
| 20 | |