diff options
Diffstat (limited to 'tests/coverage/branch_if.rs')
| -rw-r--r-- | tests/coverage/branch_if.rs | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/tests/coverage/branch_if.rs b/tests/coverage/branch_if.rs deleted file mode 100644 index 151eede75bb..00000000000 --- a/tests/coverage/branch_if.rs +++ /dev/null @@ -1,81 +0,0 @@ -#![feature(coverage_attribute)] -//@ edition: 2021 -//@ compile-flags: -Zcoverage-options=branch -//@ llvm-cov-flags: --show-branches=count - -macro_rules! no_merge { - () => { - for _ in 0..1 {} - }; -} - -fn branch_not(a: bool) { - no_merge!(); - - if a { - say("a") - } - if !a { - say("not a"); - } - if !!a { - say("not not a"); - } - if !!!a { - say("not not not a"); - } -} - -fn branch_not_as(a: bool) { - no_merge!(); - - if !(a as bool) { - say("not (a as bool)"); - } - if !!(a as bool) { - say("not not (a as bool)"); - } - if !!!(a as bool) { - say("not not (a as bool)"); - } -} - -fn branch_and(a: bool, b: bool) { - no_merge!(); - - if a && b { - say("both"); - } else { - say("not both"); - } -} - -fn branch_or(a: bool, b: bool) { - no_merge!(); - - if a || b { - say("either"); - } else { - say("neither"); - } -} - -#[coverage(off)] -fn say(message: &str) { - core::hint::black_box(message); -} - -#[coverage(off)] -fn main() { - for a in [false, true, true] { - branch_not(a); - branch_not_as(a); - } - - for a in [false, true, true, true, true] { - for b in [false, true, true] { - branch_and(a, b); - branch_or(a, b); - } - } -} |
