coverage: Add a test that uses #[bench]

This commit is contained in:
Zalathar 2024-01-21 12:18:48 +11:00
parent cb25c5bc3d
commit bdfc64ac98
3 changed files with 33 additions and 0 deletions

View file

@ -0,0 +1,16 @@
Function name: bench::my_bench
Raw bytes (9): 0x[01, 01, 00, 01, 01, 08, 01, 00, 27]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 39)
Function name: bench::my_bench::{closure#0}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 07, 01, 00, 09]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 7, 1) to (start + 0, 9)

View file

@ -0,0 +1,9 @@
LL| |#![feature(test)]
LL| |// edition: 2021
LL| |// compile-flags: --test
LL| |
LL| |extern crate test;
LL| |
LL| 1|#[bench]
LL| 1|fn my_bench(_b: &mut test::Bencher) {}

8
tests/coverage/bench.rs Normal file
View file

@ -0,0 +1,8 @@
#![feature(test)]
// edition: 2021
// compile-flags: --test
extern crate test;
#[bench]
fn my_bench(_b: &mut test::Bencher) {}