Skip to content

Commit

Permalink
coverage: Format all remaining tests
Browse files Browse the repository at this point in the history
These tests can simply be reformatted as normal, because the resulting changes
are unimportant.
  • Loading branch information
Zalathar committed Jan 16, 2024
1 parent 6fb99c6 commit 12932f4
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 46 deletions.
12 changes: 6 additions & 6 deletions tests/coverage/closure_macro.cov-map
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Function name: closure_macro::load_configuration_files
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1d, 01, 02, 02]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 1e, 01, 02, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 29, 1) to (start + 2, 2)
- Code(Counter(0)) at (prev + 30, 1) to (start + 2, 2)

Function name: closure_macro::main
Raw bytes (43): 0x[01, 01, 02, 01, 05, 05, 02, 07, 01, 21, 01, 01, 21, 02, 02, 09, 00, 0f, 05, 00, 12, 00, 13, 02, 00, 12, 00, 13, 05, 00, 54, 00, 55, 02, 02, 09, 02, 0b, 07, 03, 01, 00, 02]
Raw bytes (43): 0x[01, 01, 02, 01, 05, 05, 02, 07, 01, 22, 01, 01, 21, 02, 02, 09, 00, 0f, 05, 00, 12, 00, 13, 02, 00, 12, 00, 13, 05, 00, 54, 00, 55, 02, 02, 09, 02, 0b, 07, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
- expression 1 operands: lhs = Counter(1), rhs = Expression(0, Sub)
Number of file 0 mappings: 7
- Code(Counter(0)) at (prev + 33, 1) to (start + 1, 33)
- Code(Counter(0)) at (prev + 34, 1) to (start + 1, 33)
- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 15)
= (c0 - c1)
- Code(Counter(1)) at (prev + 0, 18) to (start + 0, 19)
Expand All @@ -27,10 +27,10 @@ Number of file 0 mappings: 7
= (c1 + (c0 - c1))

Function name: closure_macro::main::{closure#0}
Raw bytes (9): 0x[01, 01, 00, 01, 01, 23, 12, 00, 54]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 24, 12, 00, 54]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 35, 18) to (start + 0, 84)
- Code(Counter(0)) at (prev + 36, 18) to (start + 0, 84)

5 changes: 3 additions & 2 deletions tests/coverage/closure_macro.coverage
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
LL| |// compile-flags: --edition=2018
LL| |#![feature(coverage_attribute)]
LL| |// edition: 2018
LL| |
LL| |macro_rules! bail {
LL| | ($msg:literal $(,)?) => {
Expand All @@ -14,7 +14,8 @@
LL| |
LL| |macro_rules! on_error {
LL| | ($value:expr, $error_message:expr) => {
LL| | $value.or_else(|e| { // FIXME(85000): no coverage in closure macros
LL| | $value.or_else(|e| {
LL| | // FIXME(85000): no coverage in closure macros
LL| | let message = format!($error_message, e);
LL| | if message.len() > 0 {
LL| | println!("{}", message);
Expand Down
5 changes: 3 additions & 2 deletions tests/coverage/closure_macro.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// compile-flags: --edition=2018
#![feature(coverage_attribute)]
// edition: 2018

macro_rules! bail {
($msg:literal $(,)?) => {
Expand All @@ -14,7 +14,8 @@ macro_rules! bail {

macro_rules! on_error {
($value:expr, $error_message:expr) => {
$value.or_else(|e| { // FIXME(85000): no coverage in closure macros
$value.or_else(|e| {
// FIXME(85000): no coverage in closure macros
let message = format!($error_message, e);
if message.len() > 0 {
println!("{}", message);
Expand Down
16 changes: 8 additions & 8 deletions tests/coverage/coroutine.cov-map
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Function name: coroutine::get_u32
Raw bytes (28): 0x[01, 01, 02, 01, 05, 05, 02, 04, 01, 0b, 01, 01, 0b, 05, 01, 0e, 00, 13, 02, 00, 1d, 00, 3c, 07, 01, 01, 00, 02]
Raw bytes (28): 0x[01, 01, 02, 01, 05, 05, 02, 04, 01, 0b, 01, 01, 0b, 05, 02, 09, 00, 0e, 02, 02, 09, 00, 28, 07, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
- expression 1 operands: lhs = Counter(1), rhs = Expression(0, Sub)
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 11, 1) to (start + 1, 11)
- Code(Counter(1)) at (prev + 1, 14) to (start + 0, 19)
- Code(Expression(0, Sub)) at (prev + 0, 29) to (start + 0, 60)
- Code(Counter(1)) at (prev + 2, 9) to (start + 0, 14)
- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 40)
= (c0 - c1)
- Code(Expression(1, Add)) at (prev + 1, 1) to (start + 0, 2)
- Code(Expression(1, Add)) at (prev + 2, 1) to (start + 0, 2)
= (c1 + (c0 - c1))

Function name: coroutine::main
Raw bytes (65): 0x[01, 01, 08, 07, 0d, 05, 09, 11, 15, 1e, 19, 11, 15, 15, 19, 1e, 19, 11, 15, 09, 01, 0f, 01, 02, 16, 01, 07, 0b, 00, 2e, 11, 01, 2b, 00, 2d, 03, 01, 0e, 00, 35, 11, 02, 0b, 00, 2e, 1e, 01, 22, 00, 27, 1a, 00, 2c, 00, 2e, 17, 01, 0e, 00, 35, 1a, 02, 01, 00, 02]
Raw bytes (65): 0x[01, 01, 08, 07, 0d, 05, 09, 11, 15, 1e, 19, 11, 15, 15, 19, 1e, 19, 11, 15, 09, 01, 13, 01, 02, 16, 01, 07, 0b, 00, 2e, 11, 01, 2b, 00, 2d, 03, 01, 0e, 00, 35, 11, 02, 0b, 00, 2e, 1e, 01, 22, 00, 27, 1a, 00, 2c, 00, 2e, 17, 01, 0e, 00, 35, 1a, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 8
Expand All @@ -27,7 +27,7 @@ Number of expressions: 8
- expression 6 operands: lhs = Expression(7, Sub), rhs = Counter(6)
- expression 7 operands: lhs = Counter(4), rhs = Counter(5)
Number of file 0 mappings: 9
- Code(Counter(0)) at (prev + 15, 1) to (start + 2, 22)
- Code(Counter(0)) at (prev + 19, 1) to (start + 2, 22)
- Code(Counter(0)) at (prev + 7, 11) to (start + 0, 46)
- Code(Counter(4)) at (prev + 1, 43) to (start + 0, 45)
- Code(Expression(0, Add)) at (prev + 1, 14) to (start + 0, 53)
Expand All @@ -43,11 +43,11 @@ Number of file 0 mappings: 9
= ((c4 - c5) - c6)

Function name: coroutine::main::{closure#0}
Raw bytes (14): 0x[01, 01, 00, 02, 01, 11, 1c, 01, 1f, 05, 02, 10, 01, 06]
Raw bytes (14): 0x[01, 01, 00, 02, 01, 15, 1c, 01, 1f, 05, 02, 10, 01, 06]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 2
- Code(Counter(0)) at (prev + 17, 28) to (start + 1, 31)
- Code(Counter(0)) at (prev + 21, 28) to (start + 1, 31)
- Code(Counter(1)) at (prev + 2, 16) to (start + 1, 6)

7 changes: 5 additions & 2 deletions tests/coverage/coroutine.coverage
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
LL| |// drop all `Counter` `Coverage` statements from a MIR. `simplify.rs` has logic
LL| |// to handle this condition, and still report dead block coverage.
LL| 1|fn get_u32(val: bool) -> Result<u32, String> {
LL| 1| if val { Ok(1) } else { Err(String::from("some error")) }
^0
LL| 1| if val {
LL| 1| Ok(1)
LL| | } else {
LL| 0| Err(String::from("some error"))
LL| | }
LL| 1|}
LL| |
LL| 1|fn main() {
Expand Down
6 changes: 5 additions & 1 deletion tests/coverage/coroutine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ use std::pin::Pin;
// drop all `Counter` `Coverage` statements from a MIR. `simplify.rs` has logic
// to handle this condition, and still report dead block coverage.
fn get_u32(val: bool) -> Result<u32, String> {
if val { Ok(1) } else { Err(String::from("some error")) }
if val {
Ok(1)
} else {
Err(String::from("some error"))
}
}

fn main() {
Expand Down
18 changes: 9 additions & 9 deletions tests/coverage/inline-dead.cov-map
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
Function name: inline_dead::dead (unused)
Raw bytes (9): 0x[01, 01, 00, 01, 00, 19, 01, 02, 02]
Raw bytes (9): 0x[01, 01, 00, 01, 00, 17, 01, 02, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Zero) at (prev + 25, 1) to (start + 2, 2)
- Code(Zero) at (prev + 23, 1) to (start + 2, 2)

Function name: inline_dead::live::<false>
Raw bytes (28): 0x[01, 01, 02, 01, 00, 00, 02, 04, 01, 10, 01, 01, 09, 00, 02, 09, 00, 0f, 02, 02, 09, 00, 0a, 07, 02, 01, 00, 02]
Raw bytes (28): 0x[01, 01, 02, 01, 00, 00, 02, 04, 01, 0e, 01, 01, 09, 00, 02, 09, 00, 0f, 02, 02, 09, 00, 0a, 07, 02, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Counter(0), rhs = Zero
- expression 1 operands: lhs = Zero, rhs = Expression(0, Sub)
Number of file 0 mappings: 4
- Code(Counter(0)) at (prev + 16, 1) to (start + 1, 9)
- Code(Counter(0)) at (prev + 14, 1) to (start + 1, 9)
- Code(Zero) at (prev + 2, 9) to (start + 0, 15)
- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10)
= (c0 - Zero)
- Code(Expression(1, Add)) at (prev + 2, 1) to (start + 0, 2)
= (Zero + (c0 - Zero))

Function name: inline_dead::main
Raw bytes (14): 0x[01, 01, 00, 02, 01, 04, 01, 03, 0d, 01, 07, 06, 02, 02]
Raw bytes (14): 0x[01, 01, 00, 02, 01, 04, 01, 03, 0d, 01, 05, 06, 02, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 2
- Code(Counter(0)) at (prev + 4, 1) to (start + 3, 13)
- Code(Counter(0)) at (prev + 7, 6) to (start + 2, 2)
- Code(Counter(0)) at (prev + 5, 6) to (start + 2, 2)

Function name: inline_dead::main::{closure#0}
Raw bytes (23): 0x[01, 01, 02, 00, 06, 01, 00, 03, 01, 07, 17, 01, 16, 00, 02, 0d, 00, 0e, 03, 02, 05, 00, 06]
Raw bytes (23): 0x[01, 01, 02, 00, 06, 01, 00, 03, 01, 07, 17, 01, 16, 00, 01, 17, 00, 18, 03, 01, 05, 00, 06]
Number of files: 1
- file 0 => global file 1
Number of expressions: 2
- expression 0 operands: lhs = Zero, rhs = Expression(1, Sub)
- expression 1 operands: lhs = Counter(0), rhs = Zero
Number of file 0 mappings: 3
- Code(Counter(0)) at (prev + 7, 23) to (start + 1, 22)
- Code(Zero) at (prev + 2, 13) to (start + 0, 14)
- Code(Expression(0, Add)) at (prev + 2, 5) to (start + 0, 6)
- Code(Zero) at (prev + 1, 23) to (start + 0, 24)
- Code(Expression(0, Add)) at (prev + 1, 5) to (start + 0, 6)
= (Zero + (c0 - Zero))

5 changes: 2 additions & 3 deletions tests/coverage/inline-dead.coverage
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
LL| 1| println!("{}", live::<false>());
LL| 1|
LL| 1| let f = |x: bool| {
LL| 1| debug_assert!(
LL| 0| x
LL| | );
LL| 1| debug_assert!(x);
^0
LL| 1| };
LL| 1| f(false);
LL| 1|}
Expand Down
4 changes: 1 addition & 3 deletions tests/coverage/inline-dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ fn main() {
println!("{}", live::<false>());

let f = |x: bool| {
debug_assert!(
x
);
debug_assert!(x);
};
f(false);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/coverage/partial_eq.cov-map
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 12, 5) to (start + 6, 6)

Function name: partial_eq::main
Raw bytes (9): 0x[01, 01, 00, 01, 01, 15, 01, 05, 02]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 15, 01, 0a, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 21, 1) to (start + 5, 2)
- Code(Counter(0)) at (prev + 21, 1) to (start + 10, 2)

7 changes: 6 additions & 1 deletion tests/coverage/partial_eq.coverage
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@
LL| 1| let version_3_2_1 = Version::new(3, 2, 1);
LL| 1| let version_3_3_0 = Version::new(3, 3, 0);
LL| 1|
LL| 1| println!("{:?} < {:?} = {}", version_3_2_1, version_3_3_0, version_3_2_1 < version_3_3_0);
LL| 1| println!(
LL| 1| "{:?} < {:?} = {}",
LL| 1| version_3_2_1,
LL| 1| version_3_3_0,
LL| 1| version_3_2_1 < version_3_3_0
LL| 1| );
LL| 1|}
LL| |
LL| |/*
Expand Down
7 changes: 6 additions & 1 deletion tests/coverage/partial_eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ fn main() {
let version_3_2_1 = Version::new(3, 2, 1);
let version_3_3_0 = Version::new(3, 3, 0);

println!("{:?} < {:?} = {}", version_3_2_1, version_3_3_0, version_3_2_1 < version_3_3_0);
println!(
"{:?} < {:?} = {}",
version_3_2_1,
version_3_3_0,
version_3_2_1 < version_3_3_0
);
}

/*
Expand Down
4 changes: 2 additions & 2 deletions tests/coverage/thin-lto.cov-map
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Function name: thin_lto::main
Raw bytes (9): 0x[01, 01, 00, 01, 01, 03, 01, 01, 02]
Raw bytes (9): 0x[01, 01, 00, 01, 01, 03, 01, 00, 11]
Number of files: 1
- file 0 => global file 1
Number of expressions: 0
Number of file 0 mappings: 1
- Code(Counter(0)) at (prev + 3, 1) to (start + 1, 2)
- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 17)

3 changes: 1 addition & 2 deletions tests/coverage/thin-lto.coverage
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
LL| |// compile-flags: -O -C lto=thin -C prefer-dynamic=no
LL| |
LL| 1|pub fn main() {
LL| 1|}
LL| 1|pub fn main() {}

3 changes: 1 addition & 2 deletions tests/coverage/thin-lto.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// compile-flags: -O -C lto=thin -C prefer-dynamic=no

pub fn main() {
}
pub fn main() {}

0 comments on commit 12932f4

Please sign in to comment.