diff options
Diffstat (limited to 'debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp')
-rw-r--r-- | debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp b/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp new file mode 100644 index 00000000000..2d7c202f407 --- /dev/null +++ b/debuginfo-tests/dexter/feature_tests/commands/penalty/expect_program_state.cpp @@ -0,0 +1,37 @@ +// Purpose: +// Check that \DexExpectProgramState correctly applies a penalty when +// an expected program state is never found. +// +// REQUIRES: system-linux, lldb +// +// RUN: not %dexter test --fail-lt 1.0 -w \ +// RUN: --builder 'clang' --debugger 'lldb' --cflags "-O0 -glldb" -- %s \ +// RUN: | FileCheck %s +// CHECK: expect_program_state.cpp: + +int GCD(int lhs, int rhs) +{ + if (rhs == 0) // DexLabel('check') + return lhs; + return GCD(rhs, lhs % rhs); +} + +int main() +{ + return GCD(111, 259); +} + +/* +DexExpectProgramState({ + 'frames': [ + { + 'location': { + 'lineno': 'check' + }, + 'watches': { + 'lhs': '0', 'rhs': '0' + } + }, + ] +}) +*/ |