1// Purpose:
2// Check that \DexExpectProgramState correctly applies a penalty when
3// an expected program state is never found.
4//
5// UNSUPPORTED: system-darwin
6//
7// RUN: %dexter_regression_test_build %s -o %t
8// RUN: not %dexter_regression_test_run --binary %t -- %s | FileCheck %s
9// CHECK: expect_program_state.cpp:
10
11int GCD(int lhs, int rhs)
12{
13 if (rhs == 0) // DexLabel('check')
14 return lhs;
15 return GCD(lhs: rhs, rhs: lhs % rhs);
16}
17
18int main()
19{
20 return GCD(lhs: 111, rhs: 259);
21}
22
23/*
24DexExpectProgramState({
25 'frames': [
26 {
27 'location': {
28 'lineno': ref('check')
29 },
30 'watches': {
31 'lhs': '0', 'rhs': '0'
32 }
33 },
34 ]
35})
36*/
37

source code of cross-project-tests/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp