about summary refs log tree commit diff
path: root/tests/coverage/branch/generics.rs
blob: 24bfdaaa687e18144490d405ae38f46666183e6e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//@ edition: 2021
//@ compile-flags: -Zcoverage-options=branch
//@ llvm-cov-flags: --show-branches=count

fn print_size<T>() {
    if std::mem::size_of::<T>() > 4 {
        println!("size > 4");
    } else {
        println!("size <= 4");
    }
}

#[coverage(off)]
fn main() {
    print_size::<()>();
    print_size::<u32>();
    print_size::<u64>();
}