1 | // Purpose: |
2 | // Ensure that multiple overlapping \DexLimitSteps ranges do not interfere. |
3 | // |
4 | // RUN: %dexter_regression_test_build %s -o %t |
5 | // RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s |
6 | // CHECK: limit_steps_overlapping_ranges.cpp |
7 | |
8 | int main() { |
9 | int val1; |
10 | int val2; |
11 | int placeholder; |
12 | for (int ix = 0; ix != 10; ++ix) { |
13 | placeholder=val1+val2; // DexLabel('from') |
14 | if (ix == 0) { |
15 | val1 = ix; |
16 | val2 = ix; // DexLabel('val1_check') |
17 | placeholder=val1+val2; // DexLabel('val1_check_to') |
18 | } |
19 | else if (ix == 2) { |
20 | val2 = ix; |
21 | val1 = ix; // DexLabel('val2_check') |
22 | placeholder=val1+val2; // DexLabel('val2_check_to') |
23 | } |
24 | placeholder=val1+val2; // DexLabel('to') |
25 | } |
26 | return val1 + val2; |
27 | } |
28 | |
29 | // DexExpectWatchValue('ix', 0, 2, 5, from_line=ref('from'), to_line=ref('to')) |
30 | // DexExpectWatchValue('val1', 0, from_line=ref('val1_check'), to_line=ref('val1_check_to')) |
31 | // DexExpectWatchValue('val2', 2, from_line=ref('val2_check'), to_line=ref('val2_check_to')) |
32 | |
33 | // DexLimitSteps('ix', 5, from_line=ref('from'), to_line=ref('to')) |
34 | // DexLimitSteps('val1', 0, from_line=ref('val1_check'), to_line=ref('val1_check_to')) |
35 | // DexLimitSteps('val2', 2, from_line=ref('val2_check'), to_line=ref('val2_check_to')) |
36 | |