1 // Purpose:
2 // Check that \DexExpectWatchValue applies no penalties when expected
3 // program states are found.
4 //
5 // UNSUPPORTED: system-darwin
6 //
7 //
8 // RUN: %dexter_regression_test -- %s | FileCheck %s
9 // CHECK: expect_program_state.cpp:
10
GCD(int lhs,int rhs)11 int GCD(int lhs, int rhs)
12 {
13 if (rhs == 0)
14 return lhs; // DexLabel('check')
15 return GCD(rhs, lhs % rhs);
16 }
17
main()18 int main()
19 {
20 return GCD(111, 259);
21 }
22
23 /*
24 DexExpectProgramState({
25 'frames': [
26 {
27 'location': {
28 'lineno': 'check'
29 },
30 'watches': {
31 'lhs': '37', 'rhs': '0'
32 }
33 },
34 {
35 'watches': {
36 'lhs': {'value': '111'}, 'rhs': {'value': '37'}
37 }
38 },
39 {
40 'watches': {
41 'lhs': {'value': '259'}, 'rhs': {'value': '111'}
42 }
43 },
44 {
45 'watches': {
46 'lhs': {'value': '111'}, 'rhs': {'value': '259'}
47 }
48 }
49 ]
50 })
51 */
52