| 1 | // Purpose: |
| 2 | // Check that \DexExpectWatchValue applies no penalties when expected |
| 3 | // values are found. |
| 4 | // |
| 5 | // UNSUPPORTED: system-darwin |
| 6 | // |
| 7 | // RUN: %dexter_regression_test_cxx_build %s -o %t |
| 8 | // RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s |
| 9 | // CHECK: expect_watch_value.cpp: |
| 10 | |
| 11 | unsigned long Factorial(int n) { |
| 12 | volatile unsigned long fac = 1; // DexLabel('entry') |
| 13 | |
| 14 | for (int i = 1; i <= n; ++i) |
| 15 | fac *= i; // DexLabel('loop') |
| 16 | |
| 17 | return fac; // DexLabel('ret') |
| 18 | } |
| 19 | |
| 20 | int main() |
| 21 | { |
| 22 | return Factorial(n: 8); |
| 23 | } |
| 24 | |
| 25 | /* |
| 26 | DexExpectWatchValue('n', '8', on_line=ref('entry')) |
| 27 | DexExpectWatchValue('i', |
| 28 | '1', '2', '3', '4', '5', '6', '7', '8', |
| 29 | on_line=ref('loop')) |
| 30 | |
| 31 | DexExpectWatchValue('fac', |
| 32 | '1', '2', '6', '24', '120', '720', '5040', |
| 33 | on_line=ref('loop')) |
| 34 | |
| 35 | DexExpectWatchValue('n', '8', on_line=ref('loop')) |
| 36 | DexExpectWatchValue('fac', '40320', on_line=ref('ret')) |
| 37 | DexExpectWatchValue('n', '8', on_line=ref('ret')) |
| 38 | */ |
| 39 | |