| 1 | // Purpose: |
| 2 | // Test that a \DexDeclareAddress value can be used to compare two pointer |
| 3 | // variables that have a fixed offset between them. |
| 4 | // |
| 5 | // RUN: %dexter_regression_test_cxx_build %s -o %t |
| 6 | // RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s |
| 7 | // CHECK: offset_address.cpp |
| 8 | |
| 9 | int main() { |
| 10 | int *x = new int[5]; |
| 11 | int *y = x + 3; |
| 12 | delete x; // DexLabel('test_line') |
| 13 | } |
| 14 | |
| 15 | // DexDeclareAddress('x', 'x', on_line=ref('test_line')) |
| 16 | // DexExpectWatchValue('x', address('x'), on_line=ref('test_line')) |
| 17 | // DexExpectWatchValue('y', address('x', 12), on_line=ref('test_line')) |
| 18 | |