Skip to content

Commit

Permalink
coverage. Allow to be compiled on llvm-17
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuUx committed Apr 16, 2024
1 parent 435dc44 commit c9a0b93
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 60 deletions.
8 changes: 8 additions & 0 deletions compiler/rustc_codegen_llvm/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1248,6 +1248,8 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
) -> &'ll Value {
debug!("mcdc_parameters() with args ({:?}, {:?}, {:?})", fn_name, hash, bitmap_bytes);

assert!(llvm_util::get_version() >= (18, 0, 0), "MCDC intrinsics require LLVM 18 or later");

let llfn = unsafe { llvm::LLVMRustGetInstrProfMCDCParametersIntrinsic(self.cx().llmod) };
let llty = self.cx.type_func(
&[self.cx.type_ptr(), self.cx.type_i64(), self.cx.type_i32()],
Expand Down Expand Up @@ -1292,6 +1294,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
"mcdc_tvbitmap_update() with args ({:?}, {:?}, {:?}, {:?}, {:?})",
fn_name, hash, bitmap_bytes, bitmap_index, mcdc_temp
);
assert!(llvm_util::get_version() >= (18, 0, 0), "MCDC intrinsics require LLVM 18 or later");

let llfn =
unsafe { llvm::LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(self.cx().llmod) };
Expand Down Expand Up @@ -1328,6 +1331,11 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
mcdc_temp: Self::Value,
bool_value: Self::Value,
) {
debug!(
"mcdc_condbitmap_update() with args ({:?}, {:?}, {:?}, {:?}, {:?})",
fn_name, hash, cond_loc, mcdc_temp, bool_value
);
assert!(llvm_util::get_version() >= (18, 0, 0), "MCDC intrinsics require LLVM 18 or later");
let llfn = unsafe { llvm::LLVMRustGetInstrProfMCDCCondBitmapIntrinsic(self.cx().llmod) };
let llty = self.cx.type_func(
&[
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/src/coverageinfo/map_data.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::coverageinfo::ffi::{Counter, CounterExpression, ExprKind};

use rustc_data_structures::captures::Captures;
use rustc_data_structures::fx::FxIndexSet;
use rustc_index::bit_set::BitSet;
Expand Down Expand Up @@ -73,7 +74,6 @@ impl<'tcx> FunctionCoverageCollector<'tcx> {
Self {
function_coverage_info,
is_used,

counters_seen: BitSet::new_empty(num_counters),
expressions_seen,
}
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/CoverageMappingWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,17 @@ fromRust(LLVMRustCounterMappingRegionKind Kind) {
return coverage::CounterMappingRegion::GapRegion;
case LLVMRustCounterMappingRegionKind::BranchRegion:
return coverage::CounterMappingRegion::BranchRegion;
#if LLVM_VERSION_GE(18, 0)
case LLVMRustCounterMappingRegionKind::MCDCDecisionRegion:
return coverage::CounterMappingRegion::MCDCDecisionRegion;
case LLVMRustCounterMappingRegionKind::MCDCBranchRegion:
return coverage::CounterMappingRegion::MCDCBranchRegion;
#else
case LLVMRustCounterMappingRegionKind::MCDCDecisionRegion:
break;
case LLVMRustCounterMappingRegionKind::MCDCBranchRegion:
break;
#endif
}
report_fatal_error("Bad LLVMRustCounterMappingRegionKind!");
}
Expand Down
20 changes: 16 additions & 4 deletions compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1547,18 +1547,30 @@ extern "C" LLVMValueRef LLVMRustGetInstrProfIncrementIntrinsic(LLVMModuleRef M)
}

extern "C" LLVMValueRef LLVMRustGetInstrProfMCDCParametersIntrinsic(LLVMModuleRef M) {
#if LLVM_VERSION_GE(18, 0)
return wrap(llvm::Intrinsic::getDeclaration(unwrap(M),
(llvm::Intrinsic::ID)llvm::Intrinsic::instrprof_mcdc_parameters));
#else
report_fatal_error("LLVM 18.0 is required for mcdc intrinsic functions");
#endif
}

extern "C" LLVMValueRef LLVMRustGetInstrProfMCDCTVBitmapUpdateIntrinsic(LLVMModuleRef M) {
return wrap(llvm::Intrinsic::getDeclaration(unwrap(M),
(llvm::Intrinsic::ID)llvm::Intrinsic::instrprof_mcdc_tvbitmap_update));
#if LLVM_VERSION_GE(18, 0)
return wrap(llvm::Intrinsic::getDeclaration(
unwrap(M), llvm::Intrinsic::instrprof_mcdc_tvbitmap_update));
#else
report_fatal_error("LLVM 18.0 is required for mcdc intrinsic functions");
#endif
}

extern "C" LLVMValueRef LLVMRustGetInstrProfMCDCCondBitmapIntrinsic(LLVMModuleRef M) {
return wrap(llvm::Intrinsic::getDeclaration(unwrap(M),
(llvm::Intrinsic::ID)llvm::Intrinsic::instrprof_mcdc_condbitmap_update));
#if LLVM_VERSION_GE(18, 0)
return wrap(llvm::Intrinsic::getDeclaration(
unwrap(M), llvm::Intrinsic::instrprof_mcdc_condbitmap_update));
#else
report_fatal_error("LLVM 18.0 is required for mcdc intrinsic functions");
#endif
}

extern "C" LLVMValueRef LLVMRustBuildMemCpy(LLVMBuilderRef B,
Expand Down
80 changes: 40 additions & 40 deletions compiler/rustc_mir_build/src/build/coverageinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,46 +192,46 @@ impl MCDCState {
.then(|| Self { decision_stack: VecDeque::new(), processing_decision: None })
}

/// At first we assign ConditionIds for each sub expression.
/// If the sub expression is composite, re-assign its ConditionId to its LHS and generate a new ConditionId for its RHS.
///
/// Example: "x = (A && B) || (C && D) || (D && F)"
///
/// Visit Depth1:
/// (A && B) || (C && D) || (D && F)
/// ^-------LHS--------^ ^-RHS--^
/// ID=1 ID=2
///
/// Visit LHS-Depth2:
/// (A && B) || (C && D)
/// ^-LHS--^ ^-RHS--^
/// ID=1 ID=3
///
/// Visit LHS-Depth3:
/// (A && B)
/// LHS RHS
/// ID=1 ID=4
///
/// Visit RHS-Depth3:
/// (C && D)
/// LHS RHS
/// ID=3 ID=5
///
/// Visit RHS-Depth2: (D && F)
/// LHS RHS
/// ID=2 ID=6
///
/// Visit Depth1:
/// (A && B) || (C && D) || (D && F)
/// ID=1 ID=4 ID=3 ID=5 ID=2 ID=6
///
/// A node ID of '0' always means MC/DC isn't being tracked.
///
/// If a "next" node ID is '0', it means it's the end of the test vector.
///
/// As the compiler tracks expression in pre-order, we can ensure that condition info of parents are always properly assigned when their children are visited.
/// - If the op is AND, the "false_next" of LHS and RHS should be the parent's "false_next". While "true_next" of the LHS is the RHS, the "true next" of RHS is the parent's "true_next".
/// - If the op is OR, the "true_next" of LHS and RHS should be the parent's "true_next". While "false_next" of the LHS is the RHS, the "false next" of RHS is the parent's "false_next".
// At first we assign ConditionIds for each sub expression.
// If the sub expression is composite, re-assign its ConditionId to its LHS and generate a new ConditionId for its RHS.
//
// Example: "x = (A && B) || (C && D) || (D && F)"
//
// Visit Depth1:
// (A && B) || (C && D) || (D && F)
// ^-------LHS--------^ ^-RHS--^
// ID=1 ID=2
//
// Visit LHS-Depth2:
// (A && B) || (C && D)
// ^-LHS--^ ^-RHS--^
// ID=1 ID=3
//
// Visit LHS-Depth3:
// (A && B)
// LHS RHS
// ID=1 ID=4
//
// Visit RHS-Depth3:
// (C && D)
// LHS RHS
// ID=3 ID=5
//
// Visit RHS-Depth2: (D && F)
// LHS RHS
// ID=2 ID=6
//
// Visit Depth1:
// (A && B) || (C && D) || (D && F)
// ID=1 ID=4 ID=3 ID=5 ID=2 ID=6
//
// A node ID of '0' always means MC/DC isn't being tracked.
//
// If a "next" node ID is '0', it means it's the end of the test vector.
//
// As the compiler tracks expression in pre-order, we can ensure that condition info of parents are always properly assigned when their children are visited.
// - If the op is AND, the "false_next" of LHS and RHS should be the parent's "false_next". While "true_next" of the LHS is the RHS, the "true next" of RHS is the parent's "true_next".
// - If the op is OR, the "true_next" of LHS and RHS should be the parent's "true_next". While "false_next" of the LHS is the RHS, the "false next" of RHS is the parent's "false_next".
fn record_conditions(&mut self, op: LogicalOp, span: Span) {
let decision = match self.processing_decision.as_mut() {
Some(decision) => {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/coverage/spans.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use rustc_data_structures::graph::DirectedGraph;
use std::collections::BTreeSet;
use rustc_index::bit_set::BitSet;
use rustc_middle::mir;
use rustc_middle::mir::coverage::ConditionInfo;
use rustc_span::{BytePos, Span};
use std::collections::BTreeSet;

use crate::coverage::graph::{BasicCoverageBlock, CoverageGraph, START_BCB};
use crate::coverage::spans::from_mir::SpanFromMir;
Expand Down
28 changes: 14 additions & 14 deletions tests/coverage/mcdc_if.cov-map
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Function name: mcdc_if::mcdc_check_a
Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 0e, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 0f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 4
Expand All @@ -8,7 +8,7 @@ Number of expressions: 4
- expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
- expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
Number of file 0 mappings: 8
- Code(Counter(0)) at (prev + 14, 1) to (start + 1, 9)
- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9)
- MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
- MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
true = c1
Expand All @@ -24,7 +24,7 @@ Number of file 0 mappings: 8
= (c3 + (c2 + (c0 - c1)))

Function name: mcdc_if::mcdc_check_b
Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 16, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 17, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 4
Expand All @@ -33,7 +33,7 @@ Number of expressions: 4
- expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
- expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
Number of file 0 mappings: 8
- Code(Counter(0)) at (prev + 22, 1) to (start + 1, 9)
- Code(Counter(0)) at (prev + 23, 1) to (start + 1, 9)
- MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
- MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
true = c1
Expand All @@ -49,7 +49,7 @@ Number of file 0 mappings: 8
= (c3 + (c2 + (c0 - c1)))

Function name: mcdc_if::mcdc_check_both
Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 1e, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 1f, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 4
Expand All @@ -58,7 +58,7 @@ Number of expressions: 4
- expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
- expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
Number of file 0 mappings: 8
- Code(Counter(0)) at (prev + 30, 1) to (start + 1, 9)
- Code(Counter(0)) at (prev + 31, 1) to (start + 1, 9)
- MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
- MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
true = c1
Expand All @@ -74,7 +74,7 @@ Number of file 0 mappings: 8
= (c3 + (c2 + (c0 - c1)))

Function name: mcdc_if::mcdc_check_neither
Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 06, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
Raw bytes (64): 0x[01, 01, 04, 01, 05, 09, 02, 0d, 0f, 09, 02, 08, 01, 07, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0d, 00, 0e, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 0e, 0d, 00, 0f, 02, 06, 0f, 02, 0c, 02, 06, 0b, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 4
Expand All @@ -83,7 +83,7 @@ Number of expressions: 4
- expression 2 operands: lhs = Counter(3), rhs = Expression(3, Add)
- expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
Number of file 0 mappings: 8
- Code(Counter(0)) at (prev + 6, 1) to (start + 1, 9)
- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9)
- MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
- MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
true = c1
Expand All @@ -99,7 +99,7 @@ Number of file 0 mappings: 8
= (c3 + (c2 + (c0 - c1)))

Function name: mcdc_if::mcdc_check_not_tree_decision
Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 30, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
Raw bytes (87): 0x[01, 01, 08, 01, 05, 02, 09, 05, 09, 0d, 1e, 02, 09, 11, 1b, 0d, 1e, 02, 09, 0a, 01, 31, 01, 03, 0a, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 03, 00, 09, 00, 0a, 02, 00, 0e, 00, 0f, 30, 09, 1e, 03, 02, 00, 00, 0e, 00, 0f, 0b, 00, 14, 00, 15, 30, 11, 0d, 02, 00, 00, 00, 14, 00, 15, 11, 00, 16, 02, 06, 1b, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 8
Expand All @@ -112,7 +112,7 @@ Number of expressions: 8
- expression 6 operands: lhs = Counter(3), rhs = Expression(7, Sub)
- expression 7 operands: lhs = Expression(0, Sub), rhs = Counter(2)
Number of file 0 mappings: 10
- Code(Counter(0)) at (prev + 48, 1) to (start + 3, 10)
- Code(Counter(0)) at (prev + 49, 1) to (start + 3, 10)
- MCDCDecision { bitmap_idx: 0, conditions_num: 3 } at (prev + 3, 8) to (start + 0, 21)
- MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 3 } at (prev + 0, 9) to (start + 0, 10)
true = c1
Expand All @@ -134,7 +134,7 @@ Number of file 0 mappings: 10
= (c4 + (c3 + ((c0 - c1) - c2)))

Function name: mcdc_if::mcdc_check_tree_decision
Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 26, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
Raw bytes (87): 0x[01, 01, 08, 01, 05, 05, 0d, 05, 0d, 0d, 11, 09, 02, 1b, 1f, 0d, 11, 09, 02, 0a, 01, 27, 01, 03, 09, 28, 00, 03, 03, 08, 00, 15, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 05, 00, 0e, 00, 0f, 30, 0d, 0a, 02, 00, 03, 00, 0e, 00, 0f, 0a, 00, 13, 00, 14, 30, 11, 09, 03, 00, 00, 00, 13, 00, 14, 1b, 00, 16, 02, 06, 1f, 02, 0c, 02, 06, 17, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 8
Expand All @@ -147,7 +147,7 @@ Number of expressions: 8
- expression 6 operands: lhs = Counter(3), rhs = Counter(4)
- expression 7 operands: lhs = Counter(2), rhs = Expression(0, Sub)
Number of file 0 mappings: 10
- Code(Counter(0)) at (prev + 38, 1) to (start + 3, 9)
- Code(Counter(0)) at (prev + 39, 1) to (start + 3, 9)
- MCDCDecision { bitmap_idx: 0, conditions_num: 3 } at (prev + 3, 8) to (start + 0, 21)
- MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
true = c1
Expand All @@ -169,7 +169,7 @@ Number of file 0 mappings: 10
= ((c3 + c4) + (c2 + (c0 - c1)))

Function name: mcdc_if::mcdc_nested_if
Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3a, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02]
Raw bytes (124): 0x[01, 01, 0d, 01, 05, 02, 09, 05, 09, 1b, 15, 05, 09, 1b, 15, 05, 09, 11, 15, 02, 09, 2b, 32, 0d, 2f, 11, 15, 02, 09, 0e, 01, 3b, 01, 01, 09, 28, 00, 02, 01, 08, 00, 0e, 30, 05, 02, 01, 00, 02, 00, 08, 00, 09, 02, 00, 0d, 00, 0e, 30, 09, 32, 02, 00, 00, 00, 0d, 00, 0e, 1b, 01, 09, 01, 0d, 28, 01, 02, 01, 0c, 00, 12, 30, 16, 15, 01, 02, 00, 00, 0c, 00, 0d, 16, 00, 11, 00, 12, 30, 0d, 11, 02, 00, 00, 00, 11, 00, 12, 0d, 00, 13, 02, 0a, 2f, 02, 0a, 00, 0b, 32, 01, 0c, 02, 06, 27, 03, 01, 00, 02]
Number of files: 1
- file 0 => global file 1
Number of expressions: 13
Expand All @@ -187,7 +187,7 @@ Number of expressions: 13
- expression 11 operands: lhs = Counter(4), rhs = Counter(5)
- expression 12 operands: lhs = Expression(0, Sub), rhs = Counter(2)
Number of file 0 mappings: 14
- Code(Counter(0)) at (prev + 58, 1) to (start + 1, 9)
- Code(Counter(0)) at (prev + 59, 1) to (start + 1, 9)
- MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 14)
- MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 8) to (start + 0, 9)
true = c1
Expand Down
1 change: 1 addition & 0 deletions tests/coverage/mcdc_if.coverage
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
LL| |#![feature(coverage_attribute)]
LL| |//@ edition: 2021
LL| |//@ min-llvm-version: 18
LL| |//@ compile-flags: -Zcoverage-options=mcdc
LL| |//@ llvm-cov-flags: --show-mcdc
LL| |
Expand Down
1 change: 1 addition & 0 deletions tests/coverage/mcdc_if.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![feature(coverage_attribute)]
//@ edition: 2021
//@ min-llvm-version: 18
//@ compile-flags: -Zcoverage-options=mcdc
//@ llvm-cov-flags: --show-mcdc

Expand Down

0 comments on commit c9a0b93

Please sign in to comment.