rust/tests/coverage/branch_generics.rs

20 lines
341 B
Rust

#![feature(coverage_attribute)]
//@ edition: 2021
//@ 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>();
}