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_build %s -o %t
9 // RUN: %dexter_regression_test_run --binary %t -- %s | FileCheck %s
10 // CHECK: expect_program_state.cpp:
11 
GCD(int lhs,int rhs)12 int GCD(int lhs, int rhs)
13 {
14     if (rhs == 0)
15         return lhs; // DexLabel('check')
16     return GCD(rhs, lhs % rhs);
17 }
18 
main()19 int main()
20 {
21     return GCD(111, 259);
22 }
23 
24 /*
25 DexExpectProgramState({
26     'frames': [
27         {
28             'location': {
29                 'lineno': ref('check')
30             },
31             'watches': {
32                 'lhs': '37', 'rhs': '0'
33             }
34         },
35         {
36             'watches': {
37                 'lhs': {'value': '111'}, 'rhs': {'value': '37'}
38             }
39         },
40         {
41             'watches': {
42                 'lhs': {'value': '259'}, 'rhs': {'value': '111'}
43             }
44         },
45         {
46             'watches': {
47                 'lhs': {'value': '111'}, 'rhs': {'value': '259'}
48             }
49         }
50     ]
51 })
52 */
53