diff options
Diffstat (limited to 'test/example/cpp-unit.cpp')
-rw-r--r-- | test/example/cpp-unit.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/example/cpp-unit.cpp b/test/example/cpp-unit.cpp index d2339f030..e3e1269c3 100644 --- a/test/example/cpp-unit.cpp +++ b/test/example/cpp-unit.cpp @@ -637,6 +637,19 @@ void test_effects() { assert_equal(effects.readsMutableStruct, false); assert_equal(effects.writesStruct, false); } + + { + EffectAnalyzer effects(options, module); + + // If we break, then we transfer control flow. + effects.breakTargets.insert("block"); + assert_equal(effects.transfersControlFlow(), true); + + // Repeated walks accumulate effects, that is, old effects are not + // removed. + effects.walk(&nop); + assert_equal(effects.transfersControlFlow(), true); + } } void test_field() { |