| 1 | // Purpose: |
| 2 | // Test that a \DexDeclareAddress value can have its value defined after |
| 3 | // the first reference to that value. |
| 4 | // |
| 5 | // RUN: %dexter_regression_test_cxx_build %s -o %t |
| 6 | // RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s |
| 7 | // CHECK: address_after_ref.cpp |
| 8 | |
| 9 | int main() { |
| 10 | int *x = new int(5); |
| 11 | int *y = x; // DexLabel('first_line') |
| 12 | delete x; // DexLabel('last_line') |
| 13 | } |
| 14 | |
| 15 | // DexDeclareAddress('y', 'y', on_line=ref('last_line')) |
| 16 | // DexExpectWatchValue('x', address('y'), on_line=ref('first_line')) |
| 17 | |