diff --git a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs index 42164c5af48cc..b33e6dbb3409a 100644 --- a/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs +++ b/compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs @@ -111,7 +111,7 @@ impl<'tcx> CoverageInfoBuilderMethods<'tcx> for Builder<'_, '_, 'tcx> { }; match *kind { - CoverageKind::SpanMarker | CoverageKind::BlockMarker { .. } => unreachable!( + CoverageKind::Point { .. } | CoverageKind::BlockMarker { .. } => unreachable!( "marker statement {kind:?} should have been removed by CleanupPostBorrowck" ), CoverageKind::VirtualCounter { bcb } diff --git a/compiler/rustc_middle/src/mir/coverage.rs b/compiler/rustc_middle/src/mir/coverage.rs index c0b997ec94a12..e48ee0068c300 100644 --- a/compiler/rustc_middle/src/mir/coverage.rs +++ b/compiler/rustc_middle/src/mir/coverage.rs @@ -3,6 +3,7 @@ use std::fmt::{self, Debug, Formatter}; use rustc_data_structures::fx::FxIndexMap; +use rustc_hir::HirId; use rustc_index::{Idx, IndexVec}; use rustc_macros::{StableHash, TyDecodable, TyEncodable}; use rustc_span::Span; @@ -70,13 +71,24 @@ impl Debug for CovTerm { } } +/// The specific relationship between [`CoverageKind::Point`] and its [`HirId`]. +#[derive(Clone, Copy, Debug, PartialEq, TyEncodable, TyDecodable, StableHash)] +pub enum PointKind { + /// Inserted just before evaluating an expression. + Expr, + /// Inserted when a one-sided `if` expression generates its synthetic `else {}`. + /// The absent `else` has no node, so [`HirId`] is the `if` expression. + ImplicitElse, + /// Inserted at the end of a function's body. [`HirId`] is the function itself. + FunctionEnd, +} + #[derive(Clone, PartialEq, TyEncodable, TyDecodable, StableHash)] pub enum CoverageKind { - /// Marks a span that might otherwise not be represented in MIR, so that - /// coverage instrumentation can associate it with its enclosing block/BCB. - /// - /// Should be erased before codegen (at some point after `InstrumentCoverage`). - SpanMarker, + /// Associates a HIR node (such as an expression) with a particular point in + /// MIR control-flow. The relationship between the node and the point is + /// indicated by [`PointKind`]. Injected during MIR building. + Point { point_kind: PointKind, hir_id: HirId }, /// Marks its enclosing basic block with an ID that can be referred to by /// side data in [`CoverageEarlyInfo`]. @@ -94,11 +106,24 @@ pub enum CoverageKind { impl Debug for CoverageKind { fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result { - use CoverageKind::*; match self { - SpanMarker => write!(fmt, "SpanMarker"), - BlockMarker { id } => write!(fmt, "BlockMarker({:?})", id.index()), - VirtualCounter { bcb } => write!(fmt, "VirtualCounter({bcb:?})"), + CoverageKind::Point { point_kind, hir_id } => { + write!(fmt, "Point({point_kind:?}, {hir_id:?}") + } + CoverageKind::BlockMarker { id } => write!(fmt, "BlockMarker({:?})", id.index()), + CoverageKind::VirtualCounter { bcb } => write!(fmt, "VirtualCounter({bcb:?})"), + } + } +} + +impl CoverageKind { + /// Returns true if this kind of coverage statement is a marker inserted during + /// MIR building, for use by analysis in the `InstrumentCoverage` pass, and is + /// no longer needed after that pass. + pub fn is_removed_after_analysis(&self) -> bool { + match self { + CoverageKind::Point { .. } | CoverageKind::BlockMarker { .. } => true, + CoverageKind::VirtualCounter { .. } => false, } } } diff --git a/compiler/rustc_middle/src/mir/syntax.rs b/compiler/rustc_middle/src/mir/syntax.rs index 2d8c83700540b..4c4a16953d5ed 100644 --- a/compiler/rustc_middle/src/mir/syntax.rs +++ b/compiler/rustc_middle/src/mir/syntax.rs @@ -104,13 +104,14 @@ pub enum AnalysisPhase { /// * [`TerminatorKind::FalseEdge`] /// * [`StatementKind::FakeRead`] /// * [`StatementKind::AscribeUserType`] - /// * [`StatementKind::Coverage`] with [`CoverageKind::BlockMarker`] or - /// [`CoverageKind::SpanMarker`] + /// * [`StatementKind::Coverage`] with [`CoverageKind::is_removed_after_analysis`] /// * [`Rvalue::Ref`] with `BorrowKind::Fake` /// * [`CastKind::PointerCoercion`] with any of the following: /// * [`PointerCoercion::ArrayToPointer`] /// * [`PointerCoercion::MutToConstPointer`] /// + /// [`CoverageKind::is_removed_after_analysis`]: crate::mir::coverage::CoverageKind::is_removed_after_analysis + /// /// Furthermore, `Deref` projections must be the first projection within any place (if they /// appear at all) PostCleanup = 1, diff --git a/compiler/rustc_middle/src/thir.rs b/compiler/rustc_middle/src/thir.rs index f65295080f61d..31a6344af61b0 100644 --- a/compiler/rustc_middle/src/thir.rs +++ b/compiler/rustc_middle/src/thir.rs @@ -257,6 +257,9 @@ pub struct Expr<'tcx> { /// The id of the HIR expression whose [temporary scope] should be used for this expression. /// + /// Also used by coverage instrumentation to recover the HIR node that corresponds to a THIR + /// expression node. + /// /// [temporary scope]: https://doc.rust-lang.org/reference/destructors.html#temporary-scopes pub temp_scope_id: hir::ItemLocalId, diff --git a/compiler/rustc_mir_build/src/builder/cfg.rs b/compiler/rustc_mir_build/src/builder/cfg.rs index fb8fa632f7983..63ccf323fc204 100644 --- a/compiler/rustc_mir_build/src/builder/cfg.rs +++ b/compiler/rustc_mir_build/src/builder/cfg.rs @@ -107,17 +107,6 @@ impl<'tcx> CFG<'tcx> { self.push(block, stmt); } - /// Adds a dummy statement whose only role is to associate a span with its - /// enclosing block for the purposes of coverage instrumentation. - /// - /// This results in more accurate coverage reports for certain kinds of - /// syntax (e.g. `continue` or `if !`) that would otherwise not appear in MIR. - pub(crate) fn push_coverage_span_marker(&mut self, block: BasicBlock, source_info: SourceInfo) { - let kind = StatementKind::Coverage(coverage::CoverageKind::SpanMarker); - let stmt = Statement::new(source_info, kind); - self.push(block, stmt); - } - pub(crate) fn terminate( &mut self, block: BasicBlock, diff --git a/compiler/rustc_mir_build/src/builder/coverageinfo.rs b/compiler/rustc_mir_build/src/builder/coverageinfo.rs index 0898d9f117ae1..8d279d2158022 100644 --- a/compiler/rustc_mir_build/src/builder/coverageinfo.rs +++ b/compiler/rustc_mir_build/src/builder/coverageinfo.rs @@ -2,9 +2,12 @@ use std::assert_matches; use std::collections::hash_map::Entry; use rustc_data_structures::fx::FxHashMap; -use rustc_middle::mir::coverage::{BlockMarkerId, BranchSpan, CoverageEarlyInfo, CoverageKind}; -use rustc_middle::mir::{self, BasicBlock, SourceInfo, UnOp}; -use rustc_middle::thir::{ExprId, ExprKind, Pat, Thir}; +use rustc_hir::HirId; +use rustc_middle::mir::coverage::{ + BlockMarkerId, BranchSpan, CoverageEarlyInfo, CoverageKind, PointKind, +}; +use rustc_middle::mir::{self, BasicBlock, SourceInfo, Statement, UnOp}; +use rustc_middle::thir::{self, ExprId, ExprKind, Pat, Thir}; use rustc_middle::ty::TyCtxt; use rustc_span::def_id::LocalDefId; @@ -12,6 +15,9 @@ use crate::builder::{Builder, CFG}; /// Collects coverage-related information during MIR building, to eventually be /// turned into a function's [`CoverageEarlyInfo`] when MIR building is complete. +/// +/// FIXME(Zalathar): Now that we have [`CoverageKind::Point`], we should be able +/// to remove this and perform HIR-aware analysis during instrumentation instead. pub(crate) struct CoverageInfoBuilder { /// Maps condition expressions to their enclosing `!`, for better instrumentation. nots: FxHashMap, @@ -175,6 +181,73 @@ impl CoverageInfoBuilder { } impl<'tcx> Builder<'_, 'tcx> { + /// Does nothing if `-Cinstrument-coverage` is not enabled. + /// + /// Otherwise, pushes a marker statement to `block` indicating that this is where + /// the HIR expression `hir_id` is being evaluated. + pub(crate) fn push_coverage_point_for_expr( + &mut self, + block: BasicBlock, + source_info: SourceInfo, + hir_id: HirId, + ) { + if !self.tcx.sess.instrument_coverage() { + return; + } + self.push_coverage_point_inner(block, source_info, PointKind::Expr, hir_id); + } + + /// Does nothing if `-Cinstrument-coverage` is not enabled. + /// + /// Otherwise, pushes a marker statement to `block` indicating that this is where + /// the one-sided if-expression `if_expr` will generate its synthetic `else {}` + /// path, since it lacks an explicit `else` block. + pub(crate) fn push_coverage_point_for_implicit_else( + &mut self, + block: BasicBlock, + source_info: SourceInfo, + if_expr: &thir::Expr<'tcx>, + ) { + if !self.tcx.sess.instrument_coverage() { + return; + } + // Recover the full HirId by combining a local ID with the function's owner ID. + let hir_id = HirId { owner: self.hir_id.owner, local_id: if_expr.temp_scope_id }; + self.push_coverage_point_inner(block, source_info, PointKind::ImplicitElse, hir_id); + } + + /// Does nothing if `-Cinstrument-coverage` is not enabled. + /// + /// Otherwise, pushes a marker statement to `block` indicating that this is where + /// the function `fn_hir_id` would implicitly return at the end of its body. + pub(crate) fn push_coverage_point_for_fn_end( + &mut self, + block: BasicBlock, + source_info: SourceInfo, + fn_hir_id: HirId, + ) { + if !self.tcx.sess.instrument_coverage() { + return; + } + self.push_coverage_point_inner(block, source_info, PointKind::FunctionEnd, fn_hir_id); + } + + fn push_coverage_point_inner( + &mut self, + block: BasicBlock, + source_info: SourceInfo, + point_kind: PointKind, + hir_id: HirId, + ) { + assert!(self.tcx.sess.instrument_coverage()); + + let stmt = Statement::new( + source_info, + mir::StatementKind::Coverage(CoverageKind::Point { point_kind, hir_id }), + ); + self.cfg.push(block, stmt); + } + /// If condition coverage is enabled, inject extra blocks and marker statements /// that will let us track the value of the condition in `place`. pub(crate) fn visit_coverage_standalone_condition( diff --git a/compiler/rustc_mir_build/src/builder/expr/as_operand.rs b/compiler/rustc_mir_build/src/builder/expr/as_operand.rs index d2f06cc9d57b3..6d73e115acbd8 100644 --- a/compiler/rustc_mir_build/src/builder/expr/as_operand.rs +++ b/compiler/rustc_mir_build/src/builder/expr/as_operand.rs @@ -127,6 +127,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let source_info = this.source_info(expr.span); let region_scope = (region_scope, source_info); return this.in_scope(region_scope, LintLevel::Explicit(hir_id), |this| { + this.push_coverage_point_for_expr(block, source_info, hir_id); this.as_operand(block, scope, value, local_info, needs_temporary) }); } @@ -170,6 +171,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let source_info = this.source_info(expr.span); let region_scope = (region_scope, source_info); return this.in_scope(region_scope, LintLevel::Explicit(hir_id), |this| { + this.push_coverage_point_for_expr(block, source_info, hir_id); this.as_call_operand(block, scope, value) }); } diff --git a/compiler/rustc_mir_build/src/builder/expr/as_place.rs b/compiler/rustc_mir_build/src/builder/expr/as_place.rs index 4c717d70c742b..4559a8af3d4f4 100644 --- a/compiler/rustc_mir_build/src/builder/expr/as_place.rs +++ b/compiler/rustc_mir_build/src/builder/expr/as_place.rs @@ -430,6 +430,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { match expr.kind { ExprKind::Scope { region_scope, hir_id, value } => { this.in_scope((region_scope, source_info), LintLevel::Explicit(hir_id), |this| { + this.push_coverage_point_for_expr(block, source_info, hir_id); this.expr_as_place(block, value, mutability, fake_borrow_temps) }) } diff --git a/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs index ea484bd05878b..2298c953a2e4d 100644 --- a/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs +++ b/compiler/rustc_mir_build/src/builder/expr/as_rvalue.rs @@ -58,6 +58,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { ExprKind::Scope { region_scope, hir_id, value } => { let region_scope = (region_scope, source_info); this.in_scope(region_scope, LintLevel::Explicit(hir_id), |this| { + this.push_coverage_point_for_expr(block, source_info, hir_id); this.as_rvalue(block, scope, value) }) } diff --git a/compiler/rustc_mir_build/src/builder/expr/as_temp.rs b/compiler/rustc_mir_build/src/builder/expr/as_temp.rs index 2834e4e4dcb30..ca4bc95a71fb7 100644 --- a/compiler/rustc_mir_build/src/builder/expr/as_temp.rs +++ b/compiler/rustc_mir_build/src/builder/expr/as_temp.rs @@ -29,7 +29,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { return this.in_scope( (region_scope, source_info), LintLevel::Explicit(hir_id), - |this| this.as_temp(block, temp_lifetime, value, mutability), + |this| { + this.push_coverage_point_for_expr(block, source_info, hir_id); + this.as_temp(block, temp_lifetime, value, mutability) + }, ); } diff --git a/compiler/rustc_mir_build/src/builder/expr/into.rs b/compiler/rustc_mir_build/src/builder/expr/into.rs index 13a64346c36c4..4b9e7da3d6785 100644 --- a/compiler/rustc_mir_build/src/builder/expr/into.rs +++ b/compiler/rustc_mir_build/src/builder/expr/into.rs @@ -48,6 +48,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { ExprKind::Scope { region_scope, hir_id, value } => { let region_scope = (region_scope, source_info); this.in_scope(region_scope, LintLevel::Explicit(hir_id), |this| { + this.push_coverage_point_for_expr(block, source_info, hir_id); this.expr_into_dest(destination, block, value) }) } @@ -114,6 +115,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { // There is no `else` arm, so we know both arms have type `()`. // Generate the implicit `else {}` by assigning unit. let correct_si = this.source_info(expr_span.shrink_to_hi()); + this.push_coverage_point_for_implicit_else(else_blk, correct_si, expr); this.cfg.push_assign_unit(else_blk, correct_si, destination, this.tcx); } diff --git a/compiler/rustc_mir_build/src/builder/expr/stmt.rs b/compiler/rustc_mir_build/src/builder/expr/stmt.rs index 99e16d182a97d..e9b6388152f28 100644 --- a/compiler/rustc_mir_build/src/builder/expr/stmt.rs +++ b/compiler/rustc_mir_build/src/builder/expr/stmt.rs @@ -27,6 +27,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { match expr.kind { ExprKind::Scope { region_scope, hir_id, value } => { this.in_scope((region_scope, source_info), LintLevel::Explicit(hir_id), |this| { + this.push_coverage_point_for_expr(block, source_info, hir_id); this.stmt_expr(block, value, statement_scope) }) } diff --git a/compiler/rustc_mir_build/src/builder/matches/mod.rs b/compiler/rustc_mir_build/src/builder/matches/mod.rs index ddeb9e084b21d..f132fb61f2fd7 100644 --- a/compiler/rustc_mir_build/src/builder/matches/mod.rs +++ b/compiler/rustc_mir_build/src/builder/matches/mod.rs @@ -164,11 +164,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let local_scope = this.local_scope(); let (success_block, failure_block) = this.in_if_then_scope(local_scope, expr_span, |this| { - // Help out coverage instrumentation by injecting a dummy statement with - // the original condition's span (including `!`). This fixes #115468. - if this.tcx.sess.instrument_coverage() { - this.cfg.push_coverage_span_marker(block, this.source_info(expr_span)); - } this.then_else_break_inner( block, arg, @@ -182,8 +177,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { failure_block.unit() } ExprKind::Scope { region_scope, hir_id, value } => { - let region_scope = (region_scope, this.source_info(expr_span)); - this.in_scope(region_scope, LintLevel::Explicit(hir_id), |this| { + let source_info = this.source_info(expr_span); + this.in_scope((region_scope, source_info), LintLevel::Explicit(hir_id), |this| { + this.push_coverage_point_for_expr(block, source_info, hir_id); this.then_else_break_inner(block, value, args) }) } diff --git a/compiler/rustc_mir_build/src/builder/mod.rs b/compiler/rustc_mir_build/src/builder/mod.rs index 7701206ad03b7..5886daf16e7b3 100644 --- a/compiler/rustc_mir_build/src/builder/mod.rs +++ b/compiler/rustc_mir_build/src/builder/mod.rs @@ -548,6 +548,7 @@ fn construct_fn<'tcx>( }) .into_block(); let source_info = builder.source_info(fn_end); + builder.push_coverage_point_for_fn_end(return_block, source_info, fn_id); builder.cfg.terminate(return_block, source_info, TerminatorKind::Return); builder.build_drop_trees(); return_block.unit() diff --git a/compiler/rustc_mir_build/src/builder/scope.rs b/compiler/rustc_mir_build/src/builder/scope.rs index 26e89cedb3070..bd8c57cfde362 100644 --- a/compiler/rustc_mir_build/src/builder/scope.rs +++ b/compiler/rustc_mir_build/src/builder/scope.rs @@ -791,15 +791,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { (None, Some(_)) => { panic!("`return`, `become` and `break` with value and must have a destination") } - (None, None) => { - if self.tcx.sess.instrument_coverage() { - // Normally we wouldn't build any MIR in this case, but that makes it - // harder for coverage instrumentation to extract a relevant span for - // `continue` expressions. So here we inject a dummy statement with the - // desired span. - self.cfg.push_coverage_span_marker(block, source_info); - } - } + (None, None) => {} } let region_scope = self.scopes.breakable_scopes[break_index].region_scope; diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs index fc82b8e2bc430..dc49b6637fc32 100644 --- a/compiler/rustc_mir_build/src/thir/cx/expr.rs +++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs @@ -134,6 +134,9 @@ impl<'tcx> ThirBuildCx<'tcx> { } // Finally, wrap this up in the expr's scope. + // + // (In addition to marking scope, coverage instrumentation also uses this node + // to help mark the point in MIR where an expression is about to be evaluated.) expr = Expr { temp_scope_id: expr_scope.local_id, ty, diff --git a/compiler/rustc_mir_transform/src/cleanup_post_borrowck.rs b/compiler/rustc_mir_transform/src/cleanup_post_borrowck.rs index fa034119fb57c..4ff4954e516b1 100644 --- a/compiler/rustc_mir_transform/src/cleanup_post_borrowck.rs +++ b/compiler/rustc_mir_transform/src/cleanup_post_borrowck.rs @@ -5,7 +5,7 @@ //! - [`AscribeUserType`] //! - [`FakeRead`] //! - [`Assign`] statements with a [`Fake`] borrow -//! - [`Coverage`] statements of kind [`BlockMarker`] or [`SpanMarker`] +//! - [`Coverage`] statements that are not needed after the [`InstrumentCoverage`] pass //! //! [`AscribeUserType`]: rustc_middle::mir::StatementKind::AscribeUserType //! [`Assign`]: rustc_middle::mir::StatementKind::Assign @@ -13,10 +13,8 @@ //! [`Nop`]: rustc_middle::mir::StatementKind::Nop //! [`Fake`]: rustc_middle::mir::BorrowKind::Fake //! [`Coverage`]: rustc_middle::mir::StatementKind::Coverage -//! [`BlockMarker`]: rustc_middle::mir::coverage::CoverageKind::BlockMarker -//! [`SpanMarker`]: rustc_middle::mir::coverage::CoverageKind::SpanMarker +//! [`InstrumentCoverage`]: crate::coverage::InstrumentCoverage -use rustc_middle::mir::coverage::CoverageKind; use rustc_middle::mir::*; use rustc_middle::ty::TyCtxt; use rustc_middle::ty::adjustment::PointerCoercion; @@ -34,15 +32,13 @@ impl<'tcx> crate::MirPass<'tcx> for CleanupPostBorrowck { match statement.kind { StatementKind::AscribeUserType(..) | StatementKind::Assign((_, Rvalue::Ref(_, BorrowKind::Fake(_), _))) - | StatementKind::Coverage( - // These kinds of coverage statements are markers inserted during - // MIR building, and are not needed after InstrumentCoverage. - CoverageKind::BlockMarker { .. } | CoverageKind::SpanMarker { .. }, - ) | StatementKind::FakeRead(..) | StatementKind::BackwardIncompatibleDropHint { .. } => { statement.make_nop(true) } + StatementKind::Coverage(ref kind) if kind.is_removed_after_analysis() => { + statement.make_nop(true) + } StatementKind::Assign(( _, Rvalue::Cast( diff --git a/compiler/rustc_mir_transform/src/coverage/expansion.rs b/compiler/rustc_mir_transform/src/coverage/expansion.rs index b1122d9618fc7..5e8d261ae1f41 100644 --- a/compiler/rustc_mir_transform/src/coverage/expansion.rs +++ b/compiler/rustc_mir_transform/src/coverage/expansion.rs @@ -103,7 +103,7 @@ pub(crate) fn build_expn_tree( hir_info: &ExtractedHirInfo, graph: &CoverageGraph, ) -> Result { - let raw_spans = from_mir::extract_raw_spans_from_mir(mir_body, graph); + let raw_spans = from_mir::extract_raw_spans_from_mir(mir_body, hir_info, graph); let mut nodes = FxIndexMap::default(); let new_node = |&context: &SyntaxContext| ExpnNode::for_context(context); diff --git a/compiler/rustc_mir_transform/src/coverage/from_mir.rs b/compiler/rustc_mir_transform/src/coverage/from_mir.rs index 29f9d200b1bcb..cff81d02f7837 100644 --- a/compiler/rustc_mir_transform/src/coverage/from_mir.rs +++ b/compiler/rustc_mir_transform/src/coverage/from_mir.rs @@ -1,51 +1,42 @@ -use std::iter; - -use rustc_middle::bug; -use rustc_middle::mir::coverage::CoverageKind; -use rustc_middle::mir::{ - self, FakeReadCause, Statement, StatementKind, Terminator, TerminatorKind, -}; +use rustc_middle::mir::coverage::{CoverageKind, PointKind}; +use rustc_middle::mir::{self, Statement, StatementKind}; use rustc_span::Span; use crate::coverage::graph::{BasicCoverageBlock, CoverageGraph}; +use crate::coverage::hir_info::ExtractedHirInfo; #[derive(Debug)] pub(crate) struct RawSpanFromMir { - /// A span that has been extracted from a MIR statement/terminator, but + /// A span that has been extracted from a MIR marker statement, but /// hasn't been "unexpanded", so it might not lie within the function body /// span and might be part of an expansion with a different context. pub(crate) raw_span: Span, pub(crate) bcb: BasicCoverageBlock, } -/// Generates an initial set of coverage spans from the statements and -/// terminators in the function's MIR body, each associated with its -/// corresponding node in the coverage graph. +/// Generates an initial set of coverage spans from marker statements in the function's +/// MIR body, each associated with its corresponding node in the coverage graph. /// -/// This is necessarily an inexact process, because MIR isn't designed to -/// capture source spans at the level of detail we would want for coverage, -/// but it's good enough to be better than nothing. +/// FIXME(Zalathar): This extraction is currently in a transitional state, since we're +/// no longer trying to heuristically recover meaningful spans from MIR soup, but we +/// haven't yet fully embraced the possibilities of HIR-aware analysis. pub(crate) fn extract_raw_spans_from_mir<'tcx>( mir_body: &mir::Body<'tcx>, + hir_info: &ExtractedHirInfo, graph: &CoverageGraph, ) -> Vec { let mut raw_spans = vec![]; // We only care about blocks that are part of the coverage graph. for (bcb, bcb_data) in graph.iter_enumerated() { - let make_raw_span = |raw_span: Span| RawSpanFromMir { raw_span, bcb }; - // A coverage graph node can consist of multiple basic blocks. for &bb in &bcb_data.basic_blocks { - let bb_data = &mir_body[bb]; - - let statements = bb_data.statements.iter(); - raw_spans.extend(statements.filter_map(filtered_statement_span).map(make_raw_span)); - - // There's only one terminator, but wrap it in an iterator to - // mirror the handling of statements. - let terminator = iter::once(bb_data.terminator()); - raw_spans.extend(terminator.filter_map(filtered_terminator_span).map(make_raw_span)); + let statements = mir_body[bb].statements.iter(); + raw_spans.extend( + statements + .filter_map(|stmt| filtered_statement_span(hir_info, stmt)) + .map(|raw_span: Span| RawSpanFromMir { raw_span, bcb }), + ); } } @@ -54,90 +45,21 @@ pub(crate) fn extract_raw_spans_from_mir<'tcx>( /// If the MIR `Statement` has a span contributive to computing coverage spans, /// return it; otherwise return `None`. -fn filtered_statement_span(statement: &Statement<'_>) -> Option { - match statement.kind { - // These statements have spans that are often outside the scope of the executed source code - // for their parent `BasicBlock`. - StatementKind::StorageLive(_) - | StatementKind::StorageDead(_) - | StatementKind::ConstEvalCounter - | StatementKind::BackwardIncompatibleDropHint { .. } - | StatementKind::Nop => None, - - // FIXME(#78546): MIR InstrumentCoverage - Can the source_info.span for `FakeRead` - // statements be more consistent? - // - // FakeReadCause::ForGuardBinding, in this example: - // match somenum { - // x if x < 1 => { ... } - // }... - // The BasicBlock within the match arm code included one of these statements, but the span - // for it covered the `1` in this source. The actual statements have nothing to do with that - // source span: - // FakeRead(ForGuardBinding, _4); - // where `_4` is: - // _4 = &_1; (at the span for the first `x`) - // and `_1` is the `Place` for `somenum`. - // - // If and when the Issue is resolved, remove this special case match pattern: - StatementKind::FakeRead((FakeReadCause::ForGuardBinding, _)) => None, - - // Retain spans from most other statements. - StatementKind::FakeRead(_) - | StatementKind::Intrinsic(..) - | StatementKind::Coverage( - // The purpose of `SpanMarker` is to be matched and accepted here. - CoverageKind::SpanMarker, - ) - | StatementKind::Assign(_) - | StatementKind::SetDiscriminant { .. } - | StatementKind::PlaceMention(..) - | StatementKind::AscribeUserType(_, _) => Some(statement.source_info.span), - - // Block markers are used for branch coverage, so ignore them here. - StatementKind::Coverage(CoverageKind::BlockMarker { .. }) => None, - - // These coverage statements should not exist prior to coverage instrumentation. - StatementKind::Coverage(CoverageKind::VirtualCounter { .. }) => bug!( - "Unexpected coverage statement found during coverage instrumentation: {statement:?}" - ), +fn filtered_statement_span<'tcx>( + hir_info: &ExtractedHirInfo, + statement: &Statement<'tcx>, +) -> Option { + let StatementKind::Coverage(CoverageKind::Point { point_kind, hir_id }) = statement.kind else { + return None; + }; + match point_kind { + // These PointKind variants contribute to normal code spans. + // (Other variants added in the future might want to return None here.) + PointKind::Expr | PointKind::ImplicitElse | PointKind::FunctionEnd => {} } -} - -/// If the MIR `Terminator` has a span contributive to computing coverage spans, -/// return it; otherwise return `None`. -fn filtered_terminator_span(terminator: &Terminator<'_>) -> Option { - match terminator.kind { - // These terminators have spans that don't positively contribute to computing a reasonable - // span of actually executed source code. (For example, SwitchInt terminators extracted from - // an `if condition { block }` has a span that includes the executed block, if true, - // but for coverage, the code region executed, up to *and* through the SwitchInt, - // actually stops before the if's block.) - TerminatorKind::Unreachable - | TerminatorKind::Assert { .. } - | TerminatorKind::Drop { .. } - | TerminatorKind::SwitchInt { .. } - | TerminatorKind::FalseEdge { .. } - | TerminatorKind::Goto { .. } => None, - - // Call `func` operand can have a more specific span when part of a chain of calls - TerminatorKind::Call { ref func, .. } | TerminatorKind::TailCall { ref func, .. } => { - let mut span = terminator.source_info.span; - if let mir::Operand::Constant(constant) = func - && span.contains(constant.span) - { - span = constant.span; - } - Some(span) - } - - // Retain spans from all other terminators - TerminatorKind::UnwindResume - | TerminatorKind::UnwindTerminate(_) - | TerminatorKind::Return - | TerminatorKind::Yield { .. } - | TerminatorKind::CoroutineDrop - | TerminatorKind::FalseUnwind { .. } - | TerminatorKind::InlineAsm { .. } => Some(terminator.source_info.span), + if hir_info.nodes_to_ignore.contains(&hir_id) { + return None; } + + Some(statement.source_info.span) } diff --git a/compiler/rustc_mir_transform/src/coverage/hir_info.rs b/compiler/rustc_mir_transform/src/coverage/hir_info.rs index ab66bf1a733ef..a960fd1eb54f5 100644 --- a/compiler/rustc_mir_transform/src/coverage/hir_info.rs +++ b/compiler/rustc_mir_transform/src/coverage/hir_info.rs @@ -1,9 +1,10 @@ -use rustc_hir as hir; -use rustc_hir::intravisit::{Visitor, walk_expr}; +use rustc_data_structures::fx::FxHashSet; +use rustc_hir::intravisit::Visitor; +use rustc_hir::{self as hir, HirId}; use rustc_middle::hir::nested_filter; -use rustc_middle::ty::{self, TyCtxt}; -use rustc_span::Span; +use rustc_middle::ty::{self, TyCtxt, TypeckResults}; use rustc_span::def_id::LocalDefId; +use rustc_span::{ExpnKind, MacroKind, Span}; /// Function information extracted from HIR by the coverage instrumentor. #[derive(Debug)] @@ -18,6 +19,9 @@ pub(crate) struct ExtractedHirInfo { /// should not be included in coverage spans for this function /// (e.g. closures and nested items). pub(crate) hole_spans: Vec, + /// HIR nodes that should be ignored when extracting spans from marker + /// statements in MIR. + pub(crate) nodes_to_ignore: FxHashSet, } pub(crate) fn extract_hir_info<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> ExtractedHirInfo { @@ -69,8 +73,16 @@ pub(crate) fn extract_hir_info<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> E let function_source_hash = hash_mir_source(tcx, hir_body); let hole_spans = extract_hole_spans_from_hir(tcx, hir_body); - - ExtractedHirInfo { function_source_hash, is_async_fn, fn_sig_span, body_span, hole_spans } + let nodes_to_ignore = find_nodes_to_ignore(tcx, def_id, hir_body); + + ExtractedHirInfo { + function_source_hash, + is_async_fn, + fn_sig_span, + body_span, + hole_spans, + nodes_to_ignore, + } } fn hash_mir_source<'tcx>(tcx: TyCtxt<'tcx>, hir_body: &'tcx hir::Body<'tcx>) -> u64 { @@ -118,7 +130,7 @@ fn extract_hole_spans_from_hir<'tcx>(tcx: TyCtxt<'tcx>, hir_body: &hir::Body<'tc } // For other expressions, recursively visit as normal. - _ => walk_expr(self, expr), + _ => hir::intravisit::walk_expr(self, expr), } } } @@ -133,3 +145,59 @@ fn extract_hole_spans_from_hir<'tcx>(tcx: TyCtxt<'tcx>, hir_body: &hir::Body<'tc visitor.visit_body(hir_body); visitor.hole_spans } + +fn find_nodes_to_ignore<'tcx>( + tcx: TyCtxt<'tcx>, + def_id: LocalDefId, + hir_body: &hir::Body<'tcx>, +) -> FxHashSet { + struct DivergingCallVisitor<'tcx> { + tcx: TyCtxt<'tcx>, + typeck_results: &'tcx TypeckResults<'tcx>, + nodes_to_ignore: FxHashSet, + } + struct SubexprsVisitor<'a, 'tcx> { + inner: &'a mut DivergingCallVisitor<'tcx>, + } + + // Use a heuristic to detect and ignore the message-formatting arguments of assert macros, + // because tracking coverage for them is almost never useful. This avoids big regressions + // in coverage-report quality for code containing assertions. + // + // FIXME(Zalathar): Now that we have HIR-aware instrumentation, we might be able to + // get rid of this by extending `#[coverage(off)]` to support arbitrary expressions, + // and using it in the standard-library assert macros. + impl<'tcx> Visitor<'tcx> for DivergingCallVisitor<'tcx> { + fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) { + // Look for call expressions with a return type of `!` produced by a bang-macro. + // If we find one, ignore all subexpressions in the call's _arguments_. + if let hir::ExprKind::Call(callee, args) = expr.kind + && let callee_ty = self.typeck_results.node_type(callee.hir_id) + && callee_ty.is_fn() + && let Some(output) = callee_ty.fn_sig(self.tcx).output().no_bound_vars() + && output.is_never() + && let ExpnKind::Macro(MacroKind::Bang, _) = expr.span.ctxt().outer_expn_data().kind + { + for arg in args { + (SubexprsVisitor { inner: self }).visit_expr(arg) + } + } else { + hir::intravisit::walk_expr(self, expr); + } + } + } + impl<'tcx> Visitor<'tcx> for SubexprsVisitor<'_, 'tcx> { + fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) { + self.inner.nodes_to_ignore.insert(expr.hir_id); + hir::intravisit::walk_expr(self, expr); + } + } + + let mut visitor = DivergingCallVisitor { + tcx, + typeck_results: tcx.typeck(def_id), + nodes_to_ignore: FxHashSet::default(), + }; + visitor.visit_body(hir_body); + visitor.nodes_to_ignore +} diff --git a/compiler/rustc_mir_transform/src/validate.rs b/compiler/rustc_mir_transform/src/validate.rs index b9c55439f0597..11d1be3e63136 100644 --- a/compiler/rustc_mir_transform/src/validate.rs +++ b/compiler/rustc_mir_transform/src/validate.rs @@ -8,7 +8,6 @@ use rustc_index::IndexVec; use rustc_index::bit_set::DenseBitSet; use rustc_infer::infer::TyCtxtInferExt; use rustc_infer::traits::{Obligation, ObligationCause}; -use rustc_middle::mir::coverage::CoverageKind; use rustc_middle::mir::visit::{MutatingUseContext, NonUseContext, PlaceContext, Visitor}; use rustc_middle::mir::*; use rustc_middle::ty::adjustment::PointerCoercion; @@ -317,7 +316,7 @@ impl<'a, 'tcx> Visitor<'tcx> for CfgChecker<'a, 'tcx> { } StatementKind::Coverage(kind) => { if self.body.phase >= MirPhase::Analysis(AnalysisPhase::PostCleanup) - && let CoverageKind::BlockMarker { .. } | CoverageKind::SpanMarker { .. } = kind + && kind.is_removed_after_analysis() { self.fail( location, diff --git a/tests/coverage-run-rustdoc/doctest.coverage b/tests/coverage-run-rustdoc/doctest.coverage index 0fa94361c472e..d9d81d30286b0 100644 --- a/tests/coverage-run-rustdoc/doctest.coverage +++ b/tests/coverage-run-rustdoc/doctest.coverage @@ -18,12 +18,12 @@ $DIR/doctest.rs: LL| |//! Just some random code: LL| 1|//! ``` LL| 1|//! if true { - LL| |//! // this is executed! + LL| 1|//! // this is executed! LL| 1|//! assert_eq!(1, 1); - LL| |//! } else { - LL| |//! // this is not! + LL| 1|//! } else { + LL| 0|//! // this is not! LL| 0|//! assert_eq!(1, 2); - LL| |//! } + LL| 0|//! } LL| 1|//! ``` LL| |//! LL| |//! doctest testing external code: @@ -89,9 +89,9 @@ $DIR/doctest.rs: LL| 1|fn main() { LL| 1| if true { LL| 1| assert_eq!(1, 1); - LL| | } else { + LL| 1| } else { LL| 0| assert_eq!(1, 2); - LL| | } + LL| 0| } LL| 1|} LL| | LL| |// FIXME(Swatinem): Fix known issue that coverage code region columns need to be offset by the diff --git a/tests/coverage/assert-ne.cov-map b/tests/coverage/assert-ne.cov-map index fde0d5184d675..1118e431d6bc5 100644 --- a/tests/coverage/assert-ne.cov-map +++ b/tests/coverage/assert-ne.cov-map @@ -1,21 +1,20 @@ Function name: assert_ne::main -Raw bytes (55): 0x[01, 01, 03, 01, 05, 01, 09, 01, 09, 09, 01, 08, 01, 00, 0a, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 12, 01, 00, 13, 00, 19, 01, 01, 0c, 00, 15, 05, 01, 0d, 00, 13, 02, 02, 0d, 00, 13, 0a, 03, 05, 00, 07, 0a, 01, 01, 00, 02] +Raw bytes (50): 0x[01, 01, 03, 01, 05, 01, 09, 01, 09, 08, 01, 08, 01, 00, 0a, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 1a, 01, 01, 0c, 00, 1c, 05, 00, 1d, 02, 0a, 02, 02, 10, 02, 0a, 0a, 04, 05, 00, 07, 0a, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/assert-ne.rs Number of expressions: 3 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) - expression 1 operands: lhs = Counter(0), rhs = Counter(2) - expression 2 operands: lhs = Counter(0), rhs = Counter(2) -Number of file 0 mappings: 9 +Number of file 0 mappings: 8 - Code(Counter(0)) at (prev + 8, 1) to (start + 0, 10) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 18) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 25) -- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 21) -- Code(Counter(1)) at (prev + 1, 13) to (start + 0, 19) -- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 28) +- Code(Counter(1)) at (prev + 0, 29) to (start + 2, 10) +- Code(Expression(0, Sub)) at (prev + 2, 16) to (start + 2, 10) = (c0 - c1) -- Code(Expression(2, Sub)) at (prev + 3, 5) to (start + 0, 7) +- Code(Expression(2, Sub)) at (prev + 4, 5) to (start + 0, 7) = (c0 - c2) - Code(Expression(2, Sub)) at (prev + 1, 1) to (start + 0, 2) = (c0 - c2) diff --git a/tests/coverage/assert-ne.coverage b/tests/coverage/assert-ne.coverage index fc43d4a8e06a0..8d67f46a04e3a 100644 --- a/tests/coverage/assert-ne.coverage +++ b/tests/coverage/assert-ne.coverage @@ -10,9 +10,9 @@ LL| 1| black_box(Foo(5)), // Make sure this expression's span isn't lost. LL| 1| if black_box(false) { LL| 0| Foo(0) // - LL| | } else { + LL| 1| } else { LL| 1| Foo(1) // - LL| | } + LL| 1| } LL| | ); LL| 1| () LL| 1|} diff --git a/tests/coverage/assert.cov-map b/tests/coverage/assert.cov-map index 543ab89628281..c0d166c394ff3 100644 --- a/tests/coverage/assert.cov-map +++ b/tests/coverage/assert.cov-map @@ -1,42 +1,80 @@ -Function name: assert::main -Raw bytes (76): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 0c, 01, 09, 01, 00, 1c, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 02, 0a, 06, 02, 13, 00, 20, 0d, 00, 21, 02, 0a, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02] +Function name: assert::assert_a_plain +Raw bytes (64): 0x[01, 01, 00, 0c, 01, 06, 01, 00, 25, 01, 01, 05, 00, 0c, 01, 00, 0d, 00, 1a, 05, 01, 05, 00, 0f, 05, 00, 10, 00, 13, 05, 00, 15, 00, 21, 09, 01, 05, 00, 0f, 09, 00, 10, 00, 13, 09, 00, 15, 00, 19, 0d, 01, 05, 00, 14, 0d, 00, 15, 00, 18, 11, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/assert.rs -Number of expressions: 6 -- expression 0 operands: lhs = Counter(1), rhs = Counter(0) -- expression 1 operands: lhs = Counter(1), rhs = Expression(5, Add) -- expression 2 operands: lhs = Counter(0), rhs = Counter(2) -- expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) -- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3) -- expression 5 operands: lhs = Counter(0), rhs = Counter(2) +Number of expressions: 0 +Number of file 0 mappings: 12 +- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 37) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 26) +- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(1)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(1)) at (prev + 0, 21) to (start + 0, 33) +- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(2)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(2)) at (prev + 0, 21) to (start + 0, 25) +- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 20) +- Code(Counter(3)) at (prev + 0, 21) to (start + 0, 24) +- Code(Counter(4)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c4 + +Function name: assert::assert_b_message +Raw bytes (64): 0x[01, 01, 00, 0c, 01, 0d, 01, 00, 27, 01, 01, 05, 00, 0c, 01, 00, 0d, 00, 1a, 05, 01, 05, 00, 0f, 05, 00, 10, 00, 13, 05, 00, 15, 00, 21, 09, 01, 05, 00, 0f, 09, 00, 10, 00, 13, 09, 00, 15, 00, 19, 0d, 01, 05, 00, 14, 0d, 00, 15, 00, 18, 11, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/assert.rs +Number of expressions: 0 Number of file 0 mappings: 12 -- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 28) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27) -- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 24) -- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 26) - = (c1 - c0) -- Code(Counter(2)) at (prev + 0, 27) to (start + 2, 10) -- Code(Expression(1, Sub)) at (prev + 2, 19) to (start + 0, 32) - = (c1 - (c0 + c2)) -- Code(Counter(3)) at (prev + 0, 33) to (start + 2, 10) -- Code(Expression(3, Sub)) at (prev + 2, 9) to (start + 0, 10) - = (c1 - ((c0 + c2) + c3)) -- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23) - = (c1 - c0) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 11) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c3 +- Code(Counter(0)) at (prev + 13, 1) to (start + 0, 39) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 26) +- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(1)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(1)) at (prev + 0, 21) to (start + 0, 33) +- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(2)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(2)) at (prev + 0, 21) to (start + 0, 25) +- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 20) +- Code(Counter(3)) at (prev + 0, 21) to (start + 0, 24) +- Code(Counter(4)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c4 -Function name: assert::might_fail_assert -Raw bytes (24): 0x[01, 01, 00, 04, 01, 04, 01, 00, 28, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 05, 01, 01, 00, 02] +Function name: assert::assert_c_format_inline +Raw bytes (64): 0x[01, 01, 00, 0c, 01, 14, 01, 00, 38, 01, 01, 05, 00, 0c, 01, 00, 0d, 00, 1a, 05, 01, 05, 00, 0f, 05, 00, 10, 00, 13, 05, 00, 15, 00, 21, 09, 01, 05, 00, 0f, 09, 00, 10, 00, 13, 09, 00, 15, 00, 19, 0d, 01, 05, 00, 14, 0d, 00, 15, 00, 18, 11, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/assert.rs Number of expressions: 0 -Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 40) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c1 +Number of file 0 mappings: 12 +- Code(Counter(0)) at (prev + 20, 1) to (start + 0, 56) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 26) +- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(1)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(1)) at (prev + 0, 21) to (start + 0, 33) +- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(2)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(2)) at (prev + 0, 21) to (start + 0, 25) +- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 20) +- Code(Counter(3)) at (prev + 0, 21) to (start + 0, 24) +- Code(Counter(4)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c4 + +Function name: assert::assert_d_format_arg +Raw bytes (64): 0x[01, 01, 00, 0c, 01, 1b, 01, 00, 35, 01, 01, 05, 00, 0c, 01, 00, 0d, 00, 1a, 05, 01, 05, 00, 0f, 05, 00, 10, 00, 13, 05, 00, 15, 00, 21, 09, 01, 05, 00, 0f, 09, 00, 10, 00, 13, 09, 00, 15, 00, 19, 0d, 01, 05, 00, 14, 0d, 00, 15, 00, 18, 11, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/assert.rs +Number of expressions: 0 +Number of file 0 mappings: 12 +- Code(Counter(0)) at (prev + 27, 1) to (start + 0, 53) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 26) +- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(1)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(1)) at (prev + 0, 21) to (start + 0, 33) +- Code(Counter(2)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(2)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(2)) at (prev + 0, 21) to (start + 0, 25) +- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 20) +- Code(Counter(3)) at (prev + 0, 21) to (start + 0, 24) +- Code(Counter(4)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c4 diff --git a/tests/coverage/assert.coverage b/tests/coverage/assert.coverage index 29a5b48c0566a..d9171fd705c99 100644 --- a/tests/coverage/assert.coverage +++ b/tests/coverage/assert.coverage @@ -1,33 +1,42 @@ - LL| |#![allow(unused_assignments)] - LL| |//@ failure-status: 101 + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 LL| | - LL| 4|fn might_fail_assert(one_plus_one: u32) { - LL| 4| println!("does 1 + 1 = {}?", one_plus_one); - LL| 4| assert_eq!(1 + 1, one_plus_one, "the argument was wrong"); - LL| 3|} + LL| |use core::assert_matches; LL| | - LL| 1|fn main() -> Result<(), u8> { - LL| 1| let mut countdown = 10; - LL| 10| while countdown > 0 { - LL| 9| if countdown == 1 { - LL| 1| might_fail_assert(3); - LL| 8| } else if countdown < 5 { - LL| 3| might_fail_assert(2); - LL| 5| } - LL| 9| countdown -= 1; - LL| | } - LL| 1| Ok(()) + LL| 1|fn assert_a_plain(opt: Option<&str>) { + LL| 1| assert!(opt.is_some()); + LL| 1| assert_eq!(opt, Some("true")); + LL| 1| assert_ne!(opt, None); + LL| 1| assert_matches!(opt, Some("true")); LL| 1|} LL| | - LL| |// Notes: - LL| |// 1. Compare this program and its coverage results to those of the very similar test - LL| |// `panic_unwind.rs`, and similar tests `abort.rs` and `try_error_result.rs`. - LL| |// 2. This test confirms the coverage generated when a program passes or fails an `assert!()` or - LL| |// related `assert_*!()` macro. - LL| |// 3. Notably, the `assert` macros *do not* generate `TerminatorKind::Assert`. The macros produce - LL| |// conditional expressions, `TerminatorKind::SwitchInt` branches, and a possible call to - LL| |// `begin_panic_fmt()` (that begins a panic unwind, if the assertion test fails). - LL| |// 4. `TerminatorKind::Assert` is, however, also present in the MIR generated for this test - LL| |// (and in many other coverage tests). The `Assert` terminator is typically generated by the - LL| |// Rust compiler to check for runtime failures, such as numeric overflows. + LL| 1|fn assert_b_message(opt: Option<&str>) { + LL| 1| assert!(opt.is_some(), "message"); + LL| 1| assert_eq!(opt, Some("true"), "message"); + LL| 1| assert_ne!(opt, None, "message"); + LL| 1| assert_matches!(opt, Some("true"), "message"); + LL| 1|} + LL| | + LL| 1|fn assert_c_format_inline(opt: Option<&str>, msg: &str) { + LL| 1| assert!(opt.is_some(), "message: {msg}"); + LL| 1| assert_eq!(opt, Some("true"), "message: {msg}"); + LL| 1| assert_ne!(opt, None, "message: {msg}"); + LL| 1| assert_matches!(opt, Some("true"), "message: {msg}"); + LL| 1|} + LL| | + LL| 1|fn assert_d_format_arg(opt: Option<&str>, msg: &str) { + LL| 1| assert!(opt.is_some(), "message: {}", msg); + LL| 1| assert_eq!(opt, Some("true"), "message: {}", msg); + LL| 1| assert_ne!(opt, None, "message: {}", msg); + LL| 1| assert_matches!(opt, Some("true"), "message: {}", msg); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let opt = core::hint::black_box(Some("true")); + LL| | assert_a_plain(opt); + LL| | assert_b_message(opt); + LL| | assert_c_format_inline(opt, "message"); + LL| | assert_d_format_arg(opt, "message"); + LL| |} diff --git a/tests/coverage/assert.rs b/tests/coverage/assert.rs index 30d511f8f7a89..9c3151ba4ce17 100644 --- a/tests/coverage/assert.rs +++ b/tests/coverage/assert.rs @@ -1,32 +1,41 @@ -#![allow(unused_assignments)] -//@ failure-status: 101 +#![feature(coverage_attribute)] +//@ edition: 2024 -fn might_fail_assert(one_plus_one: u32) { - println!("does 1 + 1 = {}?", one_plus_one); - assert_eq!(1 + 1, one_plus_one, "the argument was wrong"); +use core::assert_matches; + +fn assert_a_plain(opt: Option<&str>) { + assert!(opt.is_some()); + assert_eq!(opt, Some("true")); + assert_ne!(opt, None); + assert_matches!(opt, Some("true")); +} + +fn assert_b_message(opt: Option<&str>) { + assert!(opt.is_some(), "message"); + assert_eq!(opt, Some("true"), "message"); + assert_ne!(opt, None, "message"); + assert_matches!(opt, Some("true"), "message"); } -fn main() -> Result<(), u8> { - let mut countdown = 10; - while countdown > 0 { - if countdown == 1 { - might_fail_assert(3); - } else if countdown < 5 { - might_fail_assert(2); - } - countdown -= 1; - } - Ok(()) +fn assert_c_format_inline(opt: Option<&str>, msg: &str) { + assert!(opt.is_some(), "message: {msg}"); + assert_eq!(opt, Some("true"), "message: {msg}"); + assert_ne!(opt, None, "message: {msg}"); + assert_matches!(opt, Some("true"), "message: {msg}"); } -// Notes: -// 1. Compare this program and its coverage results to those of the very similar test -// `panic_unwind.rs`, and similar tests `abort.rs` and `try_error_result.rs`. -// 2. This test confirms the coverage generated when a program passes or fails an `assert!()` or -// related `assert_*!()` macro. -// 3. Notably, the `assert` macros *do not* generate `TerminatorKind::Assert`. The macros produce -// conditional expressions, `TerminatorKind::SwitchInt` branches, and a possible call to -// `begin_panic_fmt()` (that begins a panic unwind, if the assertion test fails). -// 4. `TerminatorKind::Assert` is, however, also present in the MIR generated for this test -// (and in many other coverage tests). The `Assert` terminator is typically generated by the -// Rust compiler to check for runtime failures, such as numeric overflows. +fn assert_d_format_arg(opt: Option<&str>, msg: &str) { + assert!(opt.is_some(), "message: {}", msg); + assert_eq!(opt, Some("true"), "message: {}", msg); + assert_ne!(opt, None, "message: {}", msg); + assert_matches!(opt, Some("true"), "message: {}", msg); +} + +#[coverage(off)] +fn main() { + let opt = core::hint::black_box(Some("true")); + assert_a_plain(opt); + assert_b_message(opt); + assert_c_format_inline(opt, "message"); + assert_d_format_arg(opt, "message"); +} diff --git a/tests/coverage/async.cov-map b/tests/coverage/async/async.cov-map similarity index 79% rename from tests/coverage/async.cov-map rename to tests/coverage/async/async.cov-map index b4304a43d64e6..07722437e1e14 100644 --- a/tests/coverage/async.cov-map +++ b/tests/coverage/async/async.cov-map @@ -8,7 +8,7 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: async::c::{closure#0} -Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 0b, 19, 00, 1a, 01, 01, 08, 00, 0e, 05, 01, 09, 00, 0a, 02, 02, 09, 00, 0a, 01, 02, 01, 00, 02] +Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 0b, 19, 00, 1a, 01, 01, 08, 00, 0e, 05, 00, 0f, 02, 06, 02, 02, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async.rs Number of expressions: 1 @@ -16,10 +16,10 @@ Number of expressions: 1 Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 11, 25) to (start + 0, 26) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 14) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 10) -- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10) +- Code(Counter(1)) at (prev + 0, 15) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 2, 6) = (c0 - c1) -- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) Highest counter ID seen: c1 Function name: async::d @@ -112,19 +112,19 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: async::g::{closure#0} (unused) -Raw bytes (64): 0x[01, 01, 00, 0c, 00, 1b, 13, 00, 14, 00, 01, 0b, 00, 0c, 00, 01, 09, 00, 0a, 00, 00, 0e, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 09, 00, 0a, 00, 00, 0e, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02] +Raw bytes (64): 0x[01, 01, 00, 0c, 00, 1b, 13, 00, 14, 00, 01, 0b, 00, 0c, 00, 01, 0e, 00, 11, 00, 00, 12, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 11, 00, 00, 12, 00, 17, 00, 00, 1b, 00, 1c, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async.rs Number of expressions: 0 Number of file 0 mappings: 12 - Code(Zero) at (prev + 27, 19) to (start + 0, 20) - Code(Zero) at (prev + 1, 11) to (start + 0, 12) -- Code(Zero) at (prev + 1, 9) to (start + 0, 10) -- Code(Zero) at (prev + 0, 14) to (start + 0, 23) +- Code(Zero) at (prev + 1, 14) to (start + 0, 17) +- Code(Zero) at (prev + 0, 18) to (start + 0, 23) - Code(Zero) at (prev + 0, 27) to (start + 0, 28) - Code(Zero) at (prev + 0, 32) to (start + 0, 34) -- Code(Zero) at (prev + 1, 9) to (start + 0, 10) -- Code(Zero) at (prev + 0, 14) to (start + 0, 23) +- Code(Zero) at (prev + 1, 14) to (start + 0, 17) +- Code(Zero) at (prev + 0, 18) to (start + 0, 23) - Code(Zero) at (prev + 0, 27) to (start + 0, 28) - Code(Zero) at (prev + 0, 32) to (start + 0, 34) - Code(Zero) at (prev + 1, 14) to (start + 0, 16) @@ -141,15 +141,15 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: async::h::{closure#0} (unused) -Raw bytes (44): 0x[01, 01, 00, 08, 00, 23, 16, 00, 17, 00, 03, 0b, 00, 0c, 00, 01, 09, 00, 0a, 00, 00, 0e, 00, 19, 00, 00, 1a, 00, 1b, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02] +Raw bytes (44): 0x[01, 01, 00, 08, 00, 23, 16, 00, 17, 00, 03, 0b, 00, 0c, 00, 01, 0e, 00, 13, 00, 00, 14, 00, 19, 00, 00, 1a, 00, 1b, 00, 00, 20, 00, 22, 00, 01, 0e, 00, 10, 00, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async.rs Number of expressions: 0 Number of file 0 mappings: 8 - Code(Zero) at (prev + 35, 22) to (start + 0, 23) - Code(Zero) at (prev + 3, 11) to (start + 0, 12) -- Code(Zero) at (prev + 1, 9) to (start + 0, 10) -- Code(Zero) at (prev + 0, 14) to (start + 0, 25) +- Code(Zero) at (prev + 1, 14) to (start + 0, 19) +- Code(Zero) at (prev + 0, 20) to (start + 0, 25) - Code(Zero) at (prev + 0, 26) to (start + 0, 27) - Code(Zero) at (prev + 0, 32) to (start + 0, 34) - Code(Zero) at (prev + 1, 14) to (start + 0, 16) @@ -166,7 +166,7 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: async::i::{closure#0} -Raw bytes (75): 0x[01, 01, 03, 05, 09, 11, 15, 0d, 11, 0d, 01, 2c, 13, 00, 14, 01, 04, 0b, 00, 0c, 09, 01, 09, 00, 0a, 01, 00, 0e, 00, 18, 01, 00, 0e, 00, 0f, 05, 00, 1c, 00, 21, 09, 00, 27, 00, 30, 15, 01, 09, 00, 0a, 02, 00, 0e, 00, 17, 11, 00, 1b, 00, 20, 15, 00, 24, 00, 26, 06, 01, 0e, 00, 10, 0b, 02, 01, 00, 02] +Raw bytes (75): 0x[01, 01, 03, 05, 09, 11, 15, 0d, 11, 0d, 01, 2c, 13, 00, 14, 01, 04, 0b, 00, 0c, 01, 01, 0e, 00, 12, 01, 00, 13, 00, 18, 05, 00, 1c, 00, 21, 09, 00, 27, 00, 2a, 09, 00, 2b, 00, 30, 02, 01, 0e, 00, 11, 02, 00, 12, 00, 17, 11, 00, 1b, 00, 20, 15, 00, 24, 00, 26, 06, 01, 0e, 00, 10, 0b, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async.rs Number of expressions: 3 @@ -176,13 +176,14 @@ Number of expressions: 3 Number of file 0 mappings: 13 - Code(Counter(0)) at (prev + 44, 19) to (start + 0, 20) - Code(Counter(0)) at (prev + 4, 11) to (start + 0, 12) -- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 24) -- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 15) +- Code(Counter(0)) at (prev + 1, 14) to (start + 0, 18) +- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 24) - Code(Counter(1)) at (prev + 0, 28) to (start + 0, 33) -- Code(Counter(2)) at (prev + 0, 39) to (start + 0, 48) -- Code(Counter(5)) at (prev + 1, 9) to (start + 0, 10) -- Code(Expression(0, Sub)) at (prev + 0, 14) to (start + 0, 23) +- Code(Counter(2)) at (prev + 0, 39) to (start + 0, 42) +- Code(Counter(2)) at (prev + 0, 43) to (start + 0, 48) +- Code(Expression(0, Sub)) at (prev + 1, 14) to (start + 0, 17) + = (c1 - c2) +- Code(Expression(0, Sub)) at (prev + 0, 18) to (start + 0, 23) = (c1 - c2) - Code(Counter(4)) at (prev + 0, 27) to (start + 0, 32) - Code(Counter(5)) at (prev + 0, 36) to (start + 0, 38) @@ -193,22 +194,22 @@ Number of file 0 mappings: 13 Highest counter ID seen: c5 Function name: async::j -Raw bytes (65): 0x[01, 01, 03, 01, 05, 01, 0b, 05, 09, 0b, 01, 37, 01, 00, 0c, 01, 0b, 0b, 00, 0c, 05, 01, 09, 00, 0a, 01, 00, 0e, 00, 1b, 01, 00, 0e, 00, 0f, 05, 00, 1f, 00, 27, 09, 01, 09, 00, 0a, 02, 00, 0e, 00, 1a, 09, 00, 1e, 00, 20, 06, 01, 0e, 00, 10, 01, 02, 01, 00, 02] +Raw bytes (60): 0x[01, 01, 03, 01, 05, 01, 0b, 05, 09, 0a, 01, 37, 01, 00, 0c, 01, 0b, 0b, 00, 0c, 01, 01, 0e, 00, 1b, 01, 00, 0e, 00, 12, 05, 00, 1f, 00, 27, 02, 01, 0e, 00, 1a, 02, 00, 0e, 00, 11, 09, 00, 1e, 00, 20, 06, 01, 0e, 00, 10, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async.rs Number of expressions: 3 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) - expression 1 operands: lhs = Counter(0), rhs = Expression(2, Add) - expression 2 operands: lhs = Counter(1), rhs = Counter(2) -Number of file 0 mappings: 11 +Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 55, 1) to (start + 0, 12) - Code(Counter(0)) at (prev + 11, 11) to (start + 0, 12) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 27) -- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 15) +- Code(Counter(0)) at (prev + 1, 14) to (start + 0, 27) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 18) - Code(Counter(1)) at (prev + 0, 31) to (start + 0, 39) -- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 10) -- Code(Expression(0, Sub)) at (prev + 0, 14) to (start + 0, 26) +- Code(Expression(0, Sub)) at (prev + 1, 14) to (start + 0, 26) + = (c0 - c1) +- Code(Expression(0, Sub)) at (prev + 0, 14) to (start + 0, 17) = (c0 - c1) - Code(Counter(2)) at (prev + 0, 30) to (start + 0, 32) - Code(Expression(1, Sub)) at (prev + 1, 14) to (start + 0, 16) @@ -217,7 +218,7 @@ Number of file 0 mappings: 11 Highest counter ID seen: c2 Function name: async::j::c -Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 39, 05, 00, 16, 01, 01, 0c, 00, 12, 05, 01, 0d, 00, 0e, 02, 02, 0d, 00, 0e, 01, 02, 05, 00, 06] +Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 39, 05, 00, 16, 01, 01, 0c, 00, 12, 05, 00, 13, 02, 0a, 02, 02, 10, 02, 0a, 01, 03, 05, 00, 06] Number of files: 1 - file 0 => $DIR/async.rs Number of expressions: 1 @@ -225,10 +226,10 @@ Number of expressions: 1 Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 57, 5) to (start + 0, 22) - Code(Counter(0)) at (prev + 1, 12) to (start + 0, 18) -- Code(Counter(1)) at (prev + 1, 13) to (start + 0, 14) -- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 14) +- Code(Counter(1)) at (prev + 0, 19) to (start + 2, 10) +- Code(Expression(0, Sub)) at (prev + 2, 16) to (start + 2, 10) = (c0 - c1) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 6) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 6) Highest counter ID seen: c1 Function name: async::j::d @@ -305,23 +306,20 @@ Number of file 0 mappings: 3 Highest counter ID seen: (none) Function name: async::main -Raw bytes (69): 0x[01, 01, 00, 0d, 01, 5b, 01, 00, 0a, 01, 01, 0d, 00, 12, 01, 01, 0d, 00, 11, 01, 01, 09, 00, 13, 01, 00, 16, 00, 1e, 01, 00, 1f, 00, 20, 01, 01, 05, 00, 06, 01, 01, 05, 00, 06, 01, 01, 0d, 00, 11, 01, 01, 05, 00, 17, 01, 00, 18, 00, 1e, 01, 00, 1f, 00, 25, 01, 01, 01, 00, 02] +Raw bytes (54): 0x[01, 01, 00, 0a, 01, 5b, 01, 00, 0a, 01, 01, 0d, 00, 12, 01, 01, 0d, 00, 11, 01, 01, 16, 00, 24, 01, 00, 16, 00, 1e, 01, 01, 05, 00, 09, 01, 01, 05, 00, 09, 01, 01, 0d, 00, 11, 01, 01, 05, 00, 28, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async.rs Number of expressions: 0 -Number of file 0 mappings: 13 +Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 91, 1) to (start + 0, 10) - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 18) - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 17) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 22) to (start + 0, 36) - Code(Counter(0)) at (prev + 0, 22) to (start + 0, 30) -- Code(Counter(0)) at (prev + 0, 31) to (start + 0, 32) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 9) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 9) - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 17) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 23) -- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) -- Code(Counter(0)) at (prev + 0, 31) to (start + 0, 37) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 40) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/async.coverage b/tests/coverage/async/async.coverage similarity index 92% rename from tests/coverage/async.coverage rename to tests/coverage/async/async.coverage index fe1a353b5f1a1..77dab99ba7bf0 100644 --- a/tests/coverage/async.coverage +++ b/tests/coverage/async/async.coverage @@ -11,9 +11,9 @@ LL| 1|async fn c(x: u8) -> u8 { LL| 1| if x == 8 { LL| 1| 1 - LL| | } else { + LL| 1| } else { LL| 0| 0 - LL| | } + LL| 0| } LL| 1|} LL| | LL| 0|async fn d() -> u8 { 1 } @@ -49,9 +49,9 @@ LL| | // executed asynchronously. LL| 1| match x { LL| 1| y if c(x).await == y + 1 => { d().await; } - ^0 ^0 + ^0 ^0 LL| 1| y if f().await == y + 1 => (), - ^0 ^0 + ^0 LL| 1| _ => (), LL| | } LL| 1|} @@ -61,17 +61,17 @@ LL| 1| fn c(x: u8) -> u8 { LL| 1| if x == 8 { LL| 0| 1 - LL| | } else { + LL| 1| } else { LL| 1| 0 - LL| | } + LL| 1| } LL| 1| } LL| 0| fn d() -> u8 { 1 } // inner function is defined in-line, but the function is not executed LL| 1| fn f() -> u8 { 1 } LL| 1| match x { LL| 1| y if c(x) == y + 1 => { d(); } - ^0 ^0 + ^0 LL| 1| y if f() == y + 1 => (), - ^0 ^0 + ^0 LL| 1| _ => (), LL| | } LL| 1|} diff --git a/tests/coverage/async.rs b/tests/coverage/async/async.rs similarity index 100% rename from tests/coverage/async.rs rename to tests/coverage/async/async.rs diff --git a/tests/coverage/async2.cov-map b/tests/coverage/async/async2.cov-map similarity index 71% rename from tests/coverage/async2.cov-map rename to tests/coverage/async/async2.cov-map index 9fb5e8e4ef37e..31e2275b9f045 100644 --- a/tests/coverage/async2.cov-map +++ b/tests/coverage/async/async2.cov-map @@ -8,15 +8,15 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: async2::async_func::{closure#0} -Raw bytes (44): 0x[01, 01, 00, 08, 01, 0f, 17, 00, 18, 01, 01, 05, 00, 0d, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 11, 01, 01, 08, 00, 09, 01, 00, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02] +Raw bytes (44): 0x[01, 01, 00, 08, 01, 0f, 17, 00, 18, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 26, 01, 01, 0d, 00, 11, 01, 01, 08, 00, 09, 01, 00, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async2.rs Number of expressions: 0 Number of file 0 mappings: 8 - Code(Counter(0)) at (prev + 15, 23) to (start + 0, 24) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 17) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 38) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 9) - Code(Counter(0)) at (prev + 0, 10) to (start + 2, 6) - Code(Zero) at (prev + 2, 5) to (start + 0, 6) @@ -33,42 +33,42 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: async2::async_func_just_println::{closure#0} -Raw bytes (19): 0x[01, 01, 00, 03, 01, 17, 24, 00, 25, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 17, 24, 00, 25, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 33, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async2.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 23, 36) to (start + 0, 37) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 51) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: async2::main -Raw bytes (44): 0x[01, 01, 00, 08, 01, 1b, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 02, 05, 00, 13, 01, 02, 05, 00, 17, 01, 00, 18, 00, 22, 01, 01, 05, 00, 17, 01, 00, 18, 00, 2f, 01, 01, 01, 00, 02] +Raw bytes (39): 0x[01, 01, 00, 07, 01, 1b, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 23, 01, 02, 05, 00, 15, 01, 02, 05, 00, 25, 01, 01, 05, 00, 32, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async2.rs Number of expressions: 0 -Number of file 0 mappings: 8 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 27, 1) to (start + 0, 10) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 19) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 23) -- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 34) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 23) -- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 47) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 35) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 21) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 37) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 50) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: async2::non_async_func -Raw bytes (44): 0x[01, 01, 00, 08, 01, 07, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 11, 01, 01, 08, 00, 09, 01, 00, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02] +Raw bytes (44): 0x[01, 01, 00, 08, 01, 07, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 2a, 01, 01, 0d, 00, 11, 01, 01, 08, 00, 09, 01, 00, 0a, 02, 06, 00, 02, 05, 00, 06, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async2.rs Number of expressions: 0 Number of file 0 mappings: 8 - Code(Counter(0)) at (prev + 7, 1) to (start + 0, 20) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 17) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 42) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 9) - Code(Counter(0)) at (prev + 0, 10) to (start + 2, 6) - Code(Zero) at (prev + 2, 5) to (start + 0, 6) diff --git a/tests/coverage/async2.coverage b/tests/coverage/async/async2.coverage similarity index 100% rename from tests/coverage/async2.coverage rename to tests/coverage/async/async2.coverage diff --git a/tests/coverage/async2.rs b/tests/coverage/async/async2.rs similarity index 100% rename from tests/coverage/async2.rs rename to tests/coverage/async/async2.rs diff --git a/tests/coverage/async_block.cov-map b/tests/coverage/async/async_block.cov-map similarity index 63% rename from tests/coverage/async_block.cov-map rename to tests/coverage/async/async_block.cov-map index 08f5a7b5d79ee..25298583b770c 100644 --- a/tests/coverage/async_block.cov-map +++ b/tests/coverage/async/async_block.cov-map @@ -1,19 +1,13 @@ Function name: async_block::main -Raw bytes (41): 0x[01, 01, 01, 05, 01, 07, 01, 07, 01, 00, 0a, 02, 01, 09, 00, 0a, 01, 00, 0e, 00, 13, 02, 01, 0d, 00, 13, 02, 07, 09, 00, 1b, 02, 00, 1c, 00, 22, 01, 02, 01, 00, 02] +Raw bytes (26): 0x[01, 01, 01, 05, 01, 04, 01, 07, 01, 00, 0a, 01, 01, 0e, 00, 13, 02, 08, 09, 00, 23, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async_block.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(1), rhs = Counter(0) -Number of file 0 mappings: 7 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 7, 1) to (start + 0, 10) -- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 10) - = (c1 - c0) -- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 19) -- Code(Expression(0, Sub)) at (prev + 1, 13) to (start + 0, 19) - = (c1 - c0) -- Code(Expression(0, Sub)) at (prev + 7, 9) to (start + 0, 27) - = (c1 - c0) -- Code(Expression(0, Sub)) at (prev + 0, 28) to (start + 0, 34) +- Code(Counter(0)) at (prev + 1, 14) to (start + 0, 19) +- Code(Expression(0, Sub)) at (prev + 8, 9) to (start + 0, 35) = (c1 - c0) - Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/async_block.coverage b/tests/coverage/async/async_block.coverage similarity index 89% rename from tests/coverage/async_block.coverage rename to tests/coverage/async/async_block.coverage index 29d90931fa8df..e9aa9f1924f6f 100644 --- a/tests/coverage/async_block.coverage +++ b/tests/coverage/async/async_block.coverage @@ -5,8 +5,7 @@ LL| |extern crate executor; LL| | LL| 1|fn main() { - LL| 16| for i in 0..16 { - ^1 + LL| 1| for i in 0..16 { LL| 16| let future = async { LL| 16| if i >= 12 { LL| 4| println!("big"); diff --git a/tests/coverage/async_block.rs b/tests/coverage/async/async_block.rs similarity index 100% rename from tests/coverage/async_block.rs rename to tests/coverage/async/async_block.rs diff --git a/tests/coverage/async_closure.cov-map b/tests/coverage/async/async_closure.cov-map similarity index 50% rename from tests/coverage/async_closure.cov-map rename to tests/coverage/async/async_closure.cov-map index 53128dd7a48b0..01d33321c6ba8 100644 --- a/tests/coverage/async_closure.cov-map +++ b/tests/coverage/async/async_closure.cov-map @@ -1,65 +1,63 @@ Function name: async_closure::call_once:: -Raw bytes (9): 0x[01, 01, 00, 01, 01, 06, 01, 00, 2a] +Raw bytes (9): 0x[01, 01, 00, 01, 01, 07, 01, 00, 2a] Number of files: 1 - file 0 => $DIR/async_closure.rs Number of expressions: 0 Number of file 0 mappings: 1 -- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 42) +- Code(Counter(0)) at (prev + 7, 1) to (start + 0, 42) Highest counter ID seen: c0 Function name: async_closure::call_once::::{closure#0} -Raw bytes (21): 0x[01, 01, 01, 05, 09, 03, 01, 06, 2b, 00, 2c, 01, 01, 05, 00, 0e, 02, 01, 01, 00, 02] +Raw bytes (26): 0x[01, 01, 01, 05, 09, 04, 01, 07, 2b, 00, 2c, 01, 01, 05, 00, 08, 01, 00, 09, 00, 0e, 02, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async_closure.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(1), rhs = Counter(2) -Number of file 0 mappings: 3 -- Code(Counter(0)) at (prev + 6, 43) to (start + 0, 44) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 7, 43) to (start + 0, 44) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 14) - Code(Expression(0, Sub)) at (prev + 1, 1) to (start + 0, 2) = (c1 - c2) Highest counter ID seen: c0 Function name: async_closure::main -Raw bytes (44): 0x[01, 01, 00, 08, 01, 0a, 01, 00, 0e, 01, 01, 09, 00, 16, 01, 01, 05, 00, 17, 01, 00, 18, 00, 27, 01, 01, 05, 00, 17, 01, 00, 18, 00, 21, 01, 00, 22, 00, 2f, 01, 01, 01, 00, 02] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 0b, 01, 00, 0e, 01, 02, 05, 00, 28, 01, 01, 05, 00, 31, 01, 00, 05, 00, 17, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/async_closure.rs Number of expressions: 0 -Number of file 0 mappings: 8 -- Code(Counter(0)) at (prev + 10, 1) to (start + 0, 14) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 23) -- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 39) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 23) -- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 33) -- Code(Counter(0)) at (prev + 0, 34) to (start + 0, 47) +Number of file 0 mappings: 5 +- Code(Counter(0)) at (prev + 11, 1) to (start + 0, 14) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 40) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 49) +- Code(Counter(0)) at (prev + 0, 5) to (start + 0, 23) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: async_closure::main::{closure#0} -Raw bytes (9): 0x[01, 01, 00, 01, 01, 0b, 22, 00, 24] +Raw bytes (9): 0x[01, 01, 00, 01, 01, 0c, 22, 00, 24] Number of files: 1 - file 0 => $DIR/async_closure.rs Number of expressions: 0 Number of file 0 mappings: 1 -- Code(Counter(0)) at (prev + 11, 34) to (start + 0, 36) +- Code(Counter(0)) at (prev + 12, 34) to (start + 0, 36) Highest counter ID seen: c0 Function name: async_closure::main::{closure#0} -Raw bytes (9): 0x[01, 01, 00, 01, 01, 0b, 22, 00, 24] +Raw bytes (9): 0x[01, 01, 00, 01, 01, 0c, 22, 00, 24] Number of files: 1 - file 0 => $DIR/async_closure.rs Number of expressions: 0 Number of file 0 mappings: 1 -- Code(Counter(0)) at (prev + 11, 34) to (start + 0, 36) +- Code(Counter(0)) at (prev + 12, 34) to (start + 0, 36) Highest counter ID seen: c0 Function name: async_closure::main::{closure#0}::{closure#0}:: -Raw bytes (9): 0x[01, 01, 00, 01, 01, 0b, 22, 00, 24] +Raw bytes (9): 0x[01, 01, 00, 01, 01, 0c, 22, 00, 24] Number of files: 1 - file 0 => $DIR/async_closure.rs Number of expressions: 0 Number of file 0 mappings: 1 -- Code(Counter(0)) at (prev + 11, 34) to (start + 0, 36) +- Code(Counter(0)) at (prev + 12, 34) to (start + 0, 36) Highest counter ID seen: c0 diff --git a/tests/coverage/async_closure.coverage b/tests/coverage/async/async_closure.coverage similarity index 95% rename from tests/coverage/async_closure.coverage rename to tests/coverage/async/async_closure.coverage index 14f043415eaca..47d02eafd1ddb 100644 --- a/tests/coverage/async_closure.coverage +++ b/tests/coverage/async/async_closure.coverage @@ -1,4 +1,5 @@ LL| |//@ edition: 2021 + LL| |//@ min-llvm-version: 23 LL| | LL| |//@ aux-build: executor.rs LL| |extern crate executor; @@ -9,7 +10,6 @@ LL| | LL| 1|pub fn main() { LL| 3| let async_closure = async || {}; - ^1 ------------------ | async_closure::main::{closure#0}: | LL| 1| let async_closure = async || {}; diff --git a/tests/coverage/async_closure.rs b/tests/coverage/async/async_closure.rs similarity index 91% rename from tests/coverage/async_closure.rs rename to tests/coverage/async/async_closure.rs index 85c5df1f1abb8..59f7118fd64c2 100644 --- a/tests/coverage/async_closure.rs +++ b/tests/coverage/async/async_closure.rs @@ -1,4 +1,5 @@ //@ edition: 2021 +//@ min-llvm-version: 23 //@ aux-build: executor.rs extern crate executor; diff --git a/tests/coverage/async/async_closure2.cov-map b/tests/coverage/async/async_closure2.cov-map new file mode 100644 index 0000000000000..c7fad7e1096e3 --- /dev/null +++ b/tests/coverage/async/async_closure2.cov-map @@ -0,0 +1,66 @@ +Function name: async_closure2::call_once:: +Raw bytes (9): 0x[01, 01, 00, 01, 01, 0d, 01, 00, 2a] +Number of files: 1 +- file 0 => $DIR/async_closure2.rs +Number of expressions: 0 +Number of file 0 mappings: 1 +- Code(Counter(0)) at (prev + 13, 1) to (start + 0, 42) +Highest counter ID seen: c0 + +Function name: async_closure2::call_once::::{closure#0} +Raw bytes (26): 0x[01, 01, 01, 05, 09, 04, 01, 0d, 2b, 00, 2c, 01, 01, 05, 00, 08, 01, 00, 09, 00, 0e, 02, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/async_closure2.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(1), rhs = Counter(2) +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 13, 43) to (start + 0, 44) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 14) +- Code(Expression(0, Sub)) at (prev + 1, 1) to (start + 0, 2) + = (c1 - c2) +Highest counter ID seen: c0 + +Function name: async_closure2::main +Raw bytes (39): 0x[01, 01, 00, 07, 01, 11, 01, 00, 0e, 01, 05, 05, 00, 31, 01, 00, 05, 00, 17, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 2c, 01, 00, 2e, 00, 2f, 05, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/async_closure2.rs +Number of expressions: 0 +Number of file 0 mappings: 7 +- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 14) +- Code(Counter(0)) at (prev + 5, 5) to (start + 0, 49) +- Code(Counter(0)) at (prev + 0, 5) to (start + 0, 23) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 44) +- Code(Counter(0)) at (prev + 0, 46) to (start + 0, 47) +- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 + +Function name: async_closure2::main::{closure#0} +Raw bytes (34): 0x[01, 01, 00, 06, 01, 12, 22, 00, 23, 01, 01, 09, 00, 2d, 01, 00, 09, 00, 0e, 01, 01, 09, 00, 2d, 01, 00, 09, 00, 0e, 01, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/async_closure2.rs +Number of expressions: 0 +Number of file 0 mappings: 6 +- Code(Counter(0)) at (prev + 18, 34) to (start + 0, 35) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 45) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 14) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 45) +- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 14) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: c0 + +Function name: async_closure2::main::{closure#0}::{closure#0}::<_> (unused) +Raw bytes (34): 0x[01, 01, 00, 06, 00, 12, 22, 00, 23, 00, 01, 09, 00, 2d, 00, 00, 09, 00, 0e, 00, 01, 09, 00, 2d, 00, 00, 09, 00, 0e, 00, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/async_closure2.rs +Number of expressions: 0 +Number of file 0 mappings: 6 +- Code(Zero) at (prev + 18, 34) to (start + 0, 35) +- Code(Zero) at (prev + 1, 9) to (start + 0, 45) +- Code(Zero) at (prev + 0, 9) to (start + 0, 14) +- Code(Zero) at (prev + 1, 9) to (start + 0, 45) +- Code(Zero) at (prev + 0, 9) to (start + 0, 14) +- Code(Zero) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: (none) + diff --git a/tests/coverage/async_closure2.coverage b/tests/coverage/async/async_closure2.coverage similarity index 97% rename from tests/coverage/async_closure2.coverage rename to tests/coverage/async/async_closure2.coverage index cd79b303fb66c..5e3cb3e200acf 100644 --- a/tests/coverage/async_closure2.coverage +++ b/tests/coverage/async/async_closure2.coverage @@ -1,6 +1,7 @@ LL| |// Regression test for . LL| | LL| |//@ edition: 2021 + LL| |//@ min-llvm-version: 23 LL| | LL| |//@ aux-build: executor.rs LL| |extern crate executor; diff --git a/tests/coverage/async_closure2.rs b/tests/coverage/async/async_closure2.rs similarity index 95% rename from tests/coverage/async_closure2.rs rename to tests/coverage/async/async_closure2.rs index 01e268d928d34..dcb7a5de8ca2d 100644 --- a/tests/coverage/async_closure2.rs +++ b/tests/coverage/async/async_closure2.rs @@ -1,6 +1,7 @@ // Regression test for . //@ edition: 2021 +//@ min-llvm-version: 23 //@ aux-build: executor.rs extern crate executor; diff --git a/tests/coverage/auxiliary/executor.rs b/tests/coverage/async/auxiliary/executor.rs similarity index 100% rename from tests/coverage/auxiliary/executor.rs rename to tests/coverage/async/auxiliary/executor.rs diff --git a/tests/coverage/await_ready.cov-map b/tests/coverage/async/await_ready.cov-map similarity index 63% rename from tests/coverage/await_ready.cov-map rename to tests/coverage/async/await_ready.cov-map index a7eb051ff0938..fe0612bb5ad27 100644 --- a/tests/coverage/await_ready.cov-map +++ b/tests/coverage/async/await_ready.cov-map @@ -8,15 +8,16 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: await_ready::await_ready::{closure#0} -Raw bytes (21): 0x[01, 01, 01, 05, 09, 03, 01, 0e, 1e, 00, 1f, 01, 02, 05, 01, 0f, 02, 02, 01, 00, 02] +Raw bytes (26): 0x[01, 01, 01, 05, 09, 04, 01, 0e, 1e, 00, 1f, 01, 02, 05, 00, 0c, 01, 01, 0a, 00, 0f, 02, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/await_ready.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(1), rhs = Counter(2) -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 14, 30) to (start + 0, 31) -- Code(Counter(0)) at (prev + 2, 5) to (start + 1, 15) -- Code(Expression(0, Sub)) at (prev + 2, 1) to (start + 0, 2) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 1, 10) to (start + 0, 15) +- Code(Expression(0, Sub)) at (prev + 1, 1) to (start + 0, 2) = (c1 - c2) Highest counter ID seen: c0 diff --git a/tests/coverage/await_ready.coverage b/tests/coverage/async/await_ready.coverage similarity index 100% rename from tests/coverage/await_ready.coverage rename to tests/coverage/async/await_ready.coverage diff --git a/tests/coverage/await_ready.rs b/tests/coverage/async/await_ready.rs similarity index 100% rename from tests/coverage/await_ready.rs rename to tests/coverage/async/await_ready.rs diff --git a/tests/coverage/closure_macro_async.cov-map b/tests/coverage/async/closure_macro_async.cov-map similarity index 63% rename from tests/coverage/closure_macro_async.cov-map rename to tests/coverage/async/closure_macro_async.cov-map index b6dd4a930c78e..2249ae3287961 100644 --- a/tests/coverage/closure_macro_async.cov-map +++ b/tests/coverage/async/closure_macro_async.cov-map @@ -19,22 +19,19 @@ Number of file 0 mappings: 1 Highest counter ID seen: c0 Function name: closure_macro_async::test::{closure#0} -Raw bytes (61): 0x[01, 01, 01, 01, 05, 0b, 01, 25, 2b, 00, 2c, 01, 01, 05, 00, 0d, 02, 01, 09, 00, 0f, 01, 00, 12, 00, 1b, 01, 00, 1c, 00, 34, 05, 00, 54, 00, 55, 02, 02, 09, 00, 1f, 02, 00, 22, 00, 2e, 02, 01, 0d, 00, 2d, 02, 01, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (56): 0x[01, 01, 01, 01, 05, 0a, 01, 25, 2b, 00, 2c, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 20, 01, 01, 12, 00, 1b, 01, 00, 1c, 00, 36, 05, 00, 54, 00, 55, 02, 02, 22, 00, 35, 02, 01, 0d, 00, 2d, 02, 01, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/closure_macro_async.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 11 +Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 37, 43) to (start + 0, 44) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) - = (c0 - c1) -- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 27) -- Code(Counter(0)) at (prev + 0, 28) to (start + 0, 52) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 32) +- Code(Counter(0)) at (prev + 1, 18) to (start + 0, 27) +- Code(Counter(0)) at (prev + 0, 28) to (start + 0, 54) - Code(Counter(1)) at (prev + 0, 84) to (start + 0, 85) -- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 31) - = (c0 - c1) -- Code(Expression(0, Sub)) at (prev + 0, 34) to (start + 0, 46) +- Code(Expression(0, Sub)) at (prev + 2, 34) to (start + 0, 53) = (c0 - c1) - Code(Expression(0, Sub)) at (prev + 1, 13) to (start + 0, 45) = (c0 - c1) @@ -44,19 +41,20 @@ Number of file 0 mappings: 11 Highest counter ID seen: c1 Function name: closure_macro_async::test::{closure#0}::{closure#0} -Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 14, 1c, 00, 1d, 01, 02, 11, 00, 18, 01, 00, 1b, 00, 22, 01, 01, 10, 00, 21, 05, 01, 11, 00, 19, 05, 01, 11, 00, 27, 02, 02, 11, 00, 16, 02, 00, 17, 00, 1e, 01, 02, 09, 00, 0a] +Raw bytes (56): 0x[01, 01, 01, 01, 05, 0a, 01, 14, 1c, 00, 1d, 01, 02, 1b, 00, 22, 01, 00, 33, 00, 34, 01, 01, 10, 00, 21, 05, 00, 22, 03, 0e, 05, 01, 11, 00, 19, 05, 00, 20, 00, 27, 02, 03, 11, 00, 16, 02, 00, 17, 00, 1e, 01, 02, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/closure_macro_async.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 9 +Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 20, 28) to (start + 0, 29) -- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 24) -- Code(Counter(0)) at (prev + 0, 27) to (start + 0, 34) +- Code(Counter(0)) at (prev + 2, 27) to (start + 0, 34) +- Code(Counter(0)) at (prev + 0, 51) to (start + 0, 52) - Code(Counter(0)) at (prev + 1, 16) to (start + 0, 33) +- Code(Counter(1)) at (prev + 0, 34) to (start + 3, 14) - Code(Counter(1)) at (prev + 1, 17) to (start + 0, 25) -- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 39) -- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 22) +- Code(Counter(1)) at (prev + 0, 32) to (start + 0, 39) +- Code(Expression(0, Sub)) at (prev + 3, 17) to (start + 0, 22) = (c0 - c1) - Code(Expression(0, Sub)) at (prev + 0, 23) to (start + 0, 30) = (c0 - c1) diff --git a/tests/coverage/closure_macro_async.coverage b/tests/coverage/async/closure_macro_async.coverage similarity index 98% rename from tests/coverage/closure_macro_async.coverage rename to tests/coverage/async/closure_macro_async.coverage index 7bfea3c9bb3b9..67560ca3a811b 100644 --- a/tests/coverage/closure_macro_async.coverage +++ b/tests/coverage/async/closure_macro_async.coverage @@ -23,7 +23,7 @@ LL| 0| if message.len() > 0 { LL| 0| println!("{}", message); LL| 0| Ok(String::from("ok")) - LL| | } else { + LL| 0| } else { LL| 0| bail!("error"); LL| | } LL| 0| }) diff --git a/tests/coverage/closure_macro_async.rs b/tests/coverage/async/closure_macro_async.rs similarity index 100% rename from tests/coverage/closure_macro_async.rs rename to tests/coverage/async/closure_macro_async.rs diff --git a/tests/coverage/async_closure2.cov-map b/tests/coverage/async_closure2.cov-map deleted file mode 100644 index bd58e4db50841..0000000000000 --- a/tests/coverage/async_closure2.cov-map +++ /dev/null @@ -1,72 +0,0 @@ -Function name: async_closure2::call_once:: -Raw bytes (9): 0x[01, 01, 00, 01, 01, 0c, 01, 00, 2a] -Number of files: 1 -- file 0 => $DIR/async_closure2.rs -Number of expressions: 0 -Number of file 0 mappings: 1 -- Code(Counter(0)) at (prev + 12, 1) to (start + 0, 42) -Highest counter ID seen: c0 - -Function name: async_closure2::call_once::::{closure#0} -Raw bytes (21): 0x[01, 01, 01, 05, 09, 03, 01, 0c, 2b, 00, 2c, 01, 01, 05, 00, 0e, 02, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/async_closure2.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) -Number of file 0 mappings: 3 -- Code(Counter(0)) at (prev + 12, 43) to (start + 0, 44) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Expression(0, Sub)) at (prev + 1, 1) to (start + 0, 2) - = (c1 - c2) -Highest counter ID seen: c0 - -Function name: async_closure2::main -Raw bytes (54): 0x[01, 01, 00, 0a, 01, 10, 01, 00, 0e, 01, 01, 09, 00, 16, 01, 04, 05, 00, 17, 01, 00, 18, 00, 21, 01, 00, 22, 00, 2f, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 15, 01, 00, 16, 00, 1a, 01, 00, 1b, 00, 2b, 05, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/async_closure2.rs -Number of expressions: 0 -Number of file 0 mappings: 10 -- Code(Counter(0)) at (prev + 16, 1) to (start + 0, 14) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 23) -- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 33) -- Code(Counter(0)) at (prev + 0, 34) to (start + 0, 47) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 21) -- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 26) -- Code(Counter(0)) at (prev + 0, 27) to (start + 0, 43) -- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c1 - -Function name: async_closure2::main::{closure#0} -Raw bytes (44): 0x[01, 01, 00, 08, 01, 11, 22, 00, 23, 01, 01, 09, 00, 0e, 01, 00, 0f, 00, 18, 01, 00, 1c, 00, 2c, 01, 01, 09, 00, 0e, 01, 00, 0f, 00, 18, 01, 00, 1c, 00, 2c, 01, 01, 05, 00, 06] -Number of files: 1 -- file 0 => $DIR/async_closure2.rs -Number of expressions: 0 -Number of file 0 mappings: 8 -- Code(Counter(0)) at (prev + 17, 34) to (start + 0, 35) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 24) -- Code(Counter(0)) at (prev + 0, 28) to (start + 0, 44) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 24) -- Code(Counter(0)) at (prev + 0, 28) to (start + 0, 44) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: c0 - -Function name: async_closure2::main::{closure#0}::{closure#0}::<_> (unused) -Raw bytes (44): 0x[01, 01, 00, 08, 00, 11, 22, 00, 23, 00, 01, 09, 00, 0e, 00, 00, 0f, 00, 18, 00, 00, 1c, 00, 2c, 00, 01, 09, 00, 0e, 00, 00, 0f, 00, 18, 00, 00, 1c, 00, 2c, 00, 01, 05, 00, 06] -Number of files: 1 -- file 0 => $DIR/async_closure2.rs -Number of expressions: 0 -Number of file 0 mappings: 8 -- Code(Zero) at (prev + 17, 34) to (start + 0, 35) -- Code(Zero) at (prev + 1, 9) to (start + 0, 14) -- Code(Zero) at (prev + 0, 15) to (start + 0, 24) -- Code(Zero) at (prev + 0, 28) to (start + 0, 44) -- Code(Zero) at (prev + 1, 9) to (start + 0, 14) -- Code(Zero) at (prev + 0, 15) to (start + 0, 24) -- Code(Zero) at (prev + 0, 28) to (start + 0, 44) -- Code(Zero) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: (none) - diff --git a/tests/coverage/attr/nested.cov-map b/tests/coverage/attr/nested.cov-map index 8ca218f7267fd..ae8af35e507de 100644 --- a/tests/coverage/attr/nested.cov-map +++ b/tests/coverage/attr/nested.cov-map @@ -1,24 +1,22 @@ Function name: nested::closure_expr -Raw bytes (24): 0x[01, 01, 00, 04, 01, 40, 01, 00, 12, 01, 01, 09, 00, 0f, 01, 0a, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 40, 01, 00, 12, 01, 0b, 05, 00, 0f, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/nested.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 64, 1) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) -- Code(Counter(0)) at (prev + 10, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 11, 5) to (start + 0, 15) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: nested::closure_tail -Raw bytes (24): 0x[01, 01, 00, 04, 01, 4f, 01, 00, 12, 01, 01, 09, 00, 0f, 01, 10, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 4f, 01, 00, 12, 01, 11, 05, 00, 0f, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/nested.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 79, 1) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) -- Code(Counter(0)) at (prev + 16, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 17, 5) to (start + 0, 15) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/attr/nested.coverage b/tests/coverage/attr/nested.coverage index 6bd24d6793610..a0bf05a423534 100644 --- a/tests/coverage/attr/nested.coverage +++ b/tests/coverage/attr/nested.coverage @@ -62,7 +62,7 @@ LL| |} LL| | LL| 1|fn closure_expr() { - LL| 1| let _outer = #[coverage(off)] + LL| | let _outer = #[coverage(off)] LL| | || { LL| | let _middle = || { LL| | let _inner = || { @@ -77,7 +77,7 @@ LL| | LL| |// This syntax is allowed, even without #![feature(stmt_expr_attributes)]. LL| 1|fn closure_tail() { - LL| 1| let _outer = { + LL| | let _outer = { LL| | #[coverage(off)] LL| | || { LL| | let _middle = { diff --git a/tests/coverage/attr/off-on-sandwich.cov-map b/tests/coverage/attr/off-on-sandwich.cov-map index c0c6eab57108d..ef31c56fcaa2f 100644 --- a/tests/coverage/attr/off-on-sandwich.cov-map +++ b/tests/coverage/attr/off-on-sandwich.cov-map @@ -1,36 +1,36 @@ Function name: off_on_sandwich::dense_a::dense_b -Raw bytes (24): 0x[01, 01, 00, 04, 01, 10, 05, 00, 11, 01, 01, 09, 00, 10, 01, 01, 09, 00, 10, 01, 05, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 10, 05, 00, 11, 01, 01, 09, 00, 12, 01, 01, 09, 00, 12, 01, 05, 05, 00, 06] Number of files: 1 - file 0 => $DIR/off-on-sandwich.rs Number of expressions: 0 Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 16, 5) to (start + 0, 17) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 18) - Code(Counter(0)) at (prev + 5, 5) to (start + 0, 6) Highest counter ID seen: c0 Function name: off_on_sandwich::sparse_a::sparse_b::sparse_c -Raw bytes (24): 0x[01, 01, 00, 04, 01, 22, 09, 00, 16, 01, 01, 0d, 00, 15, 01, 01, 0d, 00, 15, 01, 09, 09, 00, 0a] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 22, 09, 00, 16, 01, 01, 0d, 00, 17, 01, 01, 0d, 00, 17, 01, 09, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/off-on-sandwich.rs Number of expressions: 0 Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 34, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 21) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 21) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 23) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 23) - Code(Counter(0)) at (prev + 9, 9) to (start + 0, 10) Highest counter ID seen: c0 Function name: off_on_sandwich::sparse_a::sparse_b::sparse_c::sparse_d -Raw bytes (24): 0x[01, 01, 00, 04, 01, 25, 0d, 00, 1a, 01, 01, 11, 00, 19, 01, 01, 11, 00, 19, 01, 05, 0d, 00, 0e] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 25, 0d, 00, 1a, 01, 01, 11, 00, 1b, 01, 01, 11, 00, 1b, 01, 05, 0d, 00, 0e] Number of files: 1 - file 0 => $DIR/off-on-sandwich.rs Number of expressions: 0 Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 37, 13) to (start + 0, 26) -- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 25) -- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 25) +- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 27) - Code(Counter(0)) at (prev + 5, 13) to (start + 0, 14) Highest counter ID seen: c0 diff --git a/tests/coverage/attr/trait-impl-inherit.cov-map b/tests/coverage/attr/trait-impl-inherit.cov-map index 6aedd1043f97d..bf10083dd2909 100644 --- a/tests/coverage/attr/trait-impl-inherit.cov-map +++ b/tests/coverage/attr/trait-impl-inherit.cov-map @@ -1,11 +1,12 @@ Function name: ::f -Raw bytes (19): 0x[01, 01, 00, 03, 01, 11, 05, 00, 10, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 11, 05, 00, 10, 01, 01, 09, 00, 11, 01, 00, 12, 00, 1a, 01, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/trait-impl-inherit.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 17, 5) to (start + 0, 16) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) +- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 26) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) Highest counter ID seen: c0 diff --git a/tests/coverage/auto-derived.auto.cov-map b/tests/coverage/auto-derived.auto.cov-map index e3d411d895aaa..220fb794137e1 100644 --- a/tests/coverage/auto-derived.auto.cov-map +++ b/tests/coverage/auto-derived.auto.cov-map @@ -1,23 +1,22 @@ Function name: ::my_assoc_fn::inner_fn_on -Raw bytes (24): 0x[01, 01, 00, 04, 01, 1f, 09, 00, 19, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 23, 01, 01, 09, 00, 0a] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 1f, 09, 00, 19, 01, 01, 0d, 00, 24, 01, 01, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/auto-derived.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 31, 9) to (start + 0, 25) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 35) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 36) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) Highest counter ID seen: c0 Function name: auto_derived::main -Raw bytes (19): 0x[01, 01, 00, 03, 01, 33, 01, 00, 0a, 01, 01, 05, 00, 1a, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 33, 01, 00, 0a, 01, 01, 05, 00, 1c, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auto-derived.rs Number of expressions: 0 Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 51, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 28) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/auto-derived.base.cov-map b/tests/coverage/auto-derived.base.cov-map index 2dcd616300d9d..c84afc33ad3d5 100644 --- a/tests/coverage/auto-derived.base.cov-map +++ b/tests/coverage/auto-derived.base.cov-map @@ -1,61 +1,57 @@ Function name: ::my_assoc_fn -Raw bytes (34): 0x[01, 01, 00, 06, 01, 19, 05, 00, 15, 01, 0a, 0d, 00, 14, 01, 04, 09, 00, 12, 01, 01, 09, 00, 11, 01, 01, 09, 00, 14, 01, 01, 05, 00, 06] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 19, 05, 00, 15, 01, 0e, 09, 00, 12, 01, 01, 09, 00, 13, 01, 01, 09, 00, 16, 01, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/auto-derived.rs Number of expressions: 0 -Number of file 0 mappings: 6 +Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 25, 5) to (start + 0, 21) -- Code(Counter(0)) at (prev + 10, 13) to (start + 0, 20) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 20) +- Code(Counter(0)) at (prev + 14, 9) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) Highest counter ID seen: c0 Function name: ::my_assoc_fn::inner_fn -Raw bytes (24): 0x[01, 01, 00, 04, 01, 1a, 09, 00, 16, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 1e, 01, 01, 09, 00, 0a] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 1a, 09, 00, 16, 01, 01, 0d, 00, 1f, 01, 01, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/auto-derived.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 26, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 31) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) Highest counter ID seen: c0 Function name: ::my_assoc_fn::inner_fn_on -Raw bytes (24): 0x[01, 01, 00, 04, 01, 1f, 09, 00, 19, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 23, 01, 01, 09, 00, 0a] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 1f, 09, 00, 19, 01, 01, 0d, 00, 24, 01, 01, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/auto-derived.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 31, 9) to (start + 0, 25) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 35) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 36) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) Highest counter ID seen: c0 Function name: ::my_assoc_fn::{closure#0} -Raw bytes (24): 0x[01, 01, 00, 04, 01, 23, 1a, 00, 1b, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 1d, 01, 01, 09, 00, 0a] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 23, 1a, 00, 1b, 01, 01, 0d, 00, 1e, 01, 01, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/auto-derived.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 35, 26) to (start + 0, 27) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 29) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 30) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) Highest counter ID seen: c0 Function name: auto_derived::main -Raw bytes (19): 0x[01, 01, 00, 03, 01, 33, 01, 00, 0a, 01, 01, 05, 00, 1a, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 33, 01, 00, 0a, 01, 01, 05, 00, 1c, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auto-derived.rs Number of expressions: 0 Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 51, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 28) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/auto-derived.on.cov-map b/tests/coverage/auto-derived.on.cov-map index 2dcd616300d9d..c84afc33ad3d5 100644 --- a/tests/coverage/auto-derived.on.cov-map +++ b/tests/coverage/auto-derived.on.cov-map @@ -1,61 +1,57 @@ Function name: ::my_assoc_fn -Raw bytes (34): 0x[01, 01, 00, 06, 01, 19, 05, 00, 15, 01, 0a, 0d, 00, 14, 01, 04, 09, 00, 12, 01, 01, 09, 00, 11, 01, 01, 09, 00, 14, 01, 01, 05, 00, 06] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 19, 05, 00, 15, 01, 0e, 09, 00, 12, 01, 01, 09, 00, 13, 01, 01, 09, 00, 16, 01, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/auto-derived.rs Number of expressions: 0 -Number of file 0 mappings: 6 +Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 25, 5) to (start + 0, 21) -- Code(Counter(0)) at (prev + 10, 13) to (start + 0, 20) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 20) +- Code(Counter(0)) at (prev + 14, 9) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) Highest counter ID seen: c0 Function name: ::my_assoc_fn::inner_fn -Raw bytes (24): 0x[01, 01, 00, 04, 01, 1a, 09, 00, 16, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 1e, 01, 01, 09, 00, 0a] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 1a, 09, 00, 16, 01, 01, 0d, 00, 1f, 01, 01, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/auto-derived.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 26, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 31) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) Highest counter ID seen: c0 Function name: ::my_assoc_fn::inner_fn_on -Raw bytes (24): 0x[01, 01, 00, 04, 01, 1f, 09, 00, 19, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 23, 01, 01, 09, 00, 0a] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 1f, 09, 00, 19, 01, 01, 0d, 00, 24, 01, 01, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/auto-derived.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 31, 9) to (start + 0, 25) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 35) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 36) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) Highest counter ID seen: c0 Function name: ::my_assoc_fn::{closure#0} -Raw bytes (24): 0x[01, 01, 00, 04, 01, 23, 1a, 00, 1b, 01, 01, 0d, 00, 10, 01, 00, 11, 00, 1d, 01, 01, 09, 00, 0a] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 23, 1a, 00, 1b, 01, 01, 0d, 00, 1e, 01, 01, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/auto-derived.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 35, 26) to (start + 0, 27) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 29) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 30) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) Highest counter ID seen: c0 Function name: auto_derived::main -Raw bytes (19): 0x[01, 01, 00, 03, 01, 33, 01, 00, 0a, 01, 01, 05, 00, 1a, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 33, 01, 00, 0a, 01, 01, 05, 00, 1c, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auto-derived.rs Number of expressions: 0 Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 51, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 28) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/bad_counter_ids.cov-map b/tests/coverage/bad_counter_ids.cov-map index 309b29220144e..2b424629f011f 100644 --- a/tests/coverage/bad_counter_ids.cov-map +++ b/tests/coverage/bad_counter_ids.cov-map @@ -1,96 +1,120 @@ Function name: bad_counter_ids::eq_bad -Raw bytes (24): 0x[01, 01, 00, 04, 01, 24, 01, 00, 0c, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 00, 01, 01, 00, 02] +Raw bytes (39): 0x[01, 01, 00, 07, 01, 24, 01, 00, 0c, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 00, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/bad_counter_ids.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 36, 1) to (start + 0, 12) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) - Code(Zero) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: bad_counter_ids::eq_bad_message -Raw bytes (24): 0x[01, 01, 00, 04, 01, 29, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 00, 01, 01, 00, 02] +Raw bytes (39): 0x[01, 01, 00, 07, 01, 29, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 00, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/bad_counter_ids.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 41, 1) to (start + 0, 20) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) - Code(Zero) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: bad_counter_ids::eq_good -Raw bytes (24): 0x[01, 01, 00, 04, 01, 10, 01, 00, 0d, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 01, 01, 01, 00, 02] +Raw bytes (39): 0x[01, 01, 00, 07, 01, 10, 01, 00, 0d, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/bad_counter_ids.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 16, 1) to (start + 0, 13) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: bad_counter_ids::eq_good_message -Raw bytes (24): 0x[01, 01, 00, 04, 01, 15, 01, 00, 15, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 01, 01, 01, 00, 02] +Raw bytes (39): 0x[01, 01, 00, 07, 01, 15, 01, 00, 15, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/bad_counter_ids.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 21, 1) to (start + 0, 21) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: bad_counter_ids::ne_bad -Raw bytes (24): 0x[01, 01, 00, 04, 01, 2e, 01, 00, 0c, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 00, 01, 01, 00, 02] +Raw bytes (39): 0x[01, 01, 00, 07, 01, 2e, 01, 00, 0c, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 00, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/bad_counter_ids.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 46, 1) to (start + 0, 12) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) - Code(Zero) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: bad_counter_ids::ne_bad_message -Raw bytes (24): 0x[01, 01, 00, 04, 01, 33, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 00, 01, 01, 00, 02] +Raw bytes (39): 0x[01, 01, 00, 07, 01, 33, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 00, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/bad_counter_ids.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 51, 1) to (start + 0, 20) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) - Code(Zero) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: bad_counter_ids::ne_good -Raw bytes (24): 0x[01, 01, 00, 04, 01, 1a, 01, 00, 0d, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 01, 01, 01, 00, 02] +Raw bytes (39): 0x[01, 01, 00, 07, 01, 1a, 01, 00, 0d, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/bad_counter_ids.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 26, 1) to (start + 0, 13) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: bad_counter_ids::ne_good_message -Raw bytes (24): 0x[01, 01, 00, 04, 01, 1f, 01, 00, 15, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0f, 01, 01, 01, 00, 02] +Raw bytes (39): 0x[01, 01, 00, 07, 01, 1f, 01, 00, 15, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 11, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/bad_counter_ids.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 31, 1) to (start + 0, 21) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/branch/fn-in-macro.cov-map b/tests/coverage/branch/fn-in-macro.cov-map index 7f77251d324df..ac5fab9462e72 100644 --- a/tests/coverage/branch/fn-in-macro.cov-map +++ b/tests/coverage/branch/fn-in-macro.cov-map @@ -10,14 +10,14 @@ Number of file 0 mappings: 3 Highest counter ID seen: c0 Function name: fn_in_macro::fn_in_macro -Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 0c, 09, 00, 19, 01, 01, 10, 00, 25, 05, 00, 2c, 02, 0e, 02, 02, 14, 02, 0e, 01, 03, 09, 00, 0a] +Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 0c, 09, 00, 19, 01, 01, 10, 00, 2b, 05, 00, 2c, 02, 0e, 02, 02, 14, 02, 0e, 01, 03, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/fn-in-macro.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 12, 9) to (start + 0, 25) -- Code(Counter(0)) at (prev + 1, 16) to (start + 0, 37) +- Code(Counter(0)) at (prev + 1, 16) to (start + 0, 43) - Code(Counter(1)) at (prev + 0, 44) to (start + 2, 14) - Code(Expression(0, Sub)) at (prev + 2, 20) to (start + 2, 14) = (c0 - c1) @@ -25,14 +25,14 @@ Number of file 0 mappings: 5 Highest counter ID seen: c1 Function name: fn_in_macro::fn_not_in_macro -Raw bytes (38): 0x[01, 01, 01, 01, 05, 06, 01, 19, 01, 00, 15, 01, 01, 08, 00, 1d, 20, 05, 02, 00, 08, 00, 23, 05, 00, 24, 02, 06, 02, 02, 0c, 02, 06, 01, 03, 01, 00, 02] +Raw bytes (38): 0x[01, 01, 01, 01, 05, 06, 01, 19, 01, 00, 15, 01, 01, 08, 00, 23, 20, 05, 02, 00, 08, 00, 23, 05, 00, 24, 02, 06, 02, 02, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/fn-in-macro.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 25, 1) to (start + 0, 21) -- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 29) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 35) - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 8) to (start + 0, 35) true = c1 false = (c0 - c1) diff --git a/tests/coverage/branch/guard.cov-map b/tests/coverage/branch/guard.cov-map index 9c6a9bf40fd17..6045af957070f 100644 --- a/tests/coverage/branch/guard.cov-map +++ b/tests/coverage/branch/guard.cov-map @@ -1,39 +1,35 @@ Function name: guard::branch_match_guard -Raw bytes (104): 0x[01, 01, 08, 05, 0d, 09, 05, 05, 0f, 0d, 11, 17, 1b, 01, 05, 1f, 11, 09, 0d, 10, 01, 0c, 01, 00, 26, 01, 01, 05, 00, 0e, 02, 02, 0b, 00, 0c, 06, 01, 14, 02, 0a, 0d, 03, 0e, 00, 0f, 05, 00, 14, 00, 19, 20, 0d, 02, 00, 14, 00, 1e, 0d, 00, 1d, 00, 1e, 0d, 00, 22, 02, 0a, 11, 03, 0e, 00, 0f, 02, 00, 14, 00, 19, 20, 11, 0a, 00, 14, 00, 1e, 11, 00, 1d, 00, 1e, 11, 00, 22, 02, 0a, 12, 03, 0e, 02, 0a, 01, 04, 01, 00, 02] +Raw bytes (86): 0x[01, 01, 09, 09, 05, 05, 0d, 05, 0d, 05, 13, 0d, 11, 1b, 1f, 01, 05, 23, 11, 09, 0d, 0c, 01, 0c, 01, 00, 26, 01, 01, 05, 00, 0e, 01, 02, 0b, 00, 0c, 02, 01, 14, 02, 0a, 05, 03, 14, 00, 1e, 20, 0d, 0a, 00, 14, 00, 1e, 0d, 00, 22, 02, 0a, 0a, 03, 14, 00, 1e, 20, 11, 0e, 00, 14, 00, 1e, 11, 00, 22, 02, 0a, 16, 03, 0e, 02, 0a, 01, 04, 01, 00, 02] Number of files: 1 - file 0 => $DIR/guard.rs -Number of expressions: 8 -- expression 0 operands: lhs = Counter(1), rhs = Counter(3) -- expression 1 operands: lhs = Counter(2), rhs = Counter(1) -- expression 2 operands: lhs = Counter(1), rhs = Expression(3, Add) -- expression 3 operands: lhs = Counter(3), rhs = Counter(4) -- expression 4 operands: lhs = Expression(5, Add), rhs = Expression(6, Add) -- expression 5 operands: lhs = Counter(0), rhs = Counter(1) -- expression 6 operands: lhs = Expression(7, Add), rhs = Counter(4) -- expression 7 operands: lhs = Counter(2), rhs = Counter(3) -Number of file 0 mappings: 16 +Number of expressions: 9 +- expression 0 operands: lhs = Counter(2), rhs = Counter(1) +- expression 1 operands: lhs = Counter(1), rhs = Counter(3) +- expression 2 operands: lhs = Counter(1), rhs = Counter(3) +- expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) +- expression 4 operands: lhs = Counter(3), rhs = Counter(4) +- expression 5 operands: lhs = Expression(6, Add), rhs = Expression(7, Add) +- expression 6 operands: lhs = Counter(0), rhs = Counter(1) +- expression 7 operands: lhs = Expression(8, Add), rhs = Counter(4) +- expression 8 operands: lhs = Counter(2), rhs = Counter(3) +Number of file 0 mappings: 12 - Code(Counter(0)) at (prev + 12, 1) to (start + 0, 38) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Expression(0, Sub)) at (prev + 2, 11) to (start + 0, 12) - = (c1 - c3) -- Code(Expression(1, Sub)) at (prev + 1, 20) to (start + 2, 10) +- Code(Counter(0)) at (prev + 2, 11) to (start + 0, 12) +- Code(Expression(0, Sub)) at (prev + 1, 20) to (start + 2, 10) = (c2 - c1) -- Code(Counter(3)) at (prev + 3, 14) to (start + 0, 15) -- Code(Counter(1)) at (prev + 0, 20) to (start + 0, 25) -- Branch { true: Counter(3), false: Expression(0, Sub) } at (prev + 0, 20) to (start + 0, 30) +- Code(Counter(1)) at (prev + 3, 20) to (start + 0, 30) +- Branch { true: Counter(3), false: Expression(2, Sub) } at (prev + 0, 20) to (start + 0, 30) true = c3 false = (c1 - c3) -- Code(Counter(3)) at (prev + 0, 29) to (start + 0, 30) - Code(Counter(3)) at (prev + 0, 34) to (start + 2, 10) -- Code(Counter(4)) at (prev + 3, 14) to (start + 0, 15) -- Code(Expression(0, Sub)) at (prev + 0, 20) to (start + 0, 25) +- Code(Expression(2, Sub)) at (prev + 3, 20) to (start + 0, 30) = (c1 - c3) -- Branch { true: Counter(4), false: Expression(2, Sub) } at (prev + 0, 20) to (start + 0, 30) +- Branch { true: Counter(4), false: Expression(3, Sub) } at (prev + 0, 20) to (start + 0, 30) true = c4 false = (c1 - (c3 + c4)) -- Code(Counter(4)) at (prev + 0, 29) to (start + 0, 30) - Code(Counter(4)) at (prev + 0, 34) to (start + 2, 10) -- Code(Expression(4, Sub)) at (prev + 3, 14) to (start + 2, 10) +- Code(Expression(5, Sub)) at (prev + 3, 14) to (start + 2, 10) = ((c0 + c1) - ((c2 + c3) + c4)) - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 2) Highest counter ID seen: c4 diff --git a/tests/coverage/branch/guard.coverage b/tests/coverage/branch/guard.coverage index 465aefbf0665e..f972633077301 100644 --- a/tests/coverage/branch/guard.coverage +++ b/tests/coverage/branch/guard.coverage @@ -12,12 +12,11 @@ LL| 4|fn branch_match_guard(x: Option) { LL| 4| no_merge!(); LL| | - LL| 1| match x { + LL| 4| match x { LL| 1| Some(0) => { LL| 1| println!("zero"); LL| 1| } LL| 3| Some(x) if x % 2 == 0 => { - ^2 ^2 ------------------ | Branch (LL:20): [True: 2, False: 1] ------------------ diff --git a/tests/coverage/branch/if-let.cov-map b/tests/coverage/branch/if-let.cov-map index 86bfcadb1255a..6764507b41af0 100644 --- a/tests/coverage/branch/if-let.cov-map +++ b/tests/coverage/branch/if-let.cov-map @@ -1,68 +1,54 @@ Function name: if_let::if_let -Raw bytes (58): 0x[01, 01, 01, 01, 05, 0a, 01, 0c, 01, 00, 1f, 01, 01, 05, 00, 0e, 20, 02, 05, 02, 0c, 00, 13, 02, 00, 11, 00, 12, 01, 00, 16, 00, 1b, 02, 00, 1c, 02, 06, 05, 02, 0c, 02, 06, 01, 03, 05, 00, 08, 01, 00, 09, 00, 0f, 01, 01, 01, 00, 02] +Raw bytes (48): 0x[01, 01, 01, 01, 05, 08, 01, 0c, 01, 00, 1f, 01, 01, 05, 00, 0e, 01, 02, 08, 00, 1b, 20, 02, 05, 00, 0c, 00, 13, 02, 00, 1c, 02, 06, 05, 02, 0c, 02, 06, 01, 03, 05, 00, 10, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/if-let.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 10 +Number of file 0 mappings: 8 - Code(Counter(0)) at (prev + 12, 1) to (start + 0, 31) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Branch { true: Expression(0, Sub), false: Counter(1) } at (prev + 2, 12) to (start + 0, 19) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 27) +- Branch { true: Expression(0, Sub), false: Counter(1) } at (prev + 0, 12) to (start + 0, 19) true = (c0 - c1) false = c1 -- Code(Expression(0, Sub)) at (prev + 0, 17) to (start + 0, 18) - = (c0 - c1) -- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 27) - Code(Expression(0, Sub)) at (prev + 0, 28) to (start + 2, 6) = (c0 - c1) - Code(Counter(1)) at (prev + 2, 12) to (start + 2, 6) -- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 8) -- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 16) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c1 Function name: if_let::if_let_chain -Raw bytes (102): 0x[01, 01, 0c, 01, 05, 01, 2f, 05, 09, 01, 2f, 05, 09, 01, 2f, 05, 09, 01, 2f, 05, 09, 01, 2f, 05, 09, 05, 09, 0e, 01, 17, 01, 00, 32, 20, 02, 05, 01, 0c, 00, 13, 02, 00, 11, 00, 12, 01, 00, 16, 00, 17, 20, 26, 09, 01, 10, 00, 17, 26, 00, 15, 00, 16, 02, 00, 1a, 00, 1b, 26, 01, 05, 03, 06, 26, 01, 09, 00, 0c, 26, 00, 0d, 00, 0e, 2f, 02, 0c, 02, 06, 01, 03, 05, 00, 08, 01, 00, 09, 00, 0f, 01, 01, 01, 00, 02] +Raw bytes (74): 0x[01, 01, 08, 01, 05, 01, 1f, 05, 09, 01, 1f, 05, 09, 01, 1f, 05, 09, 05, 09, 0a, 01, 17, 01, 00, 32, 01, 01, 08, 00, 17, 20, 02, 05, 00, 0c, 00, 13, 02, 01, 0c, 00, 1b, 20, 16, 09, 00, 10, 00, 17, 16, 01, 05, 03, 06, 16, 01, 09, 00, 0f, 1f, 02, 0c, 02, 06, 01, 03, 05, 00, 10, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/if-let.rs -Number of expressions: 12 +Number of expressions: 8 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(0), rhs = Expression(11, Add) +- expression 1 operands: lhs = Counter(0), rhs = Expression(7, Add) - expression 2 operands: lhs = Counter(1), rhs = Counter(2) -- expression 3 operands: lhs = Counter(0), rhs = Expression(11, Add) +- expression 3 operands: lhs = Counter(0), rhs = Expression(7, Add) - expression 4 operands: lhs = Counter(1), rhs = Counter(2) -- expression 5 operands: lhs = Counter(0), rhs = Expression(11, Add) +- expression 5 operands: lhs = Counter(0), rhs = Expression(7, Add) - expression 6 operands: lhs = Counter(1), rhs = Counter(2) -- expression 7 operands: lhs = Counter(0), rhs = Expression(11, Add) -- expression 8 operands: lhs = Counter(1), rhs = Counter(2) -- expression 9 operands: lhs = Counter(0), rhs = Expression(11, Add) -- expression 10 operands: lhs = Counter(1), rhs = Counter(2) -- expression 11 operands: lhs = Counter(1), rhs = Counter(2) -Number of file 0 mappings: 14 +- expression 7 operands: lhs = Counter(1), rhs = Counter(2) +Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 23, 1) to (start + 0, 50) -- Branch { true: Expression(0, Sub), false: Counter(1) } at (prev + 1, 12) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 23) +- Branch { true: Expression(0, Sub), false: Counter(1) } at (prev + 0, 12) to (start + 0, 19) true = (c0 - c1) false = c1 -- Code(Expression(0, Sub)) at (prev + 0, 17) to (start + 0, 18) +- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 27) = (c0 - c1) -- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 23) -- Branch { true: Expression(9, Sub), false: Counter(2) } at (prev + 1, 16) to (start + 0, 23) +- Branch { true: Expression(5, Sub), false: Counter(2) } at (prev + 0, 16) to (start + 0, 23) true = (c0 - (c1 + c2)) false = c2 -- Code(Expression(9, Sub)) at (prev + 0, 21) to (start + 0, 22) - = (c0 - (c1 + c2)) -- Code(Expression(0, Sub)) at (prev + 0, 26) to (start + 0, 27) - = (c0 - c1) -- Code(Expression(9, Sub)) at (prev + 1, 5) to (start + 3, 6) - = (c0 - (c1 + c2)) -- Code(Expression(9, Sub)) at (prev + 1, 9) to (start + 0, 12) +- Code(Expression(5, Sub)) at (prev + 1, 5) to (start + 3, 6) = (c0 - (c1 + c2)) -- Code(Expression(9, Sub)) at (prev + 0, 13) to (start + 0, 14) +- Code(Expression(5, Sub)) at (prev + 1, 9) to (start + 0, 15) = (c0 - (c1 + c2)) -- Code(Expression(11, Add)) at (prev + 2, 12) to (start + 2, 6) +- Code(Expression(7, Add)) at (prev + 2, 12) to (start + 2, 6) = (c1 + c2) -- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 8) -- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 16) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c2 diff --git a/tests/coverage/branch/if-let.coverage b/tests/coverage/branch/if-let.coverage index e55da7fb7260c..4ee0ca3747154 100644 --- a/tests/coverage/branch/if-let.coverage +++ b/tests/coverage/branch/if-let.coverage @@ -13,7 +13,6 @@ LL| 3| no_merge!(); LL| | LL| 3| if let Some(x) = input { - ^2 ------------------ | Branch (LL:12): [True: 2, False: 1] ------------------ @@ -26,12 +25,10 @@ LL| | LL| 15|fn if_let_chain(a: Option<&str>, b: Option<&str>) { LL| 15| if let Some(x) = a - ^12 ------------------ | Branch (LL:12): [True: 12, False: 3] ------------------ LL| 12| && let Some(y) = b - ^8 ------------------ | Branch (LL:16): [True: 8, False: 4] ------------------ diff --git a/tests/coverage/branch/if.cov-map b/tests/coverage/branch/if.cov-map index 09a014ce8a1aa..f353e0e87c5e5 100644 --- a/tests/coverage/branch/if.cov-map +++ b/tests/coverage/branch/if.cov-map @@ -24,7 +24,7 @@ Number of file 0 mappings: 9 Highest counter ID seen: c2 Function name: if::branch_not -Raw bytes (126): 0x[01, 01, 07, 01, 05, 01, 09, 01, 09, 01, 0d, 01, 0d, 01, 11, 01, 11, 14, 01, 0c, 01, 00, 17, 01, 01, 05, 00, 0e, 01, 02, 08, 00, 09, 20, 05, 02, 00, 08, 00, 09, 05, 01, 09, 00, 0c, 05, 00, 0d, 00, 10, 02, 01, 05, 00, 06, 01, 01, 08, 00, 0a, 20, 0a, 09, 00, 08, 00, 0a, 0a, 00, 0b, 02, 06, 09, 02, 05, 00, 06, 01, 01, 08, 00, 0b, 20, 0d, 12, 00, 08, 00, 0b, 0d, 00, 0c, 02, 06, 12, 02, 05, 00, 06, 01, 01, 08, 00, 0c, 20, 1a, 11, 00, 08, 00, 0c, 1a, 00, 0d, 02, 06, 11, 02, 05, 00, 06, 01, 01, 01, 00, 02] +Raw bytes (121): 0x[01, 01, 07, 01, 05, 01, 09, 01, 09, 01, 0d, 01, 0d, 01, 11, 01, 11, 13, 01, 0c, 01, 00, 17, 01, 01, 05, 00, 0e, 01, 02, 08, 00, 09, 20, 05, 02, 00, 08, 00, 09, 05, 00, 0a, 02, 06, 02, 02, 05, 00, 06, 01, 01, 08, 00, 0a, 20, 0a, 09, 00, 08, 00, 0a, 0a, 00, 0b, 02, 06, 09, 02, 05, 00, 06, 01, 01, 08, 00, 0b, 20, 0d, 12, 00, 08, 00, 0b, 0d, 00, 0c, 02, 06, 12, 02, 05, 00, 06, 01, 01, 08, 00, 0c, 20, 1a, 11, 00, 08, 00, 0c, 1a, 00, 0d, 02, 06, 11, 02, 05, 00, 06, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/if.rs Number of expressions: 7 @@ -35,16 +35,15 @@ Number of expressions: 7 - expression 4 operands: lhs = Counter(0), rhs = Counter(3) - expression 5 operands: lhs = Counter(0), rhs = Counter(4) - expression 6 operands: lhs = Counter(0), rhs = Counter(4) -Number of file 0 mappings: 20 +Number of file 0 mappings: 19 - Code(Counter(0)) at (prev + 12, 1) to (start + 0, 23) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) - Code(Counter(0)) at (prev + 2, 8) to (start + 0, 9) - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 8) to (start + 0, 9) true = c1 false = (c0 - c1) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 16) -- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 6) +- Code(Counter(1)) at (prev + 0, 10) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) = (c0 - c1) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 10) - Branch { true: Expression(2, Sub), false: Counter(2) } at (prev + 0, 8) to (start + 0, 10) diff --git a/tests/coverage/branch/if.coverage b/tests/coverage/branch/if.coverage index 3d107188ca682..23dc4b358863d 100644 --- a/tests/coverage/branch/if.coverage +++ b/tests/coverage/branch/if.coverage @@ -17,7 +17,8 @@ | Branch (LL:8): [True: 2, False: 1] ------------------ LL| 2| say("a") - LL| 1| } + LL| 2| } + ^1 LL| 3| if !a { ------------------ | Branch (LL:8): [True: 1, False: 2] diff --git a/tests/coverage/branch/lazy-boolean.cov-map b/tests/coverage/branch/lazy-boolean.cov-map index 9ec7c9a7f42bd..9a85ed2987afc 100644 --- a/tests/coverage/branch/lazy-boolean.cov-map +++ b/tests/coverage/branch/lazy-boolean.cov-map @@ -1,46 +1,42 @@ Function name: lazy_boolean::branch_and -Raw bytes (53): 0x[01, 01, 01, 01, 05, 09, 01, 13, 01, 00, 20, 01, 01, 05, 00, 0e, 01, 03, 09, 00, 0a, 01, 00, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 10, 01, 01, 01, 00, 02] +Raw bytes (43): 0x[01, 01, 01, 01, 05, 07, 01, 13, 01, 00, 20, 01, 01, 05, 00, 0e, 01, 03, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 01, 01, 05, 00, 11, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/lazy-boolean.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 9 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 19, 1) to (start + 0, 32) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +- Code(Counter(0)) at (prev + 3, 13) to (start + 0, 14) - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 14) true = c1 false = (c0 - c1) - Code(Counter(1)) at (prev + 0, 18) to (start + 0, 19) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c1 Function name: lazy_boolean::branch_or -Raw bytes (53): 0x[01, 01, 01, 01, 05, 09, 01, 1b, 01, 00, 1f, 01, 01, 05, 00, 0e, 01, 03, 09, 00, 0a, 01, 00, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 02, 00, 12, 00, 13, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 10, 01, 01, 01, 00, 02] +Raw bytes (43): 0x[01, 01, 01, 01, 05, 07, 01, 1b, 01, 00, 1f, 01, 01, 05, 00, 0e, 01, 03, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 02, 00, 12, 00, 13, 01, 01, 05, 00, 11, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/lazy-boolean.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 9 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 27, 1) to (start + 0, 31) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +- Code(Counter(0)) at (prev + 3, 13) to (start + 0, 14) - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 14) true = c1 false = (c0 - c1) - Code(Expression(0, Sub)) at (prev + 0, 18) to (start + 0, 19) = (c0 - c1) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c1 Function name: lazy_boolean::chain -Raw bytes (161): 0x[01, 01, 0f, 01, 05, 05, 09, 09, 0d, 01, 11, 01, 11, 01, 3b, 11, 15, 01, 3b, 11, 15, 01, 37, 3b, 19, 11, 15, 01, 37, 3b, 19, 11, 15, 17, 01, 24, 01, 00, 11, 01, 01, 05, 00, 0e, 01, 03, 09, 00, 0a, 01, 00, 0d, 00, 12, 20, 05, 02, 00, 0d, 00, 12, 05, 00, 16, 00, 1b, 20, 09, 06, 00, 16, 00, 1b, 09, 00, 1f, 00, 24, 20, 0d, 0a, 00, 1f, 00, 24, 0d, 00, 28, 00, 2d, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 10, 01, 03, 09, 00, 0a, 01, 00, 0d, 00, 12, 20, 11, 12, 00, 0d, 00, 12, 12, 00, 16, 00, 1b, 20, 15, 1e, 00, 16, 00, 1b, 1e, 00, 1f, 00, 24, 20, 19, 32, 00, 1f, 00, 24, 32, 00, 28, 00, 2d, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 10, 01, 01, 01, 00, 02] +Raw bytes (141): 0x[01, 01, 0f, 01, 05, 05, 09, 09, 0d, 01, 11, 01, 11, 01, 3b, 11, 15, 01, 3b, 11, 15, 01, 37, 3b, 19, 11, 15, 01, 37, 3b, 19, 11, 15, 13, 01, 24, 01, 00, 11, 01, 01, 05, 00, 0e, 01, 03, 0d, 00, 12, 20, 05, 02, 00, 0d, 00, 12, 05, 00, 16, 00, 1b, 20, 09, 06, 00, 16, 00, 1b, 09, 00, 1f, 00, 24, 20, 0d, 0a, 00, 1f, 00, 24, 0d, 00, 28, 00, 2d, 01, 01, 05, 00, 11, 01, 03, 0d, 00, 12, 20, 11, 12, 00, 0d, 00, 12, 12, 00, 16, 00, 1b, 20, 15, 1e, 00, 16, 00, 1b, 1e, 00, 1f, 00, 24, 20, 19, 32, 00, 1f, 00, 24, 32, 00, 28, 00, 2d, 01, 01, 05, 00, 11, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/lazy-boolean.rs Number of expressions: 15 @@ -59,11 +55,10 @@ Number of expressions: 15 - expression 12 operands: lhs = Counter(0), rhs = Expression(13, Add) - expression 13 operands: lhs = Expression(14, Add), rhs = Counter(6) - expression 14 operands: lhs = Counter(4), rhs = Counter(5) -Number of file 0 mappings: 23 +Number of file 0 mappings: 19 - Code(Counter(0)) at (prev + 36, 1) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 18) +- Code(Counter(0)) at (prev + 3, 13) to (start + 0, 18) - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 18) true = c1 false = (c0 - c1) @@ -76,10 +71,8 @@ Number of file 0 mappings: 23 true = c3 false = (c2 - c3) - Code(Counter(3)) at (prev + 0, 40) to (start + 0, 45) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) +- Code(Counter(0)) at (prev + 3, 13) to (start + 0, 18) - Branch { true: Counter(4), false: Expression(4, Sub) } at (prev + 0, 13) to (start + 0, 18) true = c4 false = (c0 - c4) @@ -95,13 +88,12 @@ Number of file 0 mappings: 23 false = (c0 - ((c4 + c5) + c6)) - Code(Expression(12, Sub)) at (prev + 0, 40) to (start + 0, 45) = (c0 - ((c4 + c5) + c6)) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c6 Function name: lazy_boolean::nested_mixed -Raw bytes (157): 0x[01, 01, 0d, 01, 05, 01, 1f, 05, 09, 05, 09, 1f, 0d, 05, 09, 1f, 0d, 05, 09, 01, 11, 11, 15, 01, 15, 01, 33, 15, 19, 17, 01, 31, 01, 00, 18, 01, 01, 05, 00, 0e, 01, 03, 09, 00, 0a, 01, 00, 0e, 00, 13, 20, 05, 02, 00, 0e, 00, 13, 02, 00, 17, 00, 1d, 20, 09, 06, 00, 17, 00, 1d, 1f, 00, 23, 00, 28, 20, 0d, 1a, 00, 23, 00, 28, 1a, 00, 2c, 00, 33, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 10, 01, 03, 09, 00, 0a, 01, 00, 0e, 00, 13, 20, 11, 22, 00, 0e, 00, 13, 11, 00, 17, 00, 1c, 20, 15, 26, 00, 17, 00, 1c, 2a, 00, 22, 00, 28, 20, 19, 2e, 00, 22, 00, 28, 19, 00, 2c, 00, 33, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 10, 01, 01, 01, 00, 02] +Raw bytes (137): 0x[01, 01, 0d, 01, 05, 01, 1f, 05, 09, 05, 09, 1f, 0d, 05, 09, 1f, 0d, 05, 09, 01, 11, 11, 15, 01, 15, 01, 33, 15, 19, 13, 01, 31, 01, 00, 18, 01, 01, 05, 00, 0e, 01, 03, 0e, 00, 13, 20, 05, 02, 00, 0e, 00, 13, 02, 00, 17, 00, 1d, 20, 09, 06, 00, 17, 00, 1d, 1f, 00, 23, 00, 28, 20, 0d, 1a, 00, 23, 00, 28, 1a, 00, 2c, 00, 33, 01, 01, 05, 00, 11, 01, 03, 0e, 00, 13, 20, 11, 22, 00, 0e, 00, 13, 11, 00, 17, 00, 1c, 20, 15, 26, 00, 17, 00, 1c, 2a, 00, 22, 00, 28, 20, 19, 2e, 00, 22, 00, 28, 19, 00, 2c, 00, 33, 01, 01, 05, 00, 11, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/lazy-boolean.rs Number of expressions: 13 @@ -118,11 +110,10 @@ Number of expressions: 13 - expression 10 operands: lhs = Counter(0), rhs = Counter(5) - expression 11 operands: lhs = Counter(0), rhs = Expression(12, Add) - expression 12 operands: lhs = Counter(5), rhs = Counter(6) -Number of file 0 mappings: 23 +Number of file 0 mappings: 19 - Code(Counter(0)) at (prev + 49, 1) to (start + 0, 24) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 19) +- Code(Counter(0)) at (prev + 3, 14) to (start + 0, 19) - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 14) to (start + 0, 19) true = c1 false = (c0 - c1) @@ -138,10 +129,8 @@ Number of file 0 mappings: 23 false = ((c1 + c2) - c3) - Code(Expression(6, Sub)) at (prev + 0, 44) to (start + 0, 51) = ((c1 + c2) - c3) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) +- Code(Counter(0)) at (prev + 3, 14) to (start + 0, 19) - Branch { true: Counter(4), false: Expression(8, Sub) } at (prev + 0, 14) to (start + 0, 19) true = c4 false = (c0 - c4) @@ -155,8 +144,7 @@ Number of file 0 mappings: 23 true = c6 false = (c0 - (c5 + c6)) - Code(Counter(6)) at (prev + 0, 44) to (start + 0, 51) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c6 diff --git a/tests/coverage/branch/let-else.cov-map b/tests/coverage/branch/let-else.cov-map index 61bedbfbff0cd..df5d53acccb46 100644 --- a/tests/coverage/branch/let-else.cov-map +++ b/tests/coverage/branch/let-else.cov-map @@ -1,24 +1,19 @@ Function name: let_else::let_else -Raw bytes (63): 0x[01, 01, 01, 01, 05, 0b, 01, 0c, 01, 00, 21, 01, 01, 05, 00, 0e, 20, 02, 05, 02, 09, 00, 10, 02, 00, 0e, 00, 0f, 01, 00, 13, 00, 18, 05, 01, 09, 00, 0c, 05, 00, 0d, 00, 13, 05, 01, 09, 00, 0f, 02, 03, 05, 00, 08, 02, 00, 09, 00, 0a, 01, 01, 01, 00, 02] +Raw bytes (48): 0x[01, 01, 01, 01, 05, 08, 01, 0c, 01, 00, 21, 01, 01, 05, 00, 0e, 20, 02, 05, 02, 09, 00, 10, 01, 00, 13, 00, 18, 05, 01, 09, 00, 14, 05, 01, 09, 00, 0f, 02, 03, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/let-else.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 11 +Number of file 0 mappings: 8 - Code(Counter(0)) at (prev + 12, 1) to (start + 0, 33) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) - Branch { true: Expression(0, Sub), false: Counter(1) } at (prev + 2, 9) to (start + 0, 16) true = (c0 - c1) false = c1 -- Code(Expression(0, Sub)) at (prev + 0, 14) to (start + 0, 15) - = (c0 - c1) - Code(Counter(0)) at (prev + 0, 19) to (start + 0, 24) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 19) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 20) - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15) -- Code(Expression(0, Sub)) at (prev + 3, 5) to (start + 0, 8) - = (c0 - c1) -- Code(Expression(0, Sub)) at (prev + 0, 9) to (start + 0, 10) +- Code(Expression(0, Sub)) at (prev + 3, 5) to (start + 0, 11) = (c0 - c1) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c1 diff --git a/tests/coverage/branch/let-else.coverage b/tests/coverage/branch/let-else.coverage index 22ad8f2b0e138..b6aba7cd24b16 100644 --- a/tests/coverage/branch/let-else.coverage +++ b/tests/coverage/branch/let-else.coverage @@ -13,7 +13,6 @@ LL| 3| no_merge!(); LL| | LL| 3| let Some(x) = value else { - ^2 ------------------ | Branch (LL:9): [True: 2, False: 1] ------------------ diff --git a/tests/coverage/branch/match-arms.cov-map b/tests/coverage/branch/match-arms.cov-map index a2ed0d84ed610..8fcf8a612c022 100644 --- a/tests/coverage/branch/match-arms.cov-map +++ b/tests/coverage/branch/match-arms.cov-map @@ -1,5 +1,5 @@ Function name: match_arms::guards -Raw bytes (158): 0x[01, 01, 08, 15, 05, 19, 09, 1d, 0d, 21, 11, 01, 17, 1b, 11, 1f, 0d, 05, 09, 1a, 01, 30, 01, 00, 23, 01, 01, 05, 00, 0e, 21, 02, 0b, 00, 10, 05, 01, 11, 00, 12, 20, 05, 02, 00, 17, 00, 1b, 05, 00, 1a, 00, 1b, 05, 00, 1f, 00, 26, 05, 00, 27, 00, 28, 09, 01, 11, 00, 12, 20, 09, 06, 00, 17, 00, 1b, 09, 00, 1a, 00, 1b, 09, 00, 1f, 00, 26, 09, 00, 27, 00, 28, 0d, 01, 11, 00, 12, 20, 0d, 0a, 00, 17, 00, 1b, 0d, 00, 1a, 00, 1b, 0d, 00, 1f, 00, 26, 0d, 00, 27, 00, 28, 11, 01, 11, 00, 12, 20, 11, 0e, 00, 17, 00, 1b, 11, 00, 1a, 00, 1b, 11, 00, 1f, 00, 26, 11, 00, 27, 00, 28, 12, 01, 0e, 00, 15, 01, 03, 05, 00, 0c, 01, 01, 01, 00, 02] +Raw bytes (118): 0x[01, 01, 08, 15, 05, 19, 09, 1d, 0d, 21, 11, 01, 17, 1b, 11, 1f, 0d, 05, 09, 12, 01, 30, 01, 00, 23, 01, 01, 05, 00, 0e, 01, 02, 0b, 00, 10, 15, 01, 17, 00, 1b, 20, 05, 02, 00, 17, 00, 1b, 05, 00, 1f, 00, 29, 19, 01, 17, 00, 1b, 20, 09, 06, 00, 17, 00, 1b, 09, 00, 1f, 00, 29, 1d, 01, 17, 00, 1b, 20, 0d, 0a, 00, 17, 00, 1b, 0d, 00, 1f, 00, 29, 21, 01, 17, 00, 1b, 20, 11, 0e, 00, 17, 00, 1b, 11, 00, 1f, 00, 29, 12, 01, 0e, 00, 18, 01, 03, 05, 00, 0f, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/match-arms.rs Number of expressions: 8 @@ -11,103 +11,73 @@ Number of expressions: 8 - expression 5 operands: lhs = Expression(6, Add), rhs = Counter(4) - expression 6 operands: lhs = Expression(7, Add), rhs = Counter(3) - expression 7 operands: lhs = Counter(1), rhs = Counter(2) -Number of file 0 mappings: 26 +Number of file 0 mappings: 18 - Code(Counter(0)) at (prev + 48, 1) to (start + 0, 35) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(8)) at (prev + 2, 11) to (start + 0, 16) -- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 18) +- Code(Counter(0)) at (prev + 2, 11) to (start + 0, 16) +- Code(Counter(5)) at (prev + 1, 23) to (start + 0, 27) - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 23) to (start + 0, 27) true = c1 false = (c5 - c1) -- Code(Counter(1)) at (prev + 0, 26) to (start + 0, 27) -- Code(Counter(1)) at (prev + 0, 31) to (start + 0, 38) -- Code(Counter(1)) at (prev + 0, 39) to (start + 0, 40) -- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 18) +- Code(Counter(1)) at (prev + 0, 31) to (start + 0, 41) +- Code(Counter(6)) at (prev + 1, 23) to (start + 0, 27) - Branch { true: Counter(2), false: Expression(1, Sub) } at (prev + 0, 23) to (start + 0, 27) true = c2 false = (c6 - c2) -- Code(Counter(2)) at (prev + 0, 26) to (start + 0, 27) -- Code(Counter(2)) at (prev + 0, 31) to (start + 0, 38) -- Code(Counter(2)) at (prev + 0, 39) to (start + 0, 40) -- Code(Counter(3)) at (prev + 1, 17) to (start + 0, 18) +- Code(Counter(2)) at (prev + 0, 31) to (start + 0, 41) +- Code(Counter(7)) at (prev + 1, 23) to (start + 0, 27) - Branch { true: Counter(3), false: Expression(2, Sub) } at (prev + 0, 23) to (start + 0, 27) true = c3 false = (c7 - c3) -- Code(Counter(3)) at (prev + 0, 26) to (start + 0, 27) -- Code(Counter(3)) at (prev + 0, 31) to (start + 0, 38) -- Code(Counter(3)) at (prev + 0, 39) to (start + 0, 40) -- Code(Counter(4)) at (prev + 1, 17) to (start + 0, 18) +- Code(Counter(3)) at (prev + 0, 31) to (start + 0, 41) +- Code(Counter(8)) at (prev + 1, 23) to (start + 0, 27) - Branch { true: Counter(4), false: Expression(3, Sub) } at (prev + 0, 23) to (start + 0, 27) true = c4 false = (c8 - c4) -- Code(Counter(4)) at (prev + 0, 26) to (start + 0, 27) -- Code(Counter(4)) at (prev + 0, 31) to (start + 0, 38) -- Code(Counter(4)) at (prev + 0, 39) to (start + 0, 40) -- Code(Expression(4, Sub)) at (prev + 1, 14) to (start + 0, 21) +- Code(Counter(4)) at (prev + 0, 31) to (start + 0, 41) +- Code(Expression(4, Sub)) at (prev + 1, 14) to (start + 0, 24) = (c0 - (((c1 + c2) + c3) + c4)) -- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 15) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c8 Function name: match_arms::match_arms -Raw bytes (95): 0x[01, 01, 03, 01, 07, 0b, 0d, 05, 09, 11, 01, 18, 01, 00, 1b, 01, 01, 05, 00, 0e, 01, 02, 0b, 00, 10, 05, 01, 11, 00, 12, 05, 00, 17, 00, 1e, 05, 00, 1f, 00, 20, 09, 01, 11, 00, 12, 09, 00, 17, 00, 1e, 09, 00, 1f, 00, 20, 0d, 01, 11, 00, 12, 0d, 00, 17, 00, 1e, 0d, 00, 1f, 00, 20, 02, 01, 11, 00, 12, 02, 00, 17, 00, 1e, 02, 00, 1f, 00, 20, 01, 03, 05, 00, 0c, 01, 01, 01, 00, 02] +Raw bytes (55): 0x[01, 01, 03, 01, 07, 0b, 0d, 05, 09, 09, 01, 18, 01, 00, 1b, 01, 01, 05, 00, 0e, 01, 02, 0b, 00, 10, 05, 01, 17, 00, 21, 09, 01, 17, 00, 21, 0d, 01, 17, 00, 21, 02, 01, 17, 00, 21, 01, 03, 05, 00, 0f, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/match-arms.rs Number of expressions: 3 - expression 0 operands: lhs = Counter(0), rhs = Expression(1, Add) - expression 1 operands: lhs = Expression(2, Add), rhs = Counter(3) - expression 2 operands: lhs = Counter(1), rhs = Counter(2) -Number of file 0 mappings: 17 +Number of file 0 mappings: 9 - Code(Counter(0)) at (prev + 24, 1) to (start + 0, 27) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) - Code(Counter(0)) at (prev + 2, 11) to (start + 0, 16) -- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 18) -- Code(Counter(1)) at (prev + 0, 23) to (start + 0, 30) -- Code(Counter(1)) at (prev + 0, 31) to (start + 0, 32) -- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 18) -- Code(Counter(2)) at (prev + 0, 23) to (start + 0, 30) -- Code(Counter(2)) at (prev + 0, 31) to (start + 0, 32) -- Code(Counter(3)) at (prev + 1, 17) to (start + 0, 18) -- Code(Counter(3)) at (prev + 0, 23) to (start + 0, 30) -- Code(Counter(3)) at (prev + 0, 31) to (start + 0, 32) -- Code(Expression(0, Sub)) at (prev + 1, 17) to (start + 0, 18) - = (c0 - ((c1 + c2) + c3)) -- Code(Expression(0, Sub)) at (prev + 0, 23) to (start + 0, 30) +- Code(Counter(1)) at (prev + 1, 23) to (start + 0, 33) +- Code(Counter(2)) at (prev + 1, 23) to (start + 0, 33) +- Code(Counter(3)) at (prev + 1, 23) to (start + 0, 33) +- Code(Expression(0, Sub)) at (prev + 1, 23) to (start + 0, 33) = (c0 - ((c1 + c2) + c3)) -- Code(Expression(0, Sub)) at (prev + 0, 31) to (start + 0, 32) - = (c0 - ((c1 + c2) + c3)) -- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 15) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c3 Function name: match_arms::or_patterns -Raw bytes (79): 0x[01, 01, 05, 05, 09, 01, 0b, 03, 0d, 01, 03, 01, 03, 0d, 01, 25, 01, 00, 1c, 01, 01, 05, 00, 0e, 01, 02, 0b, 00, 10, 05, 01, 11, 00, 12, 09, 00, 1e, 00, 1f, 03, 00, 24, 00, 2b, 03, 00, 2c, 00, 2d, 0d, 01, 11, 00, 12, 06, 00, 1e, 00, 1f, 12, 00, 24, 00, 2b, 12, 00, 2c, 00, 2d, 01, 03, 05, 00, 0c, 01, 01, 01, 00, 02] +Raw bytes (43): 0x[01, 01, 02, 05, 09, 01, 03, 07, 01, 25, 01, 00, 1c, 01, 01, 05, 00, 0e, 01, 02, 0b, 00, 10, 03, 01, 24, 00, 2e, 06, 01, 24, 00, 2e, 01, 03, 05, 00, 0f, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/match-arms.rs -Number of expressions: 5 +Number of expressions: 2 - expression 0 operands: lhs = Counter(1), rhs = Counter(2) -- expression 1 operands: lhs = Counter(0), rhs = Expression(2, Add) -- expression 2 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 3 operands: lhs = Counter(0), rhs = Expression(0, Add) -- expression 4 operands: lhs = Counter(0), rhs = Expression(0, Add) -Number of file 0 mappings: 13 +- expression 1 operands: lhs = Counter(0), rhs = Expression(0, Add) +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 37, 1) to (start + 0, 28) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) - Code(Counter(0)) at (prev + 2, 11) to (start + 0, 16) -- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 18) -- Code(Counter(2)) at (prev + 0, 30) to (start + 0, 31) -- Code(Expression(0, Add)) at (prev + 0, 36) to (start + 0, 43) - = (c1 + c2) -- Code(Expression(0, Add)) at (prev + 0, 44) to (start + 0, 45) +- Code(Expression(0, Add)) at (prev + 1, 36) to (start + 0, 46) = (c1 + c2) -- Code(Counter(3)) at (prev + 1, 17) to (start + 0, 18) -- Code(Expression(1, Sub)) at (prev + 0, 30) to (start + 0, 31) - = (c0 - ((c1 + c2) + c3)) -- Code(Expression(4, Sub)) at (prev + 0, 36) to (start + 0, 43) - = (c0 - (c1 + c2)) -- Code(Expression(4, Sub)) at (prev + 0, 44) to (start + 0, 45) +- Code(Expression(1, Sub)) at (prev + 1, 36) to (start + 0, 46) = (c0 - (c1 + c2)) -- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 15) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c3 +Highest counter ID seen: c0 diff --git a/tests/coverage/branch/match-arms.coverage b/tests/coverage/branch/match-arms.coverage index ea8a6f97ab154..846bd0e073896 100644 --- a/tests/coverage/branch/match-arms.coverage +++ b/tests/coverage/branch/match-arms.coverage @@ -39,9 +39,7 @@ LL| | LL| 15| match value { LL| 12| Enum::D(x) | Enum::C(x) => consume(x), - ^8 ^4 LL| 3| Enum::B(y) | Enum::A(y) => consume(y), - ^2 ^1 LL| | } LL| | LL| 15| consume(0); @@ -50,20 +48,24 @@ LL| 45|fn guards(value: Enum, cond: bool) { LL| 45| no_merge!(); LL| | - LL| 3| match value { - LL| 8| Enum::D(d) if cond => consume(d), + LL| 45| match value { + LL| 24| Enum::D(d) if cond => consume(d), + ^8 ------------------ | Branch (LL:23): [True: 8, False: 16] ------------------ - LL| 4| Enum::C(c) if cond => consume(c), + LL| 12| Enum::C(c) if cond => consume(c), + ^4 ------------------ | Branch (LL:23): [True: 4, False: 8] ------------------ - LL| 2| Enum::B(b) if cond => consume(b), + LL| 6| Enum::B(b) if cond => consume(b), + ^2 ------------------ | Branch (LL:23): [True: 2, False: 4] ------------------ - LL| 1| Enum::A(a) if cond => consume(a), + LL| 3| Enum::A(a) if cond => consume(a), + ^1 ------------------ | Branch (LL:23): [True: 1, False: 2] ------------------ diff --git a/tests/coverage/branch/match-trivial.cov-map b/tests/coverage/branch/match-trivial.cov-map index a88e89523ae26..b519d5c890173 100644 --- a/tests/coverage/branch/match-trivial.cov-map +++ b/tests/coverage/branch/match-trivial.cov-map @@ -9,16 +9,16 @@ Number of file 0 mappings: 2 Highest counter ID seen: (none) Function name: match_trivial::trivial -Raw bytes (34): 0x[01, 01, 00, 06, 01, 1e, 01, 00, 17, 01, 01, 05, 00, 0e, 01, 02, 0b, 00, 0c, 01, 01, 1b, 00, 22, 01, 03, 05, 00, 0c, 01, 01, 01, 00, 02] +Raw bytes (34): 0x[01, 01, 00, 06, 01, 1e, 01, 00, 17, 01, 01, 05, 00, 0e, 01, 02, 05, 02, 06, 01, 00, 0b, 00, 0c, 01, 04, 05, 00, 14, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/match-trivial.rs Number of expressions: 0 Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 30, 1) to (start + 0, 23) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 2, 11) to (start + 0, 12) -- Code(Counter(0)) at (prev + 1, 27) to (start + 0, 34) -- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 2, 5) to (start + 2, 6) +- Code(Counter(0)) at (prev + 0, 11) to (start + 0, 12) +- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 20) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/branch/match-trivial.coverage b/tests/coverage/branch/match-trivial.coverage index 6e7bf2d29abc3..3bdfff1d9383c 100644 --- a/tests/coverage/branch/match-trivial.coverage +++ b/tests/coverage/branch/match-trivial.coverage @@ -32,7 +32,7 @@ LL| | LL| 1| match x { LL| 1| Trivial::Value => consume("trivial"), - LL| | } + LL| 1| } LL| | LL| 1| consume("done"); LL| 1|} diff --git a/tests/coverage/branch/while.cov-map b/tests/coverage/branch/while.cov-map index 767a7e46495fa..ee5e5a8706f80 100644 --- a/tests/coverage/branch/while.cov-map +++ b/tests/coverage/branch/while.cov-map @@ -1,14 +1,13 @@ Function name: while::while_cond -Raw bytes (48): 0x[01, 01, 01, 05, 01, 08, 01, 0c, 01, 00, 10, 01, 01, 05, 00, 0e, 01, 02, 09, 00, 0e, 01, 00, 11, 00, 12, 05, 01, 0b, 00, 10, 20, 02, 01, 00, 0b, 00, 10, 02, 00, 11, 02, 06, 01, 03, 01, 00, 02] +Raw bytes (43): 0x[01, 01, 01, 05, 01, 07, 01, 0c, 01, 00, 10, 01, 01, 05, 00, 0e, 01, 02, 11, 00, 12, 05, 01, 0b, 00, 10, 20, 02, 01, 00, 0b, 00, 10, 02, 00, 11, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/while.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(1), rhs = Counter(0) -Number of file 0 mappings: 8 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 12, 1) to (start + 0, 16) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) +- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 18) - Code(Counter(1)) at (prev + 1, 11) to (start + 0, 16) - Branch { true: Expression(0, Sub), false: Counter(0) } at (prev + 0, 11) to (start + 0, 16) true = (c1 - c0) @@ -19,16 +18,15 @@ Number of file 0 mappings: 8 Highest counter ID seen: c1 Function name: while::while_cond_not -Raw bytes (48): 0x[01, 01, 01, 05, 01, 08, 01, 15, 01, 00, 14, 01, 01, 05, 00, 0e, 01, 02, 09, 00, 0e, 01, 00, 11, 00, 12, 05, 01, 0b, 00, 14, 20, 02, 01, 00, 0b, 00, 14, 02, 00, 15, 02, 06, 01, 03, 01, 00, 02] +Raw bytes (43): 0x[01, 01, 01, 05, 01, 07, 01, 15, 01, 00, 14, 01, 01, 05, 00, 0e, 01, 02, 11, 00, 12, 05, 01, 0b, 00, 14, 20, 02, 01, 00, 0b, 00, 14, 02, 00, 15, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/while.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(1), rhs = Counter(0) -Number of file 0 mappings: 8 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 21, 1) to (start + 0, 20) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) +- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 18) - Code(Counter(1)) at (prev + 1, 11) to (start + 0, 20) - Branch { true: Expression(0, Sub), false: Counter(0) } at (prev + 0, 11) to (start + 0, 20) true = (c1 - c0) @@ -39,51 +37,51 @@ Number of file 0 mappings: 8 Highest counter ID seen: c1 Function name: while::while_op_and -Raw bytes (78): 0x[01, 01, 05, 05, 09, 05, 01, 0f, 05, 01, 09, 05, 01, 0c, 01, 1e, 01, 00, 12, 01, 01, 05, 00, 0e, 01, 02, 09, 00, 0e, 01, 00, 11, 00, 12, 01, 01, 09, 00, 0e, 01, 00, 11, 00, 12, 05, 01, 0b, 00, 10, 20, 09, 02, 00, 0b, 00, 10, 09, 00, 14, 00, 19, 20, 12, 0a, 00, 14, 00, 19, 12, 00, 1a, 03, 06, 01, 04, 01, 00, 02] +Raw bytes (75): 0x[01, 01, 06, 05, 09, 05, 01, 0f, 05, 01, 09, 05, 01, 05, 01, 0b, 01, 1e, 01, 00, 12, 01, 01, 05, 00, 0e, 01, 02, 11, 00, 12, 01, 01, 11, 00, 12, 05, 01, 0b, 00, 10, 20, 09, 02, 00, 0b, 00, 10, 09, 00, 14, 00, 19, 20, 16, 0a, 00, 14, 00, 19, 16, 00, 1a, 03, 06, 16, 01, 09, 00, 0f, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/while.rs -Number of expressions: 5 +Number of expressions: 6 - expression 0 operands: lhs = Counter(1), rhs = Counter(2) - expression 1 operands: lhs = Counter(1), rhs = Counter(0) - expression 2 operands: lhs = Expression(3, Add), rhs = Counter(1) - expression 3 operands: lhs = Counter(0), rhs = Counter(2) - expression 4 operands: lhs = Counter(1), rhs = Counter(0) -Number of file 0 mappings: 12 +- expression 5 operands: lhs = Counter(1), rhs = Counter(0) +Number of file 0 mappings: 11 - Code(Counter(0)) at (prev + 30, 1) to (start + 0, 18) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) +- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 18) - Code(Counter(1)) at (prev + 1, 11) to (start + 0, 16) - Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 11) to (start + 0, 16) true = c2 false = (c1 - c2) - Code(Counter(2)) at (prev + 0, 20) to (start + 0, 25) -- Branch { true: Expression(4, Sub), false: Expression(2, Sub) } at (prev + 0, 20) to (start + 0, 25) +- Branch { true: Expression(5, Sub), false: Expression(2, Sub) } at (prev + 0, 20) to (start + 0, 25) true = (c1 - c0) false = ((c0 + c2) - c1) -- Code(Expression(4, Sub)) at (prev + 0, 26) to (start + 3, 6) +- Code(Expression(5, Sub)) at (prev + 0, 26) to (start + 3, 6) + = (c1 - c0) +- Code(Expression(5, Sub)) at (prev + 1, 9) to (start + 0, 15) = (c1 - c0) -- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 2) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) Highest counter ID seen: c2 Function name: while::while_op_or -Raw bytes (76): 0x[01, 01, 04, 05, 09, 05, 0b, 01, 09, 05, 01, 0c, 01, 29, 01, 00, 11, 01, 01, 05, 00, 0e, 01, 02, 09, 00, 0e, 01, 00, 11, 00, 12, 01, 01, 09, 00, 0e, 01, 00, 11, 00, 12, 05, 01, 0b, 00, 10, 20, 09, 02, 00, 0b, 00, 10, 02, 00, 14, 00, 19, 20, 06, 01, 00, 14, 00, 19, 0e, 00, 1a, 03, 06, 01, 04, 01, 00, 02] +Raw bytes (73): 0x[01, 01, 05, 05, 09, 05, 0b, 01, 09, 05, 01, 05, 01, 0b, 01, 29, 01, 00, 11, 01, 01, 05, 00, 0e, 01, 02, 11, 00, 12, 01, 01, 11, 00, 12, 05, 01, 0b, 00, 10, 20, 09, 02, 00, 0b, 00, 10, 02, 00, 14, 00, 19, 20, 06, 01, 00, 14, 00, 19, 12, 00, 1a, 03, 06, 12, 01, 09, 00, 0f, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/while.rs -Number of expressions: 4 +Number of expressions: 5 - expression 0 operands: lhs = Counter(1), rhs = Counter(2) - expression 1 operands: lhs = Counter(1), rhs = Expression(2, Add) - expression 2 operands: lhs = Counter(0), rhs = Counter(2) - expression 3 operands: lhs = Counter(1), rhs = Counter(0) -Number of file 0 mappings: 12 +- expression 4 operands: lhs = Counter(1), rhs = Counter(0) +Number of file 0 mappings: 11 - Code(Counter(0)) at (prev + 41, 1) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) +- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 18) - Code(Counter(1)) at (prev + 1, 11) to (start + 0, 16) - Branch { true: Counter(2), false: Expression(0, Sub) } at (prev + 0, 11) to (start + 0, 16) true = c2 @@ -93,8 +91,10 @@ Number of file 0 mappings: 12 - Branch { true: Expression(1, Sub), false: Counter(0) } at (prev + 0, 20) to (start + 0, 25) true = (c1 - (c0 + c2)) false = c0 -- Code(Expression(3, Sub)) at (prev + 0, 26) to (start + 3, 6) +- Code(Expression(4, Sub)) at (prev + 0, 26) to (start + 3, 6) = (c1 - c0) -- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 2) +- Code(Expression(4, Sub)) at (prev + 1, 9) to (start + 0, 15) + = (c1 - c0) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) Highest counter ID seen: c2 diff --git a/tests/coverage/call-method.cov-map b/tests/coverage/call-method.cov-map new file mode 100644 index 0000000000000..2ad5137a6c26b --- /dev/null +++ b/tests/coverage/call-method.cov-map @@ -0,0 +1,13 @@ +Function name: call_method::call_method +Raw bytes (29): 0x[01, 01, 00, 05, 01, 08, 01, 00, 11, 01, 01, 11, 00, 16, 01, 02, 05, 05, 0a, 01, 08, 05, 0a, 0a, 01, 0c, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/call-method.rs +Number of expressions: 0 +Number of file 0 mappings: 5 +- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 17) +- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 22) +- Code(Counter(0)) at (prev + 2, 5) to (start + 5, 10) +- Code(Counter(0)) at (prev + 8, 5) to (start + 10, 10) +- Code(Counter(0)) at (prev + 12, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/call-method.coverage b/tests/coverage/call-method.coverage new file mode 100644 index 0000000000000..8c5bb57a2d788 --- /dev/null +++ b/tests/coverage/call-method.coverage @@ -0,0 +1,46 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ min-llvm-version: 23 + LL| | + LL| |// Basic test for method calls and chained method calls. + LL| | + LL| |#[rustfmt::skip] + LL| 1|fn call_method() { + LL| 1| let thing = Thing; + LL| | + LL| 1| thing + LL| 1| . + LL| 1| method + LL| 1| ( + LL| 1| "arg" + LL| 1| ) + LL| | ; + LL| | + LL| 1| thing + LL| 1| . + LL| 1| method + LL| 1| ( + LL| 1| "arg" + LL| 1| ) + LL| 1| . + LL| 1| method + LL| 1| ( + LL| 1| "arg" + LL| 1| ) + LL| | ; + LL| 1|} + LL| | + LL| |struct Thing; + LL| | + LL| |#[coverage(off)] + LL| |impl Thing { + LL| | fn method(&self, _arg: &str) -> &Self { + LL| | self + LL| | } + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | call_method(); + LL| |} + diff --git a/tests/coverage/call-method.rs b/tests/coverage/call-method.rs new file mode 100644 index 0000000000000..42b753503331b --- /dev/null +++ b/tests/coverage/call-method.rs @@ -0,0 +1,45 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ min-llvm-version: 23 + +// Basic test for method calls and chained method calls. + +#[rustfmt::skip] +fn call_method() { + let thing = Thing; + + thing + . + method + ( + "arg" + ) + ; + + thing + . + method + ( + "arg" + ) + . + method + ( + "arg" + ) + ; +} + +struct Thing; + +#[coverage(off)] +impl Thing { + fn method(&self, _arg: &str) -> &Self { + self + } +} + +#[coverage(off)] +fn main() { + call_method(); +} diff --git a/tests/coverage/closure.cov-map b/tests/coverage/closure.cov-map deleted file mode 100644 index d21be004594d8..0000000000000 --- a/tests/coverage/closure.cov-map +++ /dev/null @@ -1,323 +0,0 @@ -Function name: closure::main -Raw bytes (311): 0x[01, 01, 01, 01, 05, 3d, 01, 09, 01, 00, 0a, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 11, 01, 00, 14, 00, 1c, 01, 02, 09, 00, 18, 01, 00, 1b, 00, 43, 01, 01, 05, 00, 0d, 01, 03, 09, 00, 14, 01, 02, 0d, 00, 1b, 01, 0d, 05, 00, 10, 01, 00, 13, 00, 3b, 01, 02, 09, 00, 0a, 01, 0a, 05, 00, 0d, 01, 03, 09, 00, 14, 01, 02, 0d, 00, 1b, 01, 02, 0d, 00, 0e, 01, 04, 05, 00, 10, 01, 00, 13, 00, 17, 01, 01, 05, 00, 0d, 01, 03, 09, 00, 14, 01, 02, 0d, 00, 1b, 01, 0d, 05, 00, 10, 01, 00, 13, 00, 17, 01, 02, 09, 00, 0a, 01, 0a, 05, 00, 0d, 01, 03, 09, 00, 14, 01, 02, 0d, 00, 1b, 01, 02, 0d, 00, 0e, 01, 05, 09, 00, 16, 01, 0a, 05, 00, 0d, 01, 03, 09, 00, 1a, 01, 01, 0e, 00, 12, 01, 01, 0e, 00, 11, 01, 02, 0d, 00, 1a, 01, 02, 0e, 00, 15, 01, 04, 09, 00, 18, 01, 0c, 09, 00, 16, 01, 00, 19, 00, 1b, 01, 01, 09, 00, 1e, 01, 03, 09, 00, 29, 01, 01, 09, 00, 2d, 01, 01, 09, 00, 24, 01, 05, 09, 00, 24, 01, 02, 09, 00, 21, 01, 04, 09, 00, 21, 01, 04, 09, 00, 28, 01, 09, 09, 00, 32, 01, 04, 09, 00, 33, 01, 07, 09, 00, 4b, 01, 08, 09, 00, 48, 01, 0a, 09, 00, 47, 01, 08, 09, 00, 44, 01, 0a, 08, 00, 10, 05, 00, 11, 04, 06, 05, 01, 09, 00, 30, 02, 03, 05, 00, 06, 01, 01, 05, 00, 28, 01, 01, 05, 00, 46, 01, 01, 05, 00, 43, 01, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 61 -- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 28) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 24) -- Code(Counter(0)) at (prev + 0, 27) to (start + 0, 67) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 20) -- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 27) -- Code(Counter(0)) at (prev + 13, 5) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 59) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 10, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 20) -- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 27) -- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 14) -- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 23) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 20) -- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 27) -- Code(Counter(0)) at (prev + 13, 5) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 23) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 10, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 20) -- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 27) -- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 14) -- Code(Counter(0)) at (prev + 5, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 10, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 26) -- Code(Counter(0)) at (prev + 1, 14) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 14) to (start + 0, 17) -- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 26) -- Code(Counter(0)) at (prev + 2, 14) to (start + 0, 21) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 24) -- Code(Counter(0)) at (prev + 12, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 30) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 41) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 45) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 36) -- Code(Counter(0)) at (prev + 5, 9) to (start + 0, 36) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 33) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 33) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 40) -- Code(Counter(0)) at (prev + 9, 9) to (start + 0, 50) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 51) -- Code(Counter(0)) at (prev + 7, 9) to (start + 0, 75) -- Code(Counter(0)) at (prev + 8, 9) to (start + 0, 72) -- Code(Counter(0)) at (prev + 10, 9) to (start + 0, 71) -- Code(Counter(0)) at (prev + 8, 9) to (start + 0, 68) -- Code(Counter(0)) at (prev + 10, 8) to (start + 0, 16) -- Code(Counter(1)) at (prev + 0, 17) to (start + 4, 6) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 48) -- Code(Expression(0, Sub)) at (prev + 3, 5) to (start + 0, 6) - = (c0 - c1) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 40) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 70) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 67) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c1 - -Function name: closure::main::{closure#0} (unused) -Raw bytes (49): 0x[01, 01, 00, 09, 00, 28, 05, 00, 06, 00, 01, 0d, 00, 1a, 00, 00, 1d, 00, 1e, 00, 01, 0c, 00, 14, 00, 00, 15, 02, 0a, 00, 02, 09, 00, 0a, 00, 01, 09, 00, 17, 00, 00, 18, 00, 20, 00, 01, 05, 00, 06] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 0 -Number of file 0 mappings: 9 -- Code(Zero) at (prev + 40, 5) to (start + 0, 6) -- Code(Zero) at (prev + 1, 13) to (start + 0, 26) -- Code(Zero) at (prev + 0, 29) to (start + 0, 30) -- Code(Zero) at (prev + 1, 12) to (start + 0, 20) -- Code(Zero) at (prev + 0, 21) to (start + 2, 10) -- Code(Zero) at (prev + 2, 9) to (start + 0, 10) -- Code(Zero) at (prev + 1, 9) to (start + 0, 23) -- Code(Zero) at (prev + 0, 24) to (start + 0, 32) -- Code(Zero) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: (none) - -Function name: closure::main::{closure#10} (unused) -Raw bytes (20): 0x[01, 01, 00, 03, 00, 9b, 01, 07, 00, 08, 00, 00, 09, 00, 11, 00, 00, 20, 00, 21] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 0 -Number of file 0 mappings: 3 -- Code(Zero) at (prev + 155, 7) to (start + 0, 8) -- Code(Zero) at (prev + 0, 9) to (start + 0, 17) -- Code(Zero) at (prev + 0, 32) to (start + 0, 33) -Highest counter ID seen: (none) - -Function name: closure::main::{closure#11} (unused) -Raw bytes (20): 0x[01, 01, 00, 03, 00, 9f, 01, 07, 00, 08, 00, 00, 09, 00, 11, 00, 00, 20, 00, 21] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 0 -Number of file 0 mappings: 3 -- Code(Zero) at (prev + 159, 7) to (start + 0, 8) -- Code(Zero) at (prev + 0, 9) to (start + 0, 17) -- Code(Zero) at (prev + 0, 32) to (start + 0, 33) -Highest counter ID seen: (none) - -Function name: closure::main::{closure#12} (unused) -Raw bytes (10): 0x[01, 01, 00, 01, 00, a7, 01, 01, 00, 09] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 0 -Number of file 0 mappings: 1 -- Code(Zero) at (prev + 167, 1) to (start + 0, 9) -Highest counter ID seen: (none) - -Function name: closure::main::{closure#13} (unused) -Raw bytes (10): 0x[01, 01, 00, 01, 00, ac, 01, 0d, 00, 15] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 0 -Number of file 0 mappings: 1 -- Code(Zero) at (prev + 172, 13) to (start + 0, 21) -Highest counter ID seen: (none) - -Function name: closure::main::{closure#14} -Raw bytes (22): 0x[01, 01, 01, 01, 05, 03, 01, b5, 01, 14, 00, 1b, 05, 00, 1e, 00, 25, 02, 00, 2f, 00, 33] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 3 -- Code(Counter(0)) at (prev + 181, 20) to (start + 0, 27) -- Code(Counter(1)) at (prev + 0, 30) to (start + 0, 37) -- Code(Expression(0, Sub)) at (prev + 0, 47) to (start + 0, 51) - = (c0 - c1) -Highest counter ID seen: c1 - -Function name: closure::main::{closure#15} -Raw bytes (37): 0x[01, 01, 01, 01, 05, 06, 01, bb, 01, 09, 00, 0a, 01, 01, 0d, 00, 15, 01, 02, 14, 00, 1b, 05, 00, 1e, 00, 25, 02, 00, 2f, 00, 33, 01, 02, 09, 00, 0a] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 6 -- Code(Counter(0)) at (prev + 187, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 21) -- Code(Counter(0)) at (prev + 2, 20) to (start + 0, 27) -- Code(Counter(1)) at (prev + 0, 30) to (start + 0, 37) -- Code(Expression(0, Sub)) at (prev + 0, 47) to (start + 0, 51) - = (c0 - c1) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) -Highest counter ID seen: c1 - -Function name: closure::main::{closure#16} -Raw bytes (22): 0x[01, 01, 01, 01, 05, 03, 01, c7, 01, 14, 00, 1b, 05, 00, 1e, 00, 25, 02, 00, 2f, 00, 33] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 3 -- Code(Counter(0)) at (prev + 199, 20) to (start + 0, 27) -- Code(Counter(1)) at (prev + 0, 30) to (start + 0, 37) -- Code(Expression(0, Sub)) at (prev + 0, 47) to (start + 0, 51) - = (c0 - c1) -Highest counter ID seen: c1 - -Function name: closure::main::{closure#17} -Raw bytes (37): 0x[01, 01, 01, 01, 05, 06, 01, cd, 01, 09, 00, 0a, 01, 01, 0d, 00, 15, 01, 02, 14, 00, 1b, 05, 00, 1e, 00, 25, 02, 00, 2f, 00, 33, 01, 02, 09, 00, 0a] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 6 -- Code(Counter(0)) at (prev + 205, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 21) -- Code(Counter(0)) at (prev + 2, 20) to (start + 0, 27) -- Code(Counter(1)) at (prev + 0, 30) to (start + 0, 37) -- Code(Expression(0, Sub)) at (prev + 0, 47) to (start + 0, 51) - = (c0 - c1) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) -Highest counter ID seen: c1 - -Function name: closure::main::{closure#18} (unused) -Raw bytes (49): 0x[01, 01, 00, 09, 00, 19, 0d, 00, 0e, 00, 01, 15, 00, 22, 00, 00, 25, 00, 26, 00, 01, 14, 00, 1c, 00, 00, 1d, 02, 12, 00, 02, 11, 00, 12, 00, 01, 11, 00, 1f, 00, 00, 20, 00, 28, 00, 01, 0d, 00, 0e] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 0 -Number of file 0 mappings: 9 -- Code(Zero) at (prev + 25, 13) to (start + 0, 14) -- Code(Zero) at (prev + 1, 21) to (start + 0, 34) -- Code(Zero) at (prev + 0, 37) to (start + 0, 38) -- Code(Zero) at (prev + 1, 20) to (start + 0, 28) -- Code(Zero) at (prev + 0, 29) to (start + 2, 18) -- Code(Zero) at (prev + 2, 17) to (start + 0, 18) -- Code(Zero) at (prev + 1, 17) to (start + 0, 31) -- Code(Zero) at (prev + 0, 32) to (start + 0, 40) -- Code(Zero) at (prev + 1, 13) to (start + 0, 14) -Highest counter ID seen: (none) - -Function name: closure::main::{closure#19} -Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 43, 0d, 00, 0e, 01, 01, 15, 00, 22, 01, 00, 25, 00, 26, 01, 01, 14, 00, 1c, 05, 00, 1d, 02, 12, 02, 02, 11, 00, 12, 01, 01, 11, 00, 1f, 01, 00, 20, 00, 28, 01, 01, 0d, 00, 0e] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 9 -- Code(Counter(0)) at (prev + 67, 13) to (start + 0, 14) -- Code(Counter(0)) at (prev + 1, 21) to (start + 0, 34) -- Code(Counter(0)) at (prev + 0, 37) to (start + 0, 38) -- Code(Counter(0)) at (prev + 1, 20) to (start + 0, 28) -- Code(Counter(1)) at (prev + 0, 29) to (start + 2, 18) -- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 18) - = (c0 - c1) -- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 31) -- Code(Counter(0)) at (prev + 0, 32) to (start + 0, 40) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) -Highest counter ID seen: c1 - -Function name: closure::main::{closure#1} -Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 52, 05, 00, 06, 01, 01, 0d, 00, 1a, 01, 00, 1d, 00, 1e, 01, 01, 0c, 00, 14, 05, 00, 15, 02, 0a, 02, 02, 09, 00, 0a, 01, 01, 09, 00, 17, 01, 00, 18, 00, 20, 01, 01, 05, 00, 06] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 9 -- Code(Counter(0)) at (prev + 82, 5) to (start + 0, 6) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 26) -- Code(Counter(0)) at (prev + 0, 29) to (start + 0, 30) -- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 20) -- Code(Counter(1)) at (prev + 0, 21) to (start + 2, 10) -- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10) - = (c0 - c1) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 23) -- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 32) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: c1 - -Function name: closure::main::{closure#2} -Raw bytes (46): 0x[01, 01, 01, 01, 05, 08, 01, 68, 05, 00, 06, 01, 01, 0d, 00, 1a, 01, 00, 1d, 00, 1e, 01, 01, 0c, 00, 14, 05, 00, 15, 02, 0a, 02, 02, 09, 00, 0a, 01, 01, 09, 00, 10, 01, 01, 05, 00, 06] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 8 -- Code(Counter(0)) at (prev + 104, 5) to (start + 0, 6) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 26) -- Code(Counter(0)) at (prev + 0, 29) to (start + 0, 30) -- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 20) -- Code(Counter(1)) at (prev + 0, 21) to (start + 2, 10) -- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10) - = (c0 - c1) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: c1 - -Function name: closure::main::{closure#3} (unused) -Raw bytes (40): 0x[01, 01, 00, 07, 00, 81, 01, 05, 00, 06, 00, 01, 0c, 00, 14, 00, 00, 15, 02, 0a, 00, 02, 09, 00, 0a, 00, 01, 09, 00, 23, 00, 00, 24, 00, 2c, 00, 01, 05, 00, 06] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 0 -Number of file 0 mappings: 7 -- Code(Zero) at (prev + 129, 5) to (start + 0, 6) -- Code(Zero) at (prev + 1, 12) to (start + 0, 20) -- Code(Zero) at (prev + 0, 21) to (start + 2, 10) -- Code(Zero) at (prev + 2, 9) to (start + 0, 10) -- Code(Zero) at (prev + 1, 9) to (start + 0, 35) -- Code(Zero) at (prev + 0, 36) to (start + 0, 44) -- Code(Zero) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: (none) - -Function name: closure::main::{closure#5} -Raw bytes (10): 0x[01, 01, 00, 01, 01, 8c, 01, 3d, 00, 45] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 0 -Number of file 0 mappings: 1 -- Code(Counter(0)) at (prev + 140, 61) to (start + 0, 69) -Highest counter ID seen: c0 - -Function name: closure::main::{closure#6} -Raw bytes (10): 0x[01, 01, 00, 01, 01, 8d, 01, 41, 00, 49] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 0 -Number of file 0 mappings: 1 -- Code(Counter(0)) at (prev + 141, 65) to (start + 0, 73) -Highest counter ID seen: c0 - -Function name: closure::main::{closure#7} (unused) -Raw bytes (10): 0x[01, 01, 00, 01, 00, 8e, 01, 3b, 00, 43] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 0 -Number of file 0 mappings: 1 -- Code(Zero) at (prev + 142, 59) to (start + 0, 67) -Highest counter ID seen: (none) - -Function name: closure::main::{closure#8} (unused) -Raw bytes (20): 0x[01, 01, 00, 03, 00, 93, 01, 3b, 00, 3c, 00, 00, 3d, 00, 45, 00, 00, 54, 00, 55] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 0 -Number of file 0 mappings: 3 -- Code(Zero) at (prev + 147, 59) to (start + 0, 60) -- Code(Zero) at (prev + 0, 61) to (start + 0, 69) -- Code(Zero) at (prev + 0, 84) to (start + 0, 85) -Highest counter ID seen: (none) - -Function name: closure::main::{closure#9} (unused) -Raw bytes (20): 0x[01, 01, 00, 03, 00, 95, 01, 38, 00, 39, 00, 01, 09, 00, 11, 00, 01, 05, 00, 06] -Number of files: 1 -- file 0 => $DIR/closure.rs -Number of expressions: 0 -Number of file 0 mappings: 3 -- Code(Zero) at (prev + 149, 56) to (start + 0, 57) -- Code(Zero) at (prev + 1, 9) to (start + 0, 17) -- Code(Zero) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: (none) - diff --git a/tests/coverage/closure_bug.cov-map b/tests/coverage/closure_bug.cov-map index a7087c69dcba5..62253533b5e02 100644 --- a/tests/coverage/closure_bug.cov-map +++ b/tests/coverage/closure_bug.cov-map @@ -1,5 +1,5 @@ Function name: closure_bug::main -Raw bytes (132): 0x[01, 01, 04, 01, 05, 01, 09, 01, 0d, 01, 11, 18, 01, 07, 01, 00, 0a, 01, 01, 09, 00, 0f, 01, 00, 12, 00, 2d, 01, 02, 09, 00, 0a, 01, 06, 05, 00, 08, 01, 01, 08, 00, 0e, 05, 00, 0f, 00, 17, 02, 00, 16, 00, 17, 01, 02, 09, 00, 0a, 01, 06, 05, 00, 08, 01, 01, 08, 00, 0e, 09, 00, 0f, 00, 17, 06, 00, 16, 00, 17, 01, 02, 09, 00, 0a, 01, 06, 05, 00, 08, 01, 01, 08, 00, 0e, 0d, 00, 0f, 00, 17, 0a, 00, 16, 00, 17, 01, 02, 09, 00, 0a, 01, 06, 05, 00, 08, 01, 01, 08, 00, 0e, 11, 00, 0f, 00, 17, 0e, 00, 16, 00, 17, 01, 01, 01, 00, 02] +Raw bytes (107): 0x[01, 01, 04, 01, 05, 01, 09, 01, 0d, 01, 11, 13, 01, 07, 01, 00, 0a, 01, 01, 12, 00, 2d, 01, 08, 05, 00, 08, 01, 01, 08, 00, 0e, 05, 00, 0f, 00, 17, 02, 00, 16, 00, 17, 01, 08, 05, 00, 08, 01, 01, 08, 00, 0e, 09, 00, 0f, 00, 17, 06, 00, 16, 00, 17, 01, 08, 05, 00, 08, 01, 01, 08, 00, 0e, 0d, 00, 0f, 00, 17, 0a, 00, 16, 00, 17, 01, 08, 05, 00, 08, 01, 01, 08, 00, 0e, 11, 00, 0f, 00, 17, 0e, 00, 16, 00, 17, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/closure_bug.rs Number of expressions: 4 @@ -7,30 +7,25 @@ Number of expressions: 4 - expression 1 operands: lhs = Counter(0), rhs = Counter(2) - expression 2 operands: lhs = Counter(0), rhs = Counter(3) - expression 3 operands: lhs = Counter(0), rhs = Counter(4) -Number of file 0 mappings: 24 +Number of file 0 mappings: 19 - Code(Counter(0)) at (prev + 7, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) -- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 45) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 1, 18) to (start + 0, 45) +- Code(Counter(0)) at (prev + 8, 5) to (start + 0, 8) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 14) - Code(Counter(1)) at (prev + 0, 15) to (start + 0, 23) - Code(Expression(0, Sub)) at (prev + 0, 22) to (start + 0, 23) = (c0 - c1) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 8, 5) to (start + 0, 8) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 14) - Code(Counter(2)) at (prev + 0, 15) to (start + 0, 23) - Code(Expression(1, Sub)) at (prev + 0, 22) to (start + 0, 23) = (c0 - c2) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 8, 5) to (start + 0, 8) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 14) - Code(Counter(3)) at (prev + 0, 15) to (start + 0, 23) - Code(Expression(2, Sub)) at (prev + 0, 22) to (start + 0, 23) = (c0 - c3) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 8) +- Code(Counter(0)) at (prev + 8, 5) to (start + 0, 8) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 14) - Code(Counter(4)) at (prev + 0, 15) to (start + 0, 23) - Code(Expression(3, Sub)) at (prev + 0, 22) to (start + 0, 23) @@ -39,57 +34,57 @@ Number of file 0 mappings: 24 Highest counter ID seen: c4 Function name: closure_bug::main::{closure#0} -Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 0e, 0c, 00, 12, 05, 00, 15, 00, 19, 02, 00, 23, 00, 28, 01, 00, 29, 00, 2a] +Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 0e, 0c, 00, 12, 05, 00, 13, 00, 1b, 02, 00, 21, 00, 2a, 01, 00, 29, 00, 2a] Number of files: 1 - file 0 => $DIR/closure_bug.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 14, 12) to (start + 0, 18) -- Code(Counter(1)) at (prev + 0, 21) to (start + 0, 25) -- Code(Expression(0, Sub)) at (prev + 0, 35) to (start + 0, 40) +- Code(Counter(1)) at (prev + 0, 19) to (start + 0, 27) +- Code(Expression(0, Sub)) at (prev + 0, 33) to (start + 0, 42) = (c0 - c1) - Code(Counter(0)) at (prev + 0, 41) to (start + 0, 42) Highest counter ID seen: c1 Function name: closure_bug::main::{closure#1} -Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 17, 0c, 00, 12, 05, 00, 15, 00, 19, 02, 00, 23, 00, 28, 01, 00, 29, 00, 2a] +Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 17, 0c, 00, 12, 05, 00, 13, 00, 1b, 02, 00, 21, 00, 2a, 01, 00, 29, 00, 2a] Number of files: 1 - file 0 => $DIR/closure_bug.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 23, 12) to (start + 0, 18) -- Code(Counter(1)) at (prev + 0, 21) to (start + 0, 25) -- Code(Expression(0, Sub)) at (prev + 0, 35) to (start + 0, 40) +- Code(Counter(1)) at (prev + 0, 19) to (start + 0, 27) +- Code(Expression(0, Sub)) at (prev + 0, 33) to (start + 0, 42) = (c0 - c1) - Code(Counter(0)) at (prev + 0, 41) to (start + 0, 42) Highest counter ID seen: c1 Function name: closure_bug::main::{closure#2} -Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 20, 0c, 00, 12, 05, 00, 15, 00, 19, 02, 00, 23, 00, 28, 01, 00, 29, 00, 2a] +Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 20, 0c, 00, 12, 05, 00, 13, 00, 1b, 02, 00, 21, 00, 2a, 01, 00, 29, 00, 2a] Number of files: 1 - file 0 => $DIR/closure_bug.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 32, 12) to (start + 0, 18) -- Code(Counter(1)) at (prev + 0, 21) to (start + 0, 25) -- Code(Expression(0, Sub)) at (prev + 0, 35) to (start + 0, 40) +- Code(Counter(1)) at (prev + 0, 19) to (start + 0, 27) +- Code(Expression(0, Sub)) at (prev + 0, 33) to (start + 0, 42) = (c0 - c1) - Code(Counter(0)) at (prev + 0, 41) to (start + 0, 42) Highest counter ID seen: c1 Function name: closure_bug::main::{closure#3} -Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 29, 0c, 00, 12, 05, 00, 15, 00, 19, 02, 00, 23, 00, 28, 01, 00, 29, 00, 2a] +Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 29, 0c, 00, 12, 05, 00, 13, 00, 1b, 02, 00, 21, 00, 2a, 01, 00, 29, 00, 2a] Number of files: 1 - file 0 => $DIR/closure_bug.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 41, 12) to (start + 0, 18) -- Code(Counter(1)) at (prev + 0, 21) to (start + 0, 25) -- Code(Expression(0, Sub)) at (prev + 0, 35) to (start + 0, 40) +- Code(Counter(1)) at (prev + 0, 19) to (start + 0, 27) +- Code(Expression(0, Sub)) at (prev + 0, 33) to (start + 0, 42) = (c0 - c1) - Code(Counter(0)) at (prev + 0, 41) to (start + 0, 42) Highest counter ID seen: c1 diff --git a/tests/coverage/closure_bug.coverage b/tests/coverage/closure_bug.coverage index b85375d1850b7..8c00dbfbe78ce 100644 --- a/tests/coverage/closure_bug.coverage +++ b/tests/coverage/closure_bug.coverage @@ -7,45 +7,45 @@ LL| 1|fn main() { LL| 1| let truthy = std::env::args().len() == 1; LL| | - LL| 1| let a + LL| | let a LL| | = LL| | | LL| | | LL| 2| if truthy { true } else { false }; - ^0 + ^0 LL| | LL| 1| a(); LL| 1| if truthy { a(); } ^0 LL| | - LL| 1| let b + LL| | let b LL| | = LL| | | LL| | | LL| 2| if truthy { true } else { false }; - ^0 + ^0 LL| | LL| 1| b(); LL| 1| if truthy { b(); } ^0 LL| | - LL| 1| let c + LL| | let c LL| | = LL| | | LL| | | LL| 2| if truthy { true } else { false }; - ^0 + ^0 LL| | LL| 1| c(); LL| 1| if truthy { c(); } ^0 LL| | - LL| 1| let d + LL| | let d LL| | = LL| | | LL| | | LL| 2| if truthy { true } else { false }; - ^0 + ^0 LL| | LL| 1| d(); LL| 1| if truthy { d(); } diff --git a/tests/coverage/closure_unit_return.cov-map b/tests/coverage/closure_unit_return.cov-map index f665d93e6e1c8..cb0a5a2334f5c 100644 --- a/tests/coverage/closure_unit_return.cov-map +++ b/tests/coverage/closure_unit_return.cov-map @@ -1,13 +1,11 @@ Function name: closure_unit_return::explicit_unit -Raw bytes (34): 0x[01, 01, 00, 06, 01, 07, 01, 00, 13, 01, 01, 09, 00, 10, 01, 04, 05, 00, 09, 01, 00, 0a, 00, 11, 01, 01, 05, 00, 07, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 07, 01, 00, 13, 01, 05, 05, 00, 12, 01, 01, 05, 00, 07, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/closure_unit_return.rs Number of expressions: 0 -Number of file 0 mappings: 6 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 7, 1) to (start + 0, 19) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 9) -- Code(Counter(0)) at (prev + 0, 10) to (start + 0, 17) +- Code(Counter(0)) at (prev + 5, 5) to (start + 0, 18) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 7) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 @@ -24,15 +22,13 @@ Number of file 0 mappings: 3 Highest counter ID seen: (none) Function name: closure_unit_return::implicit_unit -Raw bytes (29): 0x[01, 01, 00, 05, 01, 10, 01, 00, 13, 01, 01, 09, 00, 10, 01, 04, 05, 00, 09, 01, 00, 0a, 00, 11, 01, 02, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 10, 01, 00, 13, 01, 05, 05, 00, 12, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/closure_unit_return.rs Number of expressions: 0 -Number of file 0 mappings: 5 +Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 16, 1) to (start + 0, 19) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 9) -- Code(Counter(0)) at (prev + 0, 10) to (start + 0, 17) +- Code(Counter(0)) at (prev + 5, 5) to (start + 0, 18) - Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/closure_unit_return.coverage b/tests/coverage/closure_unit_return.coverage index 02ea63b6dc394..f461e5b449d8a 100644 --- a/tests/coverage/closure_unit_return.coverage +++ b/tests/coverage/closure_unit_return.coverage @@ -5,8 +5,7 @@ LL| |// of their trailing expression, and functions that implicitly return `()`. LL| | LL| 1|fn explicit_unit() { - LL| 1| let closure = || { - ^0 + LL| 0| let closure = || { LL| 0| (); LL| 0| }; LL| | @@ -15,8 +14,7 @@ LL| 1|} LL| | LL| 1|fn implicit_unit() { - LL| 1| let closure = || { - ^0 + LL| 0| let closure = || { LL| 0| (); LL| 0| }; LL| | diff --git a/tests/coverage/color.coverage b/tests/coverage/color.coverage index 4e6ef6b60ce0e..e314f7232140b 100644 --- a/tests/coverage/color.coverage +++ b/tests/coverage/color.coverage @@ -7,7 +7,7 @@ LL| |// Ignored on Windows because we can't tell the tool to use ANSI escapes. LL| | LL| 1|fn main() { - LL| 1| for _i in 0..0 {} - ^0 ^0 + LL| 1| for _i in 0..0 {} + ^0 LL| 1|} diff --git a/tests/coverage/condition/conditions.cov-map b/tests/coverage/condition/conditions.cov-map index fda5dd1b97d13..cdf51e483d04a 100644 --- a/tests/coverage/condition/conditions.cov-map +++ b/tests/coverage/condition/conditions.cov-map @@ -1,5 +1,5 @@ Function name: conditions::assign_3_and_or -Raw bytes (75): 0x[01, 01, 05, 01, 05, 05, 09, 01, 09, 01, 13, 09, 0d, 0b, 01, 1c, 01, 00, 2e, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 20, 09, 06, 00, 12, 00, 13, 0a, 00, 17, 00, 18, 20, 0d, 0e, 00, 17, 00, 18, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 10, 01, 01, 01, 00, 02] +Raw bytes (65): 0x[01, 01, 05, 01, 05, 05, 09, 01, 09, 01, 13, 09, 0d, 09, 01, 1c, 01, 00, 2e, 01, 01, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 20, 09, 06, 00, 12, 00, 13, 0a, 00, 17, 00, 18, 20, 0d, 0e, 00, 17, 00, 18, 01, 01, 05, 00, 11, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/conditions.rs Number of expressions: 5 @@ -8,10 +8,9 @@ Number of expressions: 5 - expression 2 operands: lhs = Counter(0), rhs = Counter(2) - expression 3 operands: lhs = Counter(0), rhs = Expression(4, Add) - expression 4 operands: lhs = Counter(2), rhs = Counter(3) -Number of file 0 mappings: 11 +Number of file 0 mappings: 9 - Code(Counter(0)) at (prev + 28, 1) to (start + 0, 46) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 14) true = c1 false = (c0 - c1) @@ -24,13 +23,12 @@ Number of file 0 mappings: 11 - Branch { true: Counter(3), false: Expression(3, Sub) } at (prev + 0, 23) to (start + 0, 24) true = c3 false = (c0 - (c2 + c3)) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c3 Function name: conditions::assign_3_or_and -Raw bytes (73): 0x[01, 01, 04, 01, 05, 01, 0b, 05, 09, 09, 0d, 0b, 01, 17, 01, 00, 2e, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 02, 00, 12, 00, 13, 20, 09, 06, 00, 12, 00, 13, 09, 00, 17, 00, 18, 20, 0d, 0e, 00, 17, 00, 18, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 10, 01, 01, 01, 00, 02] +Raw bytes (63): 0x[01, 01, 04, 01, 05, 01, 0b, 05, 09, 09, 0d, 09, 01, 17, 01, 00, 2e, 01, 01, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 02, 00, 12, 00, 13, 20, 09, 06, 00, 12, 00, 13, 09, 00, 17, 00, 18, 20, 0d, 0e, 00, 17, 00, 18, 01, 01, 05, 00, 11, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/conditions.rs Number of expressions: 4 @@ -38,10 +36,9 @@ Number of expressions: 4 - expression 1 operands: lhs = Counter(0), rhs = Expression(2, Add) - expression 2 operands: lhs = Counter(1), rhs = Counter(2) - expression 3 operands: lhs = Counter(2), rhs = Counter(3) -Number of file 0 mappings: 11 +Number of file 0 mappings: 9 - Code(Counter(0)) at (prev + 23, 1) to (start + 0, 46) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 14) true = c1 false = (c0 - c1) @@ -54,22 +51,20 @@ Number of file 0 mappings: 11 - Branch { true: Counter(3), false: Expression(3, Sub) } at (prev + 0, 23) to (start + 0, 24) true = c3 false = (c2 - c3) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c3 Function name: conditions::assign_and -Raw bytes (57): 0x[01, 01, 02, 01, 05, 05, 09, 09, 01, 0d, 01, 00, 20, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 20, 09, 06, 00, 12, 00, 13, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 10, 01, 01, 01, 00, 02] +Raw bytes (47): 0x[01, 01, 02, 01, 05, 05, 09, 07, 01, 0d, 01, 00, 20, 01, 01, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 05, 00, 12, 00, 13, 20, 09, 06, 00, 12, 00, 13, 01, 01, 05, 00, 11, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/conditions.rs Number of expressions: 2 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) - expression 1 operands: lhs = Counter(1), rhs = Counter(2) -Number of file 0 mappings: 9 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 13, 1) to (start + 0, 32) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 14) true = c1 false = (c0 - c1) @@ -77,23 +72,21 @@ Number of file 0 mappings: 9 - Branch { true: Counter(2), false: Expression(1, Sub) } at (prev + 0, 18) to (start + 0, 19) true = c2 false = (c1 - c2) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c2 Function name: conditions::assign_or -Raw bytes (59): 0x[01, 01, 03, 01, 05, 01, 0b, 05, 09, 09, 01, 12, 01, 00, 1f, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 02, 00, 12, 00, 13, 20, 09, 06, 00, 12, 00, 13, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 10, 01, 01, 01, 00, 02] +Raw bytes (49): 0x[01, 01, 03, 01, 05, 01, 0b, 05, 09, 07, 01, 12, 01, 00, 1f, 01, 01, 0d, 00, 0e, 20, 05, 02, 00, 0d, 00, 0e, 02, 00, 12, 00, 13, 20, 09, 06, 00, 12, 00, 13, 01, 01, 05, 00, 11, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/conditions.rs Number of expressions: 3 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) - expression 1 operands: lhs = Counter(0), rhs = Expression(2, Add) - expression 2 operands: lhs = Counter(1), rhs = Counter(2) -Number of file 0 mappings: 9 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 18, 1) to (start + 0, 31) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) - Branch { true: Counter(1), false: Expression(0, Sub) } at (prev + 0, 13) to (start + 0, 14) true = c1 false = (c0 - c1) @@ -102,20 +95,18 @@ Number of file 0 mappings: 9 - Branch { true: Counter(2), false: Expression(1, Sub) } at (prev + 0, 18) to (start + 0, 19) true = c2 false = (c0 - (c1 + c2)) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c2 Function name: conditions::foo -Raw bytes (24): 0x[01, 01, 00, 04, 01, 21, 01, 00, 18, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 10, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 21, 01, 00, 18, 01, 01, 05, 00, 11, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/conditions.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 33, 1) to (start + 0, 24) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 @@ -141,16 +132,14 @@ Number of file 0 mappings: 7 Highest counter ID seen: c2 Function name: conditions::simple_assign -Raw bytes (34): 0x[01, 01, 00, 06, 01, 08, 01, 00, 1a, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 0e, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 10, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 08, 01, 00, 1a, 01, 01, 0d, 00, 0e, 01, 01, 05, 00, 11, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/conditions.rs Number of expressions: 0 -Number of file 0 mappings: 6 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 8, 1) to (start + 0, 26) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 14) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/conditions.cov-map b/tests/coverage/conditions.cov-map deleted file mode 100644 index 1872f14aede0b..0000000000000 --- a/tests/coverage/conditions.cov-map +++ /dev/null @@ -1,199 +0,0 @@ -Function name: conditions::main -Raw bytes (581): 0x[01, 01, 40, 05, 09, 01, 05, 09, 51, 09, 13, 51, 55, 01, 03, 03, 0d, 11, 49, 11, 27, 49, 4d, 03, 63, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 63, 15, 0d, 11, 19, 41, 19, 5b, 41, 45, 63, bf, 01, 0d, 11, 15, 19, 15, 19, 15, 19, 15, 19, 15, 19, 1d, 21, 15, 19, bf, 01, 1d, 15, 19, 21, 39, 21, 93, 01, 39, 3d, bf, 01, fb, 01, 15, 19, 1d, 21, bf, 01, fb, 01, 15, 19, 1d, 21, bf, 01, fb, 01, 15, 19, 1d, 21, bf, 01, fb, 01, 15, 19, 1d, 21, 25, 29, 1d, 21, fb, 01, 25, 1d, 21, 29, 2d, 29, f3, 01, 2d, 31, f3, 01, 35, 2d, 31, 29, ef, 01, f3, 01, 35, 2d, 31, fb, 01, ff, 01, 1d, 21, 25, 29, 52, 01, 03, 01, 00, 0a, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1a, 01, 01, 08, 00, 0c, 01, 00, 0d, 02, 06, 00, 02, 05, 00, 06, 03, 03, 09, 00, 0a, 01, 00, 10, 00, 1d, 05, 01, 09, 00, 17, 05, 01, 09, 00, 0a, 06, 01, 0f, 00, 1c, 09, 01, 0c, 00, 19, 0a, 00, 1d, 00, 2a, 0e, 00, 2e, 00, 3c, 09, 00, 3d, 02, 0a, 00, 02, 09, 00, 0a, 09, 01, 09, 00, 17, 09, 01, 09, 00, 12, 16, 02, 09, 00, 0f, 03, 03, 09, 00, 16, 03, 00, 19, 00, 1a, 03, 01, 08, 00, 0c, 03, 00, 0d, 02, 06, 00, 02, 05, 00, 06, 03, 02, 08, 00, 15, 0d, 00, 16, 02, 06, 1a, 02, 0f, 00, 1c, 11, 01, 0c, 00, 19, 1e, 00, 1d, 00, 2a, 22, 00, 2e, 00, 3c, 11, 00, 3d, 02, 0a, 00, 02, 09, 00, 0a, 11, 01, 09, 00, 17, 2a, 02, 09, 00, 0f, 63, 03, 08, 00, 0c, 63, 01, 0d, 00, 1a, 63, 00, 1d, 00, 1e, 63, 01, 0c, 00, 10, 63, 00, 11, 02, 0a, 00, 02, 09, 00, 0a, 63, 02, 0c, 00, 19, 15, 00, 1a, 02, 0a, 4a, 04, 11, 00, 1e, 19, 01, 10, 00, 1d, 52, 00, 21, 00, 2e, 56, 00, 32, 00, 40, 19, 00, 41, 02, 0e, 00, 02, 0d, 00, 0e, 19, 01, 0d, 00, 1b, 5e, 02, 0d, 00, 13, 00, 02, 05, 00, 06, bf, 01, 02, 09, 00, 16, bf, 01, 00, 19, 00, 1a, bf, 01, 01, 08, 00, 0c, bf, 01, 00, 0d, 02, 06, 00, 02, 05, 00, 06, fb, 01, 02, 09, 00, 0a, bf, 01, 00, 10, 00, 1d, 1d, 00, 1e, 02, 06, 82, 01, 02, 0f, 00, 1c, 21, 01, 0c, 00, 19, 8a, 01, 00, 1d, 00, 2a, 8e, 01, 00, 2e, 00, 3c, 21, 00, 3d, 02, 0a, 00, 02, 09, 00, 0a, 21, 01, 09, 00, 17, ba, 01, 02, 0d, 00, 20, ba, 01, 00, 23, 00, 2c, ba, 01, 01, 09, 00, 11, ba, 01, 01, 09, 00, 0f, ff, 01, 03, 09, 00, 0a, fb, 01, 00, 10, 00, 1d, 25, 00, 1e, 02, 06, ce, 01, 02, 0f, 00, 1c, 29, 01, 0c, 00, 19, d6, 01, 00, 1d, 00, 2a, da, 01, 00, 2e, 00, 3c, ef, 01, 00, 3d, 02, 0a, ea, 01, 02, 09, 00, 0a, 29, 01, 09, 00, 17, f6, 01, 02, 09, 00, 0f, 01, 02, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/conditions.rs -Number of expressions: 64 -- expression 0 operands: lhs = Counter(1), rhs = Counter(2) -- expression 1 operands: lhs = Counter(0), rhs = Counter(1) -- expression 2 operands: lhs = Counter(2), rhs = Counter(20) -- expression 3 operands: lhs = Counter(2), rhs = Expression(4, Add) -- expression 4 operands: lhs = Counter(20), rhs = Counter(21) -- expression 5 operands: lhs = Counter(0), rhs = Expression(0, Add) -- expression 6 operands: lhs = Expression(0, Add), rhs = Counter(3) -- expression 7 operands: lhs = Counter(4), rhs = Counter(18) -- expression 8 operands: lhs = Counter(4), rhs = Expression(9, Add) -- expression 9 operands: lhs = Counter(18), rhs = Counter(19) -- expression 10 operands: lhs = Expression(0, Add), rhs = Expression(24, Add) -- expression 11 operands: lhs = Counter(3), rhs = Counter(4) -- expression 12 operands: lhs = Counter(3), rhs = Counter(4) -- expression 13 operands: lhs = Counter(3), rhs = Counter(4) -- expression 14 operands: lhs = Counter(3), rhs = Counter(4) -- expression 15 operands: lhs = Counter(3), rhs = Counter(4) -- expression 16 operands: lhs = Counter(3), rhs = Counter(4) -- expression 17 operands: lhs = Counter(3), rhs = Counter(4) -- expression 18 operands: lhs = Expression(24, Add), rhs = Counter(5) -- expression 19 operands: lhs = Counter(3), rhs = Counter(4) -- expression 20 operands: lhs = Counter(6), rhs = Counter(16) -- expression 21 operands: lhs = Counter(6), rhs = Expression(22, Add) -- expression 22 operands: lhs = Counter(16), rhs = Counter(17) -- expression 23 operands: lhs = Expression(24, Add), rhs = Expression(47, Add) -- expression 24 operands: lhs = Counter(3), rhs = Counter(4) -- expression 25 operands: lhs = Counter(5), rhs = Counter(6) -- expression 26 operands: lhs = Counter(5), rhs = Counter(6) -- expression 27 operands: lhs = Counter(5), rhs = Counter(6) -- expression 28 operands: lhs = Counter(5), rhs = Counter(6) -- expression 29 operands: lhs = Counter(5), rhs = Counter(6) -- expression 30 operands: lhs = Counter(7), rhs = Counter(8) -- expression 31 operands: lhs = Counter(5), rhs = Counter(6) -- expression 32 operands: lhs = Expression(47, Add), rhs = Counter(7) -- expression 33 operands: lhs = Counter(5), rhs = Counter(6) -- expression 34 operands: lhs = Counter(8), rhs = Counter(14) -- expression 35 operands: lhs = Counter(8), rhs = Expression(36, Add) -- expression 36 operands: lhs = Counter(14), rhs = Counter(15) -- expression 37 operands: lhs = Expression(47, Add), rhs = Expression(62, Add) -- expression 38 operands: lhs = Counter(5), rhs = Counter(6) -- expression 39 operands: lhs = Counter(7), rhs = Counter(8) -- expression 40 operands: lhs = Expression(47, Add), rhs = Expression(62, Add) -- expression 41 operands: lhs = Counter(5), rhs = Counter(6) -- expression 42 operands: lhs = Counter(7), rhs = Counter(8) -- expression 43 operands: lhs = Expression(47, Add), rhs = Expression(62, Add) -- expression 44 operands: lhs = Counter(5), rhs = Counter(6) -- expression 45 operands: lhs = Counter(7), rhs = Counter(8) -- expression 46 operands: lhs = Expression(47, Add), rhs = Expression(62, Add) -- expression 47 operands: lhs = Counter(5), rhs = Counter(6) -- expression 48 operands: lhs = Counter(7), rhs = Counter(8) -- expression 49 operands: lhs = Counter(9), rhs = Counter(10) -- expression 50 operands: lhs = Counter(7), rhs = Counter(8) -- expression 51 operands: lhs = Expression(62, Add), rhs = Counter(9) -- expression 52 operands: lhs = Counter(7), rhs = Counter(8) -- expression 53 operands: lhs = Counter(10), rhs = Counter(11) -- expression 54 operands: lhs = Counter(10), rhs = Expression(60, Add) -- expression 55 operands: lhs = Counter(11), rhs = Counter(12) -- expression 56 operands: lhs = Expression(60, Add), rhs = Counter(13) -- expression 57 operands: lhs = Counter(11), rhs = Counter(12) -- expression 58 operands: lhs = Counter(10), rhs = Expression(59, Add) -- expression 59 operands: lhs = Expression(60, Add), rhs = Counter(13) -- expression 60 operands: lhs = Counter(11), rhs = Counter(12) -- expression 61 operands: lhs = Expression(62, Add), rhs = Expression(63, Add) -- expression 62 operands: lhs = Counter(7), rhs = Counter(8) -- expression 63 operands: lhs = Counter(9), rhs = Counter(10) -Number of file 0 mappings: 82 -- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 26) -- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 12) -- Code(Counter(0)) at (prev + 0, 13) to (start + 2, 6) -- Code(Zero) at (prev + 2, 5) to (start + 0, 6) -- Code(Expression(0, Add)) at (prev + 3, 9) to (start + 0, 10) - = (c1 + c2) -- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 29) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 23) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 10) -- Code(Expression(1, Sub)) at (prev + 1, 15) to (start + 0, 28) - = (c0 - c1) -- Code(Counter(2)) at (prev + 1, 12) to (start + 0, 25) -- Code(Expression(2, Sub)) at (prev + 0, 29) to (start + 0, 42) - = (c2 - c20) -- Code(Expression(3, Sub)) at (prev + 0, 46) to (start + 0, 60) - = (c2 - (c20 + c21)) -- Code(Counter(2)) at (prev + 0, 61) to (start + 2, 10) -- Code(Zero) at (prev + 2, 9) to (start + 0, 10) -- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 23) -- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 18) -- Code(Expression(5, Sub)) at (prev + 2, 9) to (start + 0, 15) - = (c0 - (c1 + c2)) -- Code(Expression(0, Add)) at (prev + 3, 9) to (start + 0, 22) - = (c1 + c2) -- Code(Expression(0, Add)) at (prev + 0, 25) to (start + 0, 26) - = (c1 + c2) -- Code(Expression(0, Add)) at (prev + 1, 8) to (start + 0, 12) - = (c1 + c2) -- Code(Expression(0, Add)) at (prev + 0, 13) to (start + 2, 6) - = (c1 + c2) -- Code(Zero) at (prev + 2, 5) to (start + 0, 6) -- Code(Expression(0, Add)) at (prev + 2, 8) to (start + 0, 21) - = (c1 + c2) -- Code(Counter(3)) at (prev + 0, 22) to (start + 2, 6) -- Code(Expression(6, Sub)) at (prev + 2, 15) to (start + 0, 28) - = ((c1 + c2) - c3) -- Code(Counter(4)) at (prev + 1, 12) to (start + 0, 25) -- Code(Expression(7, Sub)) at (prev + 0, 29) to (start + 0, 42) - = (c4 - c18) -- Code(Expression(8, Sub)) at (prev + 0, 46) to (start + 0, 60) - = (c4 - (c18 + c19)) -- Code(Counter(4)) at (prev + 0, 61) to (start + 2, 10) -- Code(Zero) at (prev + 2, 9) to (start + 0, 10) -- Code(Counter(4)) at (prev + 1, 9) to (start + 0, 23) -- Code(Expression(10, Sub)) at (prev + 2, 9) to (start + 0, 15) - = ((c1 + c2) - (c3 + c4)) -- Code(Expression(24, Add)) at (prev + 3, 8) to (start + 0, 12) - = (c3 + c4) -- Code(Expression(24, Add)) at (prev + 1, 13) to (start + 0, 26) - = (c3 + c4) -- Code(Expression(24, Add)) at (prev + 0, 29) to (start + 0, 30) - = (c3 + c4) -- Code(Expression(24, Add)) at (prev + 1, 12) to (start + 0, 16) - = (c3 + c4) -- Code(Expression(24, Add)) at (prev + 0, 17) to (start + 2, 10) - = (c3 + c4) -- Code(Zero) at (prev + 2, 9) to (start + 0, 10) -- Code(Expression(24, Add)) at (prev + 2, 12) to (start + 0, 25) - = (c3 + c4) -- Code(Counter(5)) at (prev + 0, 26) to (start + 2, 10) -- Code(Expression(18, Sub)) at (prev + 4, 17) to (start + 0, 30) - = ((c3 + c4) - c5) -- Code(Counter(6)) at (prev + 1, 16) to (start + 0, 29) -- Code(Expression(20, Sub)) at (prev + 0, 33) to (start + 0, 46) - = (c6 - c16) -- Code(Expression(21, Sub)) at (prev + 0, 50) to (start + 0, 64) - = (c6 - (c16 + c17)) -- Code(Counter(6)) at (prev + 0, 65) to (start + 2, 14) -- Code(Zero) at (prev + 2, 13) to (start + 0, 14) -- Code(Counter(6)) at (prev + 1, 13) to (start + 0, 27) -- Code(Expression(23, Sub)) at (prev + 2, 13) to (start + 0, 19) - = ((c3 + c4) - (c5 + c6)) -- Code(Zero) at (prev + 2, 5) to (start + 0, 6) -- Code(Expression(47, Add)) at (prev + 2, 9) to (start + 0, 22) - = (c5 + c6) -- Code(Expression(47, Add)) at (prev + 0, 25) to (start + 0, 26) - = (c5 + c6) -- Code(Expression(47, Add)) at (prev + 1, 8) to (start + 0, 12) - = (c5 + c6) -- Code(Expression(47, Add)) at (prev + 0, 13) to (start + 2, 6) - = (c5 + c6) -- Code(Zero) at (prev + 2, 5) to (start + 0, 6) -- Code(Expression(62, Add)) at (prev + 2, 9) to (start + 0, 10) - = (c7 + c8) -- Code(Expression(47, Add)) at (prev + 0, 16) to (start + 0, 29) - = (c5 + c6) -- Code(Counter(7)) at (prev + 0, 30) to (start + 2, 6) -- Code(Expression(32, Sub)) at (prev + 2, 15) to (start + 0, 28) - = ((c5 + c6) - c7) -- Code(Counter(8)) at (prev + 1, 12) to (start + 0, 25) -- Code(Expression(34, Sub)) at (prev + 0, 29) to (start + 0, 42) - = (c8 - c14) -- Code(Expression(35, Sub)) at (prev + 0, 46) to (start + 0, 60) - = (c8 - (c14 + c15)) -- Code(Counter(8)) at (prev + 0, 61) to (start + 2, 10) -- Code(Zero) at (prev + 2, 9) to (start + 0, 10) -- Code(Counter(8)) at (prev + 1, 9) to (start + 0, 23) -- Code(Expression(46, Sub)) at (prev + 2, 13) to (start + 0, 32) - = ((c5 + c6) - (c7 + c8)) -- Code(Expression(46, Sub)) at (prev + 0, 35) to (start + 0, 44) - = ((c5 + c6) - (c7 + c8)) -- Code(Expression(46, Sub)) at (prev + 1, 9) to (start + 0, 17) - = ((c5 + c6) - (c7 + c8)) -- Code(Expression(46, Sub)) at (prev + 1, 9) to (start + 0, 15) - = ((c5 + c6) - (c7 + c8)) -- Code(Expression(63, Add)) at (prev + 3, 9) to (start + 0, 10) - = (c9 + c10) -- Code(Expression(62, Add)) at (prev + 0, 16) to (start + 0, 29) - = (c7 + c8) -- Code(Counter(9)) at (prev + 0, 30) to (start + 2, 6) -- Code(Expression(51, Sub)) at (prev + 2, 15) to (start + 0, 28) - = ((c7 + c8) - c9) -- Code(Counter(10)) at (prev + 1, 12) to (start + 0, 25) -- Code(Expression(53, Sub)) at (prev + 0, 29) to (start + 0, 42) - = (c10 - c11) -- Code(Expression(54, Sub)) at (prev + 0, 46) to (start + 0, 60) - = (c10 - (c11 + c12)) -- Code(Expression(59, Add)) at (prev + 0, 61) to (start + 2, 10) - = ((c11 + c12) + c13) -- Code(Expression(58, Sub)) at (prev + 2, 9) to (start + 0, 10) - = (c10 - ((c11 + c12) + c13)) -- Code(Counter(10)) at (prev + 1, 9) to (start + 0, 23) -- Code(Expression(61, Sub)) at (prev + 2, 9) to (start + 0, 15) - = ((c7 + c8) - (c9 + c10)) -- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) -Highest counter ID seen: c10 - diff --git a/tests/coverage/coverage_attr_closure.cov-map b/tests/coverage/coverage_attr_closure.cov-map index aea805df303ea..b9daeed9624b1 100644 --- a/tests/coverage/coverage_attr_closure.cov-map +++ b/tests/coverage/coverage_attr_closure.cov-map @@ -1,45 +1,46 @@ Function name: coverage_attr_closure::GLOBAL_CLOSURE_ON::{closure#0} -Raw bytes (19): 0x[01, 01, 00, 03, 01, 06, 0f, 00, 10, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 06, 0f, 00, 10, 01, 01, 05, 00, 0d, 01, 00, 10, 00, 15, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/coverage_attr_closure.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 6, 15) to (start + 0, 16) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 21) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: coverage_attr_closure::contains_closures_off::{closure#0} (unused) -Raw bytes (19): 0x[01, 01, 00, 03, 00, 1d, 13, 00, 14, 00, 01, 09, 00, 11, 00, 01, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 00, 1d, 13, 00, 14, 00, 01, 09, 00, 11, 00, 00, 14, 00, 19, 00, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/coverage_attr_closure.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Zero) at (prev + 29, 19) to (start + 0, 20) - Code(Zero) at (prev + 1, 9) to (start + 0, 17) +- Code(Zero) at (prev + 0, 20) to (start + 0, 25) - Code(Zero) at (prev + 1, 5) to (start + 0, 6) Highest counter ID seen: (none) Function name: coverage_attr_closure::contains_closures_on -Raw bytes (24): 0x[01, 01, 00, 04, 01, 0f, 01, 00, 1a, 01, 01, 09, 00, 1a, 01, 04, 09, 00, 1b, 01, 04, 01, 00, 02] +Raw bytes (14): 0x[01, 01, 00, 02, 01, 0f, 01, 00, 1a, 01, 09, 01, 00, 02] Number of files: 1 - file 0 => $DIR/coverage_attr_closure.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 2 - Code(Counter(0)) at (prev + 15, 1) to (start + 0, 26) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 26) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 27) -- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 2) +- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: coverage_attr_closure::contains_closures_on::{closure#0} (unused) -Raw bytes (19): 0x[01, 01, 00, 03, 00, 11, 13, 00, 14, 00, 01, 09, 00, 11, 00, 01, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 00, 11, 13, 00, 14, 00, 01, 09, 00, 11, 00, 00, 14, 00, 19, 00, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/coverage_attr_closure.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Zero) at (prev + 17, 19) to (start + 0, 20) - Code(Zero) at (prev + 1, 9) to (start + 0, 17) +- Code(Zero) at (prev + 0, 20) to (start + 0, 25) - Code(Zero) at (prev + 1, 5) to (start + 0, 6) Highest counter ID seen: (none) diff --git a/tests/coverage/coverage_attr_closure.coverage b/tests/coverage/coverage_attr_closure.coverage index 7bdb96bdab851..c21ca529b2909 100644 --- a/tests/coverage/coverage_attr_closure.coverage +++ b/tests/coverage/coverage_attr_closure.coverage @@ -13,11 +13,11 @@ LL| | LL| |#[coverage(on)] LL| 1|fn contains_closures_on() { - LL| 1| let _local_closure_on = #[coverage(on)] + LL| | let _local_closure_on = #[coverage(on)] LL| 0| |input: &str| { LL| 0| println!("{input}"); LL| 0| }; - LL| 1| let _local_closure_off = #[coverage(off)] + LL| | let _local_closure_off = #[coverage(off)] LL| | |input: &str| { LL| | println!("{input}"); LL| | }; diff --git a/tests/coverage/dead_code.cov-map b/tests/coverage/dead_code.cov-map index ae4146dc24678..b4b22ec149d2b 100644 --- a/tests/coverage/dead_code.cov-map +++ b/tests/coverage/dead_code.cov-map @@ -1,15 +1,13 @@ Function name: dead_code::main -Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 1b, 01, 00, 0a, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 09, 00, 16, 01, 00, 19, 00, 1a, 01, 01, 08, 00, 0f, 05, 00, 10, 02, 06, 02, 02, 05, 00, 06, 01, 01, 01, 00, 02] +Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 1b, 01, 00, 0a, 01, 04, 13, 00, 2e, 01, 02, 19, 00, 1a, 01, 01, 08, 00, 0f, 05, 00, 10, 02, 06, 02, 02, 05, 00, 06, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/dead_code.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 9 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 27, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 26) +- Code(Counter(0)) at (prev + 4, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 2, 25) to (start + 0, 26) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 15) - Code(Counter(1)) at (prev + 0, 16) to (start + 2, 6) - Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) @@ -18,16 +16,14 @@ Number of file 0 mappings: 9 Highest counter ID seen: c1 Function name: dead_code::unused_fn (unused) -Raw bytes (49): 0x[01, 01, 00, 09, 00, 0f, 01, 00, 0f, 00, 04, 09, 00, 10, 00, 00, 13, 00, 2e, 00, 02, 09, 00, 16, 00, 00, 19, 00, 1a, 00, 01, 08, 00, 0f, 00, 00, 10, 02, 06, 00, 02, 05, 00, 06, 00, 01, 01, 00, 02] +Raw bytes (39): 0x[01, 01, 00, 07, 00, 0f, 01, 00, 0f, 00, 04, 13, 00, 2e, 00, 02, 19, 00, 1a, 00, 01, 08, 00, 0f, 00, 00, 10, 02, 06, 00, 02, 05, 00, 06, 00, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/dead_code.rs Number of expressions: 0 -Number of file 0 mappings: 9 +Number of file 0 mappings: 7 - Code(Zero) at (prev + 15, 1) to (start + 0, 15) -- Code(Zero) at (prev + 4, 9) to (start + 0, 16) -- Code(Zero) at (prev + 0, 19) to (start + 0, 46) -- Code(Zero) at (prev + 2, 9) to (start + 0, 22) -- Code(Zero) at (prev + 0, 25) to (start + 0, 26) +- Code(Zero) at (prev + 4, 19) to (start + 0, 46) +- Code(Zero) at (prev + 2, 25) to (start + 0, 26) - Code(Zero) at (prev + 1, 8) to (start + 0, 15) - Code(Zero) at (prev + 0, 16) to (start + 2, 6) - Code(Zero) at (prev + 2, 5) to (start + 0, 6) @@ -35,16 +31,14 @@ Number of file 0 mappings: 9 Highest counter ID seen: (none) Function name: dead_code::unused_pub_fn_not_in_library (unused) -Raw bytes (49): 0x[01, 01, 00, 09, 00, 03, 01, 00, 26, 00, 04, 09, 00, 10, 00, 00, 13, 00, 2e, 00, 02, 09, 00, 16, 00, 00, 19, 00, 1a, 00, 01, 08, 00, 0f, 00, 00, 10, 02, 06, 00, 02, 05, 00, 06, 00, 01, 01, 00, 02] +Raw bytes (39): 0x[01, 01, 00, 07, 00, 03, 01, 00, 26, 00, 04, 13, 00, 2e, 00, 02, 19, 00, 1a, 00, 01, 08, 00, 0f, 00, 00, 10, 02, 06, 00, 02, 05, 00, 06, 00, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/dead_code.rs Number of expressions: 0 -Number of file 0 mappings: 9 +Number of file 0 mappings: 7 - Code(Zero) at (prev + 3, 1) to (start + 0, 38) -- Code(Zero) at (prev + 4, 9) to (start + 0, 16) -- Code(Zero) at (prev + 0, 19) to (start + 0, 46) -- Code(Zero) at (prev + 2, 9) to (start + 0, 22) -- Code(Zero) at (prev + 0, 25) to (start + 0, 26) +- Code(Zero) at (prev + 4, 19) to (start + 0, 46) +- Code(Zero) at (prev + 2, 25) to (start + 0, 26) - Code(Zero) at (prev + 1, 8) to (start + 0, 15) - Code(Zero) at (prev + 0, 16) to (start + 2, 6) - Code(Zero) at (prev + 2, 5) to (start + 0, 6) diff --git a/tests/coverage/fn_sig_into_try.cov-map b/tests/coverage/fn_sig_into_try.cov-map index fc57a4892be4e..acf6e21646bd5 100644 --- a/tests/coverage/fn_sig_into_try.cov-map +++ b/tests/coverage/fn_sig_into_try.cov-map @@ -37,14 +37,13 @@ Number of file 0 mappings: 5 Highest counter ID seen: c0 Function name: fn_sig_into_try::d -Raw bytes (39): 0x[01, 01, 00, 07, 01, 1f, 01, 00, 16, 01, 03, 0c, 00, 0e, 01, 00, 11, 00, 13, 01, 01, 05, 00, 0f, 00, 00, 0f, 00, 10, 01, 01, 05, 00, 0c, 01, 01, 01, 00, 02] +Raw bytes (34): 0x[01, 01, 00, 06, 01, 1f, 01, 00, 16, 01, 03, 11, 00, 13, 01, 01, 05, 00, 0f, 00, 00, 0f, 00, 10, 01, 01, 05, 00, 0c, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/fn_sig_into_try.rs Number of expressions: 0 -Number of file 0 mappings: 7 +Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 31, 1) to (start + 0, 22) -- Code(Counter(0)) at (prev + 3, 12) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 19) +- Code(Counter(0)) at (prev + 3, 17) to (start + 0, 19) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) - Code(Zero) at (prev + 0, 15) to (start + 0, 16) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) diff --git a/tests/coverage/for.many.coverage b/tests/coverage/for.many.coverage new file mode 100644 index 0000000000000..ecb0b9539f054 --- /dev/null +++ b/tests/coverage/for.many.coverage @@ -0,0 +1,39 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: zero one many + LL| |//@[one] ignore-coverage-map + LL| |//@[many] ignore-coverage-map + LL| | + LL| |// Basic test of `for` loops. + LL| | + LL| 1|fn for_loop(items: &[&str]) { + LL| 1| say("hello"); + LL| | + LL| 3| for item in items { + ^1 + LL| 3| say(item); + LL| 3| } + LL| | + LL| 3| for item in items { + ^1 + LL| 3| say(item) + LL| 3| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let items = cfg_select!( + LL| | zero => &[], + LL| | one => &["one"], + LL| | many => &["one", "two", "three"], + LL| | ); + LL| | for_loop(items); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/for.one.coverage b/tests/coverage/for.one.coverage new file mode 100644 index 0000000000000..4b102bb8a4129 --- /dev/null +++ b/tests/coverage/for.one.coverage @@ -0,0 +1,37 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: zero one many + LL| |//@[one] ignore-coverage-map + LL| |//@[many] ignore-coverage-map + LL| | + LL| |// Basic test of `for` loops. + LL| | + LL| 1|fn for_loop(items: &[&str]) { + LL| 1| say("hello"); + LL| | + LL| 1| for item in items { + LL| 1| say(item); + LL| 1| } + LL| | + LL| 1| for item in items { + LL| 1| say(item) + LL| 1| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let items = cfg_select!( + LL| | zero => &[], + LL| | one => &["one"], + LL| | many => &["one", "two", "three"], + LL| | ); + LL| | for_loop(items); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/for.rs b/tests/coverage/for.rs new file mode 100644 index 0000000000000..55a2cfc2c18d2 --- /dev/null +++ b/tests/coverage/for.rs @@ -0,0 +1,36 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ revisions: zero one many +//@[one] ignore-coverage-map +//@[many] ignore-coverage-map + +// Basic test of `for` loops. + +fn for_loop(items: &[&str]) { + say("hello"); + + for item in items { + say(item); + } + + for item in items { + say(item) + } + + say("goodbye"); +} + +#[coverage(off)] +fn main() { + let items = cfg_select!( + zero => &[], + one => &["one"], + many => &["one", "two", "three"], + ); + for_loop(items); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); +} diff --git a/tests/coverage/for.zero.cov-map b/tests/coverage/for.zero.cov-map new file mode 100644 index 0000000000000..20223bd679938 --- /dev/null +++ b/tests/coverage/for.zero.cov-map @@ -0,0 +1,20 @@ +Function name: for::for_loop +Raw bytes (48): 0x[01, 01, 02, 05, 01, 09, 01, 08, 01, 09, 01, 00, 1c, 01, 01, 05, 00, 11, 01, 02, 11, 00, 16, 02, 00, 17, 02, 06, 01, 04, 11, 00, 16, 06, 00, 17, 02, 06, 01, 04, 05, 00, 13, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/for.rs +Number of expressions: 2 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +- expression 1 operands: lhs = Counter(2), rhs = Counter(0) +Number of file 0 mappings: 8 +- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 28) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) +- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 22) +- Code(Expression(0, Sub)) at (prev + 0, 23) to (start + 2, 6) + = (c1 - c0) +- Code(Counter(0)) at (prev + 4, 17) to (start + 0, 22) +- Code(Expression(1, Sub)) at (prev + 0, 23) to (start + 2, 6) + = (c2 - c0) +- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/for.zero.coverage b/tests/coverage/for.zero.coverage new file mode 100644 index 0000000000000..6338e6ba88afe --- /dev/null +++ b/tests/coverage/for.zero.coverage @@ -0,0 +1,37 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: zero one many + LL| |//@[one] ignore-coverage-map + LL| |//@[many] ignore-coverage-map + LL| | + LL| |// Basic test of `for` loops. + LL| | + LL| 1|fn for_loop(items: &[&str]) { + LL| 1| say("hello"); + LL| | + LL| 1| for item in items { + LL| 0| say(item); + LL| 0| } + LL| | + LL| 1| for item in items { + LL| 0| say(item) + LL| 0| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let items = cfg_select!( + LL| | zero => &[], + LL| | one => &["one"], + LL| | many => &["one", "two", "three"], + LL| | ); + LL| | for_loop(items); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/generic-unused-impl.cov-map b/tests/coverage/generic-unused-impl.cov-map index da9e5495a72b0..be7a0cface6a9 100644 --- a/tests/coverage/generic-unused-impl.cov-map +++ b/tests/coverage/generic-unused-impl.cov-map @@ -1,12 +1,11 @@ Function name: as core::convert::From<[<_ as generic_unused_impl::Foo>::Assoc; 1]>>::from (unused) -Raw bytes (29): 0x[01, 01, 00, 05, 00, 0b, 05, 00, 29, 00, 01, 0e, 00, 12, 00, 00, 16, 00, 1a, 00, 01, 09, 00, 1b, 00, 01, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 00, 0b, 05, 00, 29, 00, 01, 16, 00, 1a, 00, 01, 09, 00, 1b, 00, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/generic-unused-impl.rs Number of expressions: 0 -Number of file 0 mappings: 5 +Number of file 0 mappings: 4 - Code(Zero) at (prev + 11, 5) to (start + 0, 41) -- Code(Zero) at (prev + 1, 14) to (start + 0, 18) -- Code(Zero) at (prev + 0, 22) to (start + 0, 26) +- Code(Zero) at (prev + 1, 22) to (start + 0, 26) - Code(Zero) at (prev + 1, 9) to (start + 0, 27) - Code(Zero) at (prev + 1, 5) to (start + 0, 6) Highest counter ID seen: (none) diff --git a/tests/coverage/holes.cov-map b/tests/coverage/holes.cov-map index c2158c4415068..c850a9965fdd2 100644 --- a/tests/coverage/holes.cov-map +++ b/tests/coverage/holes.cov-map @@ -9,40 +9,25 @@ Number of file 0 mappings: 2 Highest counter ID seen: (none) Function name: holes::main -Raw bytes (154): 0x[01, 01, 00, 1e, 01, 08, 01, 00, 0a, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 11, 01, 04, 05, 00, 0e, 01, 00, 0f, 00, 11, 01, 07, 09, 00, 11, 01, 09, 05, 00, 0e, 01, 00, 0f, 00, 11, 01, 04, 05, 00, 0e, 01, 00, 0f, 00, 11, 01, 07, 05, 00, 0e, 01, 00, 0f, 00, 11, 01, 06, 05, 00, 0e, 01, 00, 0f, 00, 11, 01, 04, 05, 00, 0e, 01, 00, 0f, 00, 11, 01, 04, 05, 00, 0e, 01, 00, 0f, 00, 11, 01, 06, 05, 00, 0e, 01, 00, 0f, 00, 11, 01, 03, 09, 00, 0f, 01, 07, 05, 00, 0e, 01, 00, 0f, 00, 11, 01, 03, 09, 00, 0f, 01, 07, 05, 00, 0e, 01, 00, 0f, 00, 11, 01, 06, 09, 00, 27, 01, 0d, 05, 00, 0e, 01, 00, 0f, 00, 11, 01, 01, 01, 00, 02] +Raw bytes (79): 0x[01, 01, 00, 0f, 01, 08, 01, 00, 0a, 01, 01, 05, 00, 12, 01, 04, 05, 00, 12, 01, 10, 05, 00, 12, 01, 04, 05, 00, 12, 01, 07, 05, 00, 12, 01, 06, 05, 00, 12, 01, 04, 05, 00, 12, 01, 04, 05, 00, 12, 01, 06, 05, 00, 12, 01, 0a, 05, 00, 12, 01, 0a, 05, 00, 12, 01, 08, 0d, 00, 0e, 01, 0b, 05, 00, 12, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/holes.rs Number of expressions: 0 -Number of file 0 mappings: 30 +Number of file 0 mappings: 15 - Code(Counter(0)) at (prev + 8, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 17) -- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 17) -- Code(Counter(0)) at (prev + 7, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 9, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 17) -- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 17) -- Code(Counter(0)) at (prev + 7, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 17) -- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 17) -- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 17) -- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 17) -- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 17) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 15) -- Code(Counter(0)) at (prev + 7, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 17) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 15) -- Code(Counter(0)) at (prev + 7, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 17) -- Code(Counter(0)) at (prev + 6, 9) to (start + 0, 39) -- Code(Counter(0)) at (prev + 13, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 17) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 16, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 7, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 10, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 10, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 8, 13) to (start + 0, 14) +- Code(Counter(0)) at (prev + 11, 5) to (start + 0, 18) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 @@ -57,14 +42,13 @@ Number of file 0 mappings: 2 Highest counter ID seen: (none) Function name: holes::main::{closure#0} (unused) -Raw bytes (24): 0x[01, 01, 00, 04, 00, 18, 09, 00, 0a, 00, 01, 0d, 00, 16, 00, 00, 17, 00, 19, 00, 01, 09, 00, 0a] +Raw bytes (19): 0x[01, 01, 00, 03, 00, 18, 09, 00, 0a, 00, 01, 0d, 00, 1a, 00, 01, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/holes.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 3 - Code(Zero) at (prev + 24, 9) to (start + 0, 10) -- Code(Zero) at (prev + 1, 13) to (start + 0, 22) -- Code(Zero) at (prev + 0, 23) to (start + 0, 25) +- Code(Zero) at (prev + 1, 13) to (start + 0, 26) - Code(Zero) at (prev + 1, 9) to (start + 0, 10) Highest counter ID seen: (none) diff --git a/tests/coverage/holes.coverage b/tests/coverage/holes.coverage index 1ea60491800d0..7ef26c68c5919 100644 --- a/tests/coverage/holes.coverage +++ b/tests/coverage/holes.coverage @@ -17,7 +17,7 @@ LL| | // Splitting this across multiple lines makes it easier to see where the LL| | // coverage mapping regions begin and end. LL| | #[rustfmt::skip] - LL| 1| let _closure = + LL| | let _closure = LL| | | LL| | _arg: (), LL| | | @@ -60,7 +60,7 @@ LL| 1| black_box(()); LL| | LL| | #[rustfmt::skip] - LL| 1| let _const = + LL| | let _const = LL| | const LL| | { LL| | 7 + 4 @@ -70,7 +70,7 @@ LL| 1| black_box(()); LL| | LL| | #[rustfmt::skip] - LL| 1| let _async = + LL| | let _async = LL| | async LL| 0| { LL| 0| 7 + 4 @@ -83,9 +83,9 @@ LL| | // such as the length of an array literal. Handling this case requires LL| | // `nested_filter::OnlyBodies` or equivalent. LL| | #[rustfmt::skip] - LL| 1| let _const_block_inside_anon_const = + LL| | let _const_block_inside_anon_const = LL| | [ - LL| | 0 + LL| 1| 0 LL| | ; LL| | 7 LL| | + diff --git a/tests/coverage/if-let-chain.none.cov-map b/tests/coverage/if-let-chain.none.cov-map new file mode 100644 index 0000000000000..cc305683fdc47 --- /dev/null +++ b/tests/coverage/if-let-chain.none.cov-map @@ -0,0 +1,29 @@ +Function name: if_let_chain::if_let_chain +Raw bytes (71): 0x[01, 01, 06, 09, 05, 0b, 09, 01, 05, 11, 0d, 17, 11, 01, 0d, 0b, 01, 09, 01, 00, 33, 01, 01, 08, 00, 27, 09, 01, 0c, 00, 23, 02, 01, 05, 02, 06, 06, 02, 05, 00, 06, 01, 02, 08, 00, 27, 11, 01, 0c, 00, 23, 0e, 01, 05, 02, 06, 12, 02, 05, 00, 06, 01, 02, 05, 00, 13, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/if-let-chain.rs +Number of expressions: 6 +- expression 0 operands: lhs = Counter(2), rhs = Counter(1) +- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(2) +- expression 2 operands: lhs = Counter(0), rhs = Counter(1) +- expression 3 operands: lhs = Counter(4), rhs = Counter(3) +- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(4) +- expression 5 operands: lhs = Counter(0), rhs = Counter(3) +Number of file 0 mappings: 11 +- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 51) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 39) +- Code(Counter(2)) at (prev + 1, 12) to (start + 0, 35) +- Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 2, 6) + = (c2 - c1) +- Code(Expression(1, Sub)) at (prev + 2, 5) to (start + 0, 6) + = ((c0 + c1) - c2) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 39) +- Code(Counter(4)) at (prev + 1, 12) to (start + 0, 35) +- Code(Expression(3, Sub)) at (prev + 1, 5) to (start + 2, 6) + = (c4 - c3) +- Code(Expression(4, Sub)) at (prev + 2, 5) to (start + 0, 6) + = ((c0 + c3) - c4) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c4 + diff --git a/tests/coverage/if-let-chain.none.coverage b/tests/coverage/if-let-chain.none.coverage new file mode 100644 index 0000000000000..c45a8e561c3e3 --- /dev/null +++ b/tests/coverage/if-let-chain.none.coverage @@ -0,0 +1,39 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: none one two + LL| |//@[one] ignore-coverage-map + LL| |//@[two] ignore-coverage-map + LL| | + LL| |// Basic test for if-let chains. + LL| | + LL| 1|fn if_let_chain(opt_opt_msg: Option>) { + LL| 1| if let Some(opt_msg) = opt_opt_msg + LL| 0| && let Some(msg) = opt_msg + LL| 0| { + LL| 0| say(msg); + LL| 1| } + LL| | + LL| 1| if let Some(opt_msg) = opt_opt_msg + LL| 0| && let Some(msg) = opt_msg + LL| 0| { + LL| 0| say(msg) + LL| 1| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let opt_opt_msg = cfg_select!( + LL| | none => None, + LL| | one => Some(None), + LL| | two => Some(Some("hello")), + LL| | ); + LL| | if_let_chain(opt_opt_msg); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-let-chain.one.coverage b/tests/coverage/if-let-chain.one.coverage new file mode 100644 index 0000000000000..5ddf9a745d828 --- /dev/null +++ b/tests/coverage/if-let-chain.one.coverage @@ -0,0 +1,39 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: none one two + LL| |//@[one] ignore-coverage-map + LL| |//@[two] ignore-coverage-map + LL| | + LL| |// Basic test for if-let chains. + LL| | + LL| 1|fn if_let_chain(opt_opt_msg: Option>) { + LL| 1| if let Some(opt_msg) = opt_opt_msg + LL| 1| && let Some(msg) = opt_msg + LL| 0| { + LL| 0| say(msg); + LL| 1| } + LL| | + LL| 1| if let Some(opt_msg) = opt_opt_msg + LL| 1| && let Some(msg) = opt_msg + LL| 0| { + LL| 0| say(msg) + LL| 1| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let opt_opt_msg = cfg_select!( + LL| | none => None, + LL| | one => Some(None), + LL| | two => Some(Some("hello")), + LL| | ); + LL| | if_let_chain(opt_opt_msg); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-let-chain.rs b/tests/coverage/if-let-chain.rs new file mode 100644 index 0000000000000..816a22015a4c7 --- /dev/null +++ b/tests/coverage/if-let-chain.rs @@ -0,0 +1,38 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ revisions: none one two +//@[one] ignore-coverage-map +//@[two] ignore-coverage-map + +// Basic test for if-let chains. + +fn if_let_chain(opt_opt_msg: Option>) { + if let Some(opt_msg) = opt_opt_msg + && let Some(msg) = opt_msg + { + say(msg); + } + + if let Some(opt_msg) = opt_opt_msg + && let Some(msg) = opt_msg + { + say(msg) + } + + say("goodbye"); +} + +#[coverage(off)] +fn main() { + let opt_opt_msg = cfg_select!( + none => None, + one => Some(None), + two => Some(Some("hello")), + ); + if_let_chain(opt_opt_msg); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); +} diff --git a/tests/coverage/if-let-chain.two.coverage b/tests/coverage/if-let-chain.two.coverage new file mode 100644 index 0000000000000..f79cdb3df53e8 --- /dev/null +++ b/tests/coverage/if-let-chain.two.coverage @@ -0,0 +1,41 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: none one two + LL| |//@[one] ignore-coverage-map + LL| |//@[two] ignore-coverage-map + LL| | + LL| |// Basic test for if-let chains. + LL| | + LL| 1|fn if_let_chain(opt_opt_msg: Option>) { + LL| 1| if let Some(opt_msg) = opt_opt_msg + LL| 1| && let Some(msg) = opt_msg + LL| 1| { + LL| 1| say(msg); + LL| 1| } + ^0 + LL| | + LL| 1| if let Some(opt_msg) = opt_opt_msg + LL| 1| && let Some(msg) = opt_msg + LL| 1| { + LL| 1| say(msg) + LL| 1| } + ^0 + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let opt_opt_msg = cfg_select!( + LL| | none => None, + LL| | one => Some(None), + LL| | two => Some(Some("hello")), + LL| | ); + LL| | if_let_chain(opt_opt_msg); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-tail-expr.no.cov-map b/tests/coverage/if-tail-expr.no.cov-map new file mode 100644 index 0000000000000..b790250f3faa3 --- /dev/null +++ b/tests/coverage/if-tail-expr.no.cov-map @@ -0,0 +1,32 @@ +Function name: if_tail_expr::if_true +Raw bytes (89): 0x[01, 01, 05, 01, 05, 01, 09, 01, 0d, 01, 13, 0d, 11, 0f, 01, 09, 01, 00, 24, 01, 01, 05, 00, 11, 01, 02, 08, 00, 0c, 05, 00, 0d, 02, 06, 02, 02, 05, 00, 06, 01, 02, 08, 00, 0c, 09, 00, 0d, 02, 06, 06, 02, 0c, 02, 06, 01, 04, 08, 00, 0c, 0d, 00, 0d, 02, 06, 0a, 02, 0f, 00, 14, 11, 00, 15, 02, 06, 0e, 02, 0c, 02, 06, 01, 04, 05, 00, 13, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/if-tail-expr.rs +Number of expressions: 5 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Counter(2) +- expression 2 operands: lhs = Counter(0), rhs = Counter(3) +- expression 3 operands: lhs = Counter(0), rhs = Expression(4, Add) +- expression 4 operands: lhs = Counter(3), rhs = Counter(4) +Number of file 0 mappings: 15 +- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 36) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12) +- Code(Counter(1)) at (prev + 0, 13) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) + = (c0 - c1) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12) +- Code(Counter(2)) at (prev + 0, 13) to (start + 2, 6) +- Code(Expression(1, Sub)) at (prev + 2, 12) to (start + 2, 6) + = (c0 - c2) +- Code(Counter(0)) at (prev + 4, 8) to (start + 0, 12) +- Code(Counter(3)) at (prev + 0, 13) to (start + 2, 6) +- Code(Expression(2, Sub)) at (prev + 2, 15) to (start + 0, 20) + = (c0 - c3) +- Code(Counter(4)) at (prev + 0, 21) to (start + 2, 6) +- Code(Expression(3, Sub)) at (prev + 2, 12) to (start + 2, 6) + = (c0 - (c3 + c4)) +- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c4 + diff --git a/tests/coverage/if-tail-expr.no.coverage b/tests/coverage/if-tail-expr.no.coverage new file mode 100644 index 0000000000000..a1dc2bf244dee --- /dev/null +++ b/tests/coverage/if-tail-expr.no.coverage @@ -0,0 +1,46 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: no yes + LL| |//@[yes] ignore-coverage-map + LL| | + LL| |// A variety of simple `if` expressions, in which the then/else blocks end with + LL| |// an expression. Contrast with `if-tail-stmt.rs`. + LL| | + LL| 1|fn if_true(cond: bool, other: bool) { + LL| 1| say("hello"); + LL| | + LL| 1| if cond { + LL| 0| say("true") + LL| 1| } + LL| | + LL| 1| if cond { + LL| 0| say("true") + LL| 1| } else { + LL| 1| say("false") + LL| 1| } + LL| | + LL| 1| if cond { + LL| 0| say("cond") + LL| 1| } else if other { + LL| 1| say("other") + LL| 1| } else { + LL| 0| say("neither") + LL| 0| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let cond = cfg_select!( + LL| | no => false, + LL| | yes => true, + LL| | ); + LL| | if_true(cond, !cond); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-tail-expr.rs b/tests/coverage/if-tail-expr.rs new file mode 100644 index 0000000000000..778a9ecc8380c --- /dev/null +++ b/tests/coverage/if-tail-expr.rs @@ -0,0 +1,45 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ revisions: no yes +//@[yes] ignore-coverage-map + +// A variety of simple `if` expressions, in which the then/else blocks end with +// an expression. Contrast with `if-tail-stmt.rs`. + +fn if_true(cond: bool, other: bool) { + say("hello"); + + if cond { + say("true") + } + + if cond { + say("true") + } else { + say("false") + } + + if cond { + say("cond") + } else if other { + say("other") + } else { + say("neither") + } + + say("goodbye"); +} + +#[coverage(off)] +fn main() { + let cond = cfg_select!( + no => false, + yes => true, + ); + if_true(cond, !cond); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); +} diff --git a/tests/coverage/if-tail-expr.yes.coverage b/tests/coverage/if-tail-expr.yes.coverage new file mode 100644 index 0000000000000..29ee93fbc9607 --- /dev/null +++ b/tests/coverage/if-tail-expr.yes.coverage @@ -0,0 +1,48 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: no yes + LL| |//@[yes] ignore-coverage-map + LL| | + LL| |// A variety of simple `if` expressions, in which the then/else blocks end with + LL| |// an expression. Contrast with `if-tail-stmt.rs`. + LL| | + LL| 1|fn if_true(cond: bool, other: bool) { + LL| 1| say("hello"); + LL| | + LL| 1| if cond { + LL| 1| say("true") + LL| 1| } + ^0 + LL| | + LL| 1| if cond { + LL| 1| say("true") + LL| 1| } else { + LL| 0| say("false") + LL| 0| } + LL| | + LL| 1| if cond { + LL| 1| say("cond") + LL| 1| } else if other { + ^0 + LL| 0| say("other") + LL| 0| } else { + LL| 0| say("neither") + LL| 0| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let cond = cfg_select!( + LL| | no => false, + LL| | yes => true, + LL| | ); + LL| | if_true(cond, !cond); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-tail-stmt.no.cov-map b/tests/coverage/if-tail-stmt.no.cov-map new file mode 100644 index 0000000000000..37989026c1c57 --- /dev/null +++ b/tests/coverage/if-tail-stmt.no.cov-map @@ -0,0 +1,32 @@ +Function name: if_tail_stmt::if_true +Raw bytes (89): 0x[01, 01, 05, 01, 05, 01, 09, 01, 0d, 01, 13, 0d, 11, 0f, 01, 09, 01, 00, 24, 01, 01, 05, 00, 11, 01, 02, 08, 00, 0c, 05, 00, 0d, 02, 06, 02, 02, 05, 00, 06, 01, 02, 08, 00, 0c, 09, 00, 0d, 02, 06, 06, 02, 0c, 02, 06, 01, 04, 08, 00, 0c, 0d, 00, 0d, 02, 06, 0a, 02, 0f, 00, 14, 11, 00, 15, 02, 06, 0e, 02, 0c, 02, 06, 01, 04, 05, 00, 13, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/if-tail-stmt.rs +Number of expressions: 5 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Counter(2) +- expression 2 operands: lhs = Counter(0), rhs = Counter(3) +- expression 3 operands: lhs = Counter(0), rhs = Expression(4, Add) +- expression 4 operands: lhs = Counter(3), rhs = Counter(4) +Number of file 0 mappings: 15 +- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 36) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12) +- Code(Counter(1)) at (prev + 0, 13) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) + = (c0 - c1) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12) +- Code(Counter(2)) at (prev + 0, 13) to (start + 2, 6) +- Code(Expression(1, Sub)) at (prev + 2, 12) to (start + 2, 6) + = (c0 - c2) +- Code(Counter(0)) at (prev + 4, 8) to (start + 0, 12) +- Code(Counter(3)) at (prev + 0, 13) to (start + 2, 6) +- Code(Expression(2, Sub)) at (prev + 2, 15) to (start + 0, 20) + = (c0 - c3) +- Code(Counter(4)) at (prev + 0, 21) to (start + 2, 6) +- Code(Expression(3, Sub)) at (prev + 2, 12) to (start + 2, 6) + = (c0 - (c3 + c4)) +- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c4 + diff --git a/tests/coverage/if-tail-stmt.no.coverage b/tests/coverage/if-tail-stmt.no.coverage new file mode 100644 index 0000000000000..ca311f21ff229 --- /dev/null +++ b/tests/coverage/if-tail-stmt.no.coverage @@ -0,0 +1,46 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: no yes + LL| |//@[yes] ignore-coverage-map + LL| | + LL| |// A variety of simple `if` expressions, in which the then/else blocks end with + LL| |// a semicolon. Contrast with `if-tail-expr.rs`. + LL| | + LL| 1|fn if_true(cond: bool, other: bool) { + LL| 1| say("hello"); + LL| | + LL| 1| if cond { + LL| 0| say("true"); + LL| 1| } + LL| | + LL| 1| if cond { + LL| 0| say("true"); + LL| 1| } else { + LL| 1| say("false"); + LL| 1| } + LL| | + LL| 1| if cond { + LL| 0| say("cond"); + LL| 1| } else if other { + LL| 1| say("other"); + LL| 1| } else { + LL| 0| say("neither"); + LL| 0| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let cond = cfg_select!( + LL| | no => false, + LL| | yes => true, + LL| | ); + LL| | if_true(cond, !cond); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if-tail-stmt.rs b/tests/coverage/if-tail-stmt.rs new file mode 100644 index 0000000000000..f350c4eba90b0 --- /dev/null +++ b/tests/coverage/if-tail-stmt.rs @@ -0,0 +1,45 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ revisions: no yes +//@[yes] ignore-coverage-map + +// A variety of simple `if` expressions, in which the then/else blocks end with +// a semicolon. Contrast with `if-tail-expr.rs`. + +fn if_true(cond: bool, other: bool) { + say("hello"); + + if cond { + say("true"); + } + + if cond { + say("true"); + } else { + say("false"); + } + + if cond { + say("cond"); + } else if other { + say("other"); + } else { + say("neither"); + } + + say("goodbye"); +} + +#[coverage(off)] +fn main() { + let cond = cfg_select!( + no => false, + yes => true, + ); + if_true(cond, !cond); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); +} diff --git a/tests/coverage/if-tail-stmt.yes.coverage b/tests/coverage/if-tail-stmt.yes.coverage new file mode 100644 index 0000000000000..b4fa1884315e6 --- /dev/null +++ b/tests/coverage/if-tail-stmt.yes.coverage @@ -0,0 +1,48 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: no yes + LL| |//@[yes] ignore-coverage-map + LL| | + LL| |// A variety of simple `if` expressions, in which the then/else blocks end with + LL| |// a semicolon. Contrast with `if-tail-expr.rs`. + LL| | + LL| 1|fn if_true(cond: bool, other: bool) { + LL| 1| say("hello"); + LL| | + LL| 1| if cond { + LL| 1| say("true"); + LL| 1| } + ^0 + LL| | + LL| 1| if cond { + LL| 1| say("true"); + LL| 1| } else { + LL| 0| say("false"); + LL| 0| } + LL| | + LL| 1| if cond { + LL| 1| say("cond"); + LL| 1| } else if other { + ^0 + LL| 0| say("other"); + LL| 0| } else { + LL| 0| say("neither"); + LL| 0| } + LL| | + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let cond = cfg_select!( + LL| | no => false, + LL| | yes => true, + LL| | ); + LL| | if_true(cond, !cond); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/if_else.cov-map b/tests/coverage/if_else.cov-map deleted file mode 100644 index 1d8ca1809532f..0000000000000 --- a/tests/coverage/if_else.cov-map +++ /dev/null @@ -1,24 +0,0 @@ -Function name: if_else::main -Raw bytes (68): 0x[01, 01, 02, 01, 05, 01, 09, 0c, 01, 04, 01, 00, 0a, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 09, 00, 16, 01, 00, 19, 00, 1a, 01, 02, 09, 00, 10, 05, 01, 05, 05, 06, 02, 08, 09, 02, 10, 01, 06, 09, 00, 10, 09, 01, 05, 05, 06, 06, 07, 05, 05, 06, 01, 06, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/if_else.rs -Number of expressions: 2 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(0), rhs = Counter(2) -Number of file 0 mappings: 12 -- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 26) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 16) -- Code(Counter(1)) at (prev + 1, 5) to (start + 5, 6) -- Code(Expression(0, Sub)) at (prev + 8, 9) to (start + 2, 16) - = (c0 - c1) -- Code(Counter(0)) at (prev + 6, 9) to (start + 0, 16) -- Code(Counter(2)) at (prev + 1, 5) to (start + 5, 6) -- Code(Expression(1, Sub)) at (prev + 7, 5) to (start + 5, 6) - = (c0 - c2) -- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 2) -Highest counter ID seen: c2 - diff --git a/tests/coverage/iffy/README.md b/tests/coverage/iffy/README.md new file mode 100644 index 0000000000000..0d8a866ed2685 --- /dev/null +++ b/tests/coverage/iffy/README.md @@ -0,0 +1,4 @@ +# `tests/coverage/iffy` + +Older tests that are of limited value for investigating specific problems, +but still have some worth in detecting regressions by adding variety to the test corpus. diff --git a/tests/coverage/abort.cov-map b/tests/coverage/iffy/abort.cov-map similarity index 73% rename from tests/coverage/abort.cov-map rename to tests/coverage/iffy/abort.cov-map index b6bd0edebaaef..32dd69e8d6b03 100644 --- a/tests/coverage/abort.cov-map +++ b/tests/coverage/iffy/abort.cov-map @@ -1,5 +1,5 @@ Function name: abort::main -Raw bytes (98): 0x[01, 01, 07, 05, 01, 05, 0b, 01, 09, 05, 13, 01, 0d, 05, 1b, 01, 11, 10, 01, 0d, 01, 00, 1c, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 19, 09, 00, 1a, 02, 0a, 06, 02, 09, 00, 0a, 02, 02, 0c, 00, 19, 0d, 00, 1a, 00, 31, 0e, 00, 30, 00, 31, 02, 04, 0c, 00, 19, 11, 00, 1a, 00, 31, 16, 00, 30, 00, 31, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (93): 0x[01, 01, 07, 05, 01, 05, 0b, 01, 09, 05, 13, 01, 0d, 05, 1b, 01, 11, 0f, 01, 0d, 01, 00, 1c, 01, 01, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 19, 09, 00, 1a, 02, 0a, 06, 02, 09, 00, 0a, 02, 02, 0c, 00, 19, 0d, 00, 1a, 00, 31, 0e, 00, 30, 00, 31, 02, 04, 0c, 00, 19, 11, 00, 1a, 00, 31, 16, 00, 30, 00, 31, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/abort.rs Number of expressions: 7 @@ -10,10 +10,9 @@ Number of expressions: 7 - expression 4 operands: lhs = Counter(0), rhs = Counter(3) - expression 5 operands: lhs = Counter(1), rhs = Expression(6, Add) - expression 6 operands: lhs = Counter(0), rhs = Counter(4) -Number of file 0 mappings: 16 +Number of file 0 mappings: 15 - Code(Counter(0)) at (prev + 13, 1) to (start + 0, 28) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 25) to (start + 0, 27) - Code(Counter(1)) at (prev + 1, 11) to (start + 0, 24) - Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 25) = (c1 - c0) @@ -37,7 +36,7 @@ Number of file 0 mappings: 16 Highest counter ID seen: c4 Function name: abort::might_abort -Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 03, 01, 00, 2e, 01, 01, 08, 00, 14, 05, 01, 09, 00, 11, 05, 01, 09, 00, 0f, 02, 01, 0c, 02, 06, 02, 03, 01, 00, 02] +Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 03, 01, 00, 2e, 01, 01, 08, 00, 14, 05, 00, 15, 03, 06, 05, 01, 09, 00, 11, 02, 02, 0c, 02, 06, 02, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/abort.rs Number of expressions: 1 @@ -45,9 +44,9 @@ Number of expressions: 1 Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 3, 1) to (start + 0, 46) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 20) +- Code(Counter(1)) at (prev + 0, 21) to (start + 3, 6) - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15) -- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 2, 6) = (c0 - c1) - Code(Expression(0, Sub)) at (prev + 3, 1) to (start + 0, 2) = (c0 - c1) diff --git a/tests/coverage/abort.coverage b/tests/coverage/iffy/abort.coverage similarity index 100% rename from tests/coverage/abort.coverage rename to tests/coverage/iffy/abort.coverage diff --git a/tests/coverage/abort.rs b/tests/coverage/iffy/abort.rs similarity index 100% rename from tests/coverage/abort.rs rename to tests/coverage/iffy/abort.rs diff --git a/tests/coverage/iffy/assert.cov-map b/tests/coverage/iffy/assert.cov-map new file mode 100644 index 0000000000000..d521e254471a3 --- /dev/null +++ b/tests/coverage/iffy/assert.cov-map @@ -0,0 +1,44 @@ +Function name: assert::main +Raw bytes (71): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 0b, 01, 09, 01, 00, 1c, 01, 01, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 02, 0a, 06, 02, 13, 00, 20, 0d, 00, 21, 02, 0a, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/assert.rs +Number of expressions: 6 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +- expression 1 operands: lhs = Counter(1), rhs = Expression(5, Add) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) +- expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) +- expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3) +- expression 5 operands: lhs = Counter(0), rhs = Counter(2) +Number of file 0 mappings: 11 +- Code(Counter(0)) at (prev + 9, 1) to (start + 0, 28) +- Code(Counter(0)) at (prev + 1, 25) to (start + 0, 27) +- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 24) +- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 26) + = (c1 - c0) +- Code(Counter(2)) at (prev + 0, 27) to (start + 2, 10) +- Code(Expression(1, Sub)) at (prev + 2, 19) to (start + 0, 32) + = (c1 - (c0 + c2)) +- Code(Counter(3)) at (prev + 0, 33) to (start + 2, 10) +- Code(Expression(3, Sub)) at (prev + 2, 9) to (start + 0, 10) + = (c1 - ((c0 + c2) + c3)) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23) + = (c1 - c0) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 11) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c3 + +Function name: assert::might_fail_assert +Raw bytes (39): 0x[01, 01, 00, 07, 01, 04, 01, 00, 28, 01, 01, 05, 00, 0d, 01, 00, 22, 00, 2e, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 15, 01, 00, 17, 00, 23, 05, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/assert.rs +Number of expressions: 0 +Number of file 0 mappings: 7 +- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 40) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 34) to (start + 0, 46) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 21) +- Code(Counter(0)) at (prev + 0, 23) to (start + 0, 35) +- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 + diff --git a/tests/coverage/iffy/assert.coverage b/tests/coverage/iffy/assert.coverage new file mode 100644 index 0000000000000..29a5b48c0566a --- /dev/null +++ b/tests/coverage/iffy/assert.coverage @@ -0,0 +1,33 @@ + LL| |#![allow(unused_assignments)] + LL| |//@ failure-status: 101 + LL| | + LL| 4|fn might_fail_assert(one_plus_one: u32) { + LL| 4| println!("does 1 + 1 = {}?", one_plus_one); + LL| 4| assert_eq!(1 + 1, one_plus_one, "the argument was wrong"); + LL| 3|} + LL| | + LL| 1|fn main() -> Result<(), u8> { + LL| 1| let mut countdown = 10; + LL| 10| while countdown > 0 { + LL| 9| if countdown == 1 { + LL| 1| might_fail_assert(3); + LL| 8| } else if countdown < 5 { + LL| 3| might_fail_assert(2); + LL| 5| } + LL| 9| countdown -= 1; + LL| | } + LL| 1| Ok(()) + LL| 1|} + LL| | + LL| |// Notes: + LL| |// 1. Compare this program and its coverage results to those of the very similar test + LL| |// `panic_unwind.rs`, and similar tests `abort.rs` and `try_error_result.rs`. + LL| |// 2. This test confirms the coverage generated when a program passes or fails an `assert!()` or + LL| |// related `assert_*!()` macro. + LL| |// 3. Notably, the `assert` macros *do not* generate `TerminatorKind::Assert`. The macros produce + LL| |// conditional expressions, `TerminatorKind::SwitchInt` branches, and a possible call to + LL| |// `begin_panic_fmt()` (that begins a panic unwind, if the assertion test fails). + LL| |// 4. `TerminatorKind::Assert` is, however, also present in the MIR generated for this test + LL| |// (and in many other coverage tests). The `Assert` terminator is typically generated by the + LL| |// Rust compiler to check for runtime failures, such as numeric overflows. + diff --git a/tests/coverage/iffy/assert.rs b/tests/coverage/iffy/assert.rs new file mode 100644 index 0000000000000..30d511f8f7a89 --- /dev/null +++ b/tests/coverage/iffy/assert.rs @@ -0,0 +1,32 @@ +#![allow(unused_assignments)] +//@ failure-status: 101 + +fn might_fail_assert(one_plus_one: u32) { + println!("does 1 + 1 = {}?", one_plus_one); + assert_eq!(1 + 1, one_plus_one, "the argument was wrong"); +} + +fn main() -> Result<(), u8> { + let mut countdown = 10; + while countdown > 0 { + if countdown == 1 { + might_fail_assert(3); + } else if countdown < 5 { + might_fail_assert(2); + } + countdown -= 1; + } + Ok(()) +} + +// Notes: +// 1. Compare this program and its coverage results to those of the very similar test +// `panic_unwind.rs`, and similar tests `abort.rs` and `try_error_result.rs`. +// 2. This test confirms the coverage generated when a program passes or fails an `assert!()` or +// related `assert_*!()` macro. +// 3. Notably, the `assert` macros *do not* generate `TerminatorKind::Assert`. The macros produce +// conditional expressions, `TerminatorKind::SwitchInt` branches, and a possible call to +// `begin_panic_fmt()` (that begins a panic unwind, if the assertion test fails). +// 4. `TerminatorKind::Assert` is, however, also present in the MIR generated for this test +// (and in many other coverage tests). The `Assert` terminator is typically generated by the +// Rust compiler to check for runtime failures, such as numeric overflows. diff --git a/tests/coverage/auxiliary/inline_always_with_dead_code.rs b/tests/coverage/iffy/auxiliary/inline_always_with_dead_code.rs similarity index 100% rename from tests/coverage/auxiliary/inline_always_with_dead_code.rs rename to tests/coverage/iffy/auxiliary/inline_always_with_dead_code.rs diff --git a/tests/coverage/auxiliary/used_crate.rs b/tests/coverage/iffy/auxiliary/used_crate.rs similarity index 100% rename from tests/coverage/auxiliary/used_crate.rs rename to tests/coverage/iffy/auxiliary/used_crate.rs diff --git a/tests/coverage/auxiliary/used_inline_crate.rs b/tests/coverage/iffy/auxiliary/used_inline_crate.rs similarity index 100% rename from tests/coverage/auxiliary/used_inline_crate.rs rename to tests/coverage/iffy/auxiliary/used_inline_crate.rs diff --git a/tests/coverage/iffy/closure.cov-map b/tests/coverage/iffy/closure.cov-map new file mode 100644 index 0000000000000..f0ee043350f67 --- /dev/null +++ b/tests/coverage/iffy/closure.cov-map @@ -0,0 +1,302 @@ +Function name: closure::main +Raw bytes (146): 0x[01, 01, 01, 01, 05, 1c, 01, 0a, 01, 00, 0a, 01, 04, 13, 00, 2e, 01, 01, 14, 00, 1c, 01, 02, 1b, 00, 43, 01, 01, 05, 00, 0d, 01, 03, 09, 00, 14, 01, 0f, 05, 00, 3b, 01, 00, 05, 00, 10, 01, 0c, 05, 00, 0d, 01, 03, 09, 05, 0a, 01, 08, 05, 00, 17, 01, 01, 05, 00, 0d, 01, 03, 09, 00, 14, 01, 0f, 05, 00, 17, 01, 0c, 05, 00, 0d, 01, 03, 09, 05, 0a, 01, 13, 05, 00, 0d, 01, 03, 09, 06, 21, 01, 16, 19, 00, 1b, 01, 4d, 08, 00, 10, 05, 00, 11, 04, 06, 05, 01, 09, 00, 30, 05, 01, 09, 00, 4e, 02, 02, 05, 00, 06, 01, 01, 05, 00, 28, 01, 01, 05, 00, 46, 01, 01, 05, 00, 43, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 28 +- Code(Counter(0)) at (prev + 10, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 4, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 1, 20) to (start + 0, 28) +- Code(Counter(0)) at (prev + 2, 27) to (start + 0, 67) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 20) +- Code(Counter(0)) at (prev + 15, 5) to (start + 0, 59) +- Code(Counter(0)) at (prev + 0, 5) to (start + 0, 16) +- Code(Counter(0)) at (prev + 12, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 3, 9) to (start + 5, 10) +- Code(Counter(0)) at (prev + 8, 5) to (start + 0, 23) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 20) +- Code(Counter(0)) at (prev + 15, 5) to (start + 0, 23) +- Code(Counter(0)) at (prev + 12, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 3, 9) to (start + 5, 10) +- Code(Counter(0)) at (prev + 19, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 3, 9) to (start + 6, 33) +- Code(Counter(0)) at (prev + 22, 25) to (start + 0, 27) +- Code(Counter(0)) at (prev + 77, 8) to (start + 0, 16) +- Code(Counter(1)) at (prev + 0, 17) to (start + 4, 6) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 48) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 78) +- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 40) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 70) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 67) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 + +Function name: closure::main::{closure#0} (unused) +Raw bytes (39): 0x[01, 01, 00, 07, 00, 29, 05, 00, 06, 00, 01, 1d, 00, 1e, 00, 01, 0c, 00, 14, 00, 00, 15, 02, 0a, 00, 02, 09, 00, 0a, 00, 01, 09, 00, 22, 00, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 7 +- Code(Zero) at (prev + 41, 5) to (start + 0, 6) +- Code(Zero) at (prev + 1, 29) to (start + 0, 30) +- Code(Zero) at (prev + 1, 12) to (start + 0, 20) +- Code(Zero) at (prev + 0, 21) to (start + 2, 10) +- Code(Zero) at (prev + 2, 9) to (start + 0, 10) +- Code(Zero) at (prev + 1, 9) to (start + 0, 34) +- Code(Zero) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: (none) + +Function name: closure::main::{closure#10} (unused) +Raw bytes (25): 0x[01, 01, 00, 04, 00, 9c, 01, 07, 00, 08, 00, 00, 09, 00, 11, 00, 00, 12, 00, 1e, 00, 00, 20, 00, 21] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Zero) at (prev + 156, 7) to (start + 0, 8) +- Code(Zero) at (prev + 0, 9) to (start + 0, 17) +- Code(Zero) at (prev + 0, 18) to (start + 0, 30) +- Code(Zero) at (prev + 0, 32) to (start + 0, 33) +Highest counter ID seen: (none) + +Function name: closure::main::{closure#11} (unused) +Raw bytes (25): 0x[01, 01, 00, 04, 00, a0, 01, 07, 00, 08, 00, 00, 09, 00, 11, 00, 00, 12, 00, 1e, 00, 00, 20, 00, 21] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Zero) at (prev + 160, 7) to (start + 0, 8) +- Code(Zero) at (prev + 0, 9) to (start + 0, 17) +- Code(Zero) at (prev + 0, 18) to (start + 0, 30) +- Code(Zero) at (prev + 0, 32) to (start + 0, 33) +Highest counter ID seen: (none) + +Function name: closure::main::{closure#12} (unused) +Raw bytes (15): 0x[01, 01, 00, 02, 00, a8, 01, 01, 00, 09, 00, 00, 0a, 00, 16] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 2 +- Code(Zero) at (prev + 168, 1) to (start + 0, 9) +- Code(Zero) at (prev + 0, 10) to (start + 0, 22) +Highest counter ID seen: (none) + +Function name: closure::main::{closure#13} (unused) +Raw bytes (15): 0x[01, 01, 00, 02, 00, ad, 01, 0d, 00, 15, 00, 01, 11, 00, 1d] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 2 +- Code(Zero) at (prev + 173, 13) to (start + 0, 21) +- Code(Zero) at (prev + 1, 17) to (start + 0, 29) +Highest counter ID seen: (none) + +Function name: closure::main::{closure#14} +Raw bytes (27): 0x[01, 01, 01, 01, 05, 04, 01, b4, 01, 0d, 00, 15, 01, 02, 14, 00, 1b, 05, 00, 1c, 00, 27, 02, 00, 2d, 00, 35] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 180, 13) to (start + 0, 21) +- Code(Counter(0)) at (prev + 2, 20) to (start + 0, 27) +- Code(Counter(1)) at (prev + 0, 28) to (start + 0, 39) +- Code(Expression(0, Sub)) at (prev + 0, 45) to (start + 0, 53) + = (c0 - c1) +Highest counter ID seen: c1 + +Function name: closure::main::{closure#15} +Raw bytes (37): 0x[01, 01, 01, 01, 05, 06, 01, bc, 01, 09, 00, 0a, 01, 01, 0d, 00, 15, 01, 02, 14, 00, 1b, 05, 00, 1c, 00, 27, 02, 00, 2d, 00, 35, 01, 02, 09, 00, 0a] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 6 +- Code(Counter(0)) at (prev + 188, 9) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 21) +- Code(Counter(0)) at (prev + 2, 20) to (start + 0, 27) +- Code(Counter(1)) at (prev + 0, 28) to (start + 0, 39) +- Code(Expression(0, Sub)) at (prev + 0, 45) to (start + 0, 53) + = (c0 - c1) +- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) +Highest counter ID seen: c1 + +Function name: closure::main::{closure#16} +Raw bytes (27): 0x[01, 01, 01, 01, 05, 04, 01, c6, 01, 0d, 00, 15, 01, 02, 14, 00, 1b, 05, 00, 1c, 00, 27, 02, 00, 2d, 00, 35] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 198, 13) to (start + 0, 21) +- Code(Counter(0)) at (prev + 2, 20) to (start + 0, 27) +- Code(Counter(1)) at (prev + 0, 28) to (start + 0, 39) +- Code(Expression(0, Sub)) at (prev + 0, 45) to (start + 0, 53) + = (c0 - c1) +Highest counter ID seen: c1 + +Function name: closure::main::{closure#17} +Raw bytes (37): 0x[01, 01, 01, 01, 05, 06, 01, ce, 01, 09, 00, 0a, 01, 01, 0d, 00, 15, 01, 02, 14, 00, 1b, 05, 00, 1c, 00, 27, 02, 00, 2d, 00, 35, 01, 02, 09, 00, 0a] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 6 +- Code(Counter(0)) at (prev + 206, 9) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 21) +- Code(Counter(0)) at (prev + 2, 20) to (start + 0, 27) +- Code(Counter(1)) at (prev + 0, 28) to (start + 0, 39) +- Code(Expression(0, Sub)) at (prev + 0, 45) to (start + 0, 53) + = (c0 - c1) +- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) +Highest counter ID seen: c1 + +Function name: closure::main::{closure#18} (unused) +Raw bytes (39): 0x[01, 01, 00, 07, 00, 1a, 0d, 00, 0e, 00, 01, 25, 00, 26, 00, 01, 14, 00, 1c, 00, 00, 1d, 02, 12, 00, 02, 11, 00, 12, 00, 01, 11, 00, 2a, 00, 01, 0d, 00, 0e] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 7 +- Code(Zero) at (prev + 26, 13) to (start + 0, 14) +- Code(Zero) at (prev + 1, 37) to (start + 0, 38) +- Code(Zero) at (prev + 1, 20) to (start + 0, 28) +- Code(Zero) at (prev + 0, 29) to (start + 2, 18) +- Code(Zero) at (prev + 2, 17) to (start + 0, 18) +- Code(Zero) at (prev + 1, 17) to (start + 0, 42) +- Code(Zero) at (prev + 1, 13) to (start + 0, 14) +Highest counter ID seen: (none) + +Function name: closure::main::{closure#19} +Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 44, 0d, 00, 0e, 01, 01, 25, 00, 26, 01, 01, 14, 00, 1c, 05, 00, 1d, 02, 12, 02, 02, 11, 00, 12, 01, 01, 11, 00, 2a, 01, 01, 0d, 00, 0e] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 7 +- Code(Counter(0)) at (prev + 68, 13) to (start + 0, 14) +- Code(Counter(0)) at (prev + 1, 37) to (start + 0, 38) +- Code(Counter(0)) at (prev + 1, 20) to (start + 0, 28) +- Code(Counter(1)) at (prev + 0, 29) to (start + 2, 18) +- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 18) + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 42) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) +Highest counter ID seen: c1 + +Function name: closure::main::{closure#1} +Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 53, 05, 00, 06, 01, 01, 1d, 00, 1e, 01, 01, 0c, 00, 14, 05, 00, 15, 02, 0a, 02, 02, 09, 00, 0a, 01, 01, 09, 00, 22, 01, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 7 +- Code(Counter(0)) at (prev + 83, 5) to (start + 0, 6) +- Code(Counter(0)) at (prev + 1, 29) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 20) +- Code(Counter(1)) at (prev + 0, 21) to (start + 2, 10) +- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10) + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 34) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: c1 + +Function name: closure::main::{closure#2} +Raw bytes (46): 0x[01, 01, 01, 01, 05, 08, 01, 69, 05, 00, 06, 01, 01, 1d, 00, 1e, 01, 01, 0c, 00, 14, 05, 00, 15, 02, 0a, 02, 02, 09, 00, 0a, 01, 01, 09, 00, 10, 01, 00, 19, 00, 1c, 01, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 8 +- Code(Counter(0)) at (prev + 105, 5) to (start + 0, 6) +- Code(Counter(0)) at (prev + 1, 29) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 20) +- Code(Counter(1)) at (prev + 0, 21) to (start + 2, 10) +- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10) + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) +- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 28) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: c1 + +Function name: closure::main::{closure#3} (unused) +Raw bytes (35): 0x[01, 01, 00, 06, 00, 82, 01, 05, 00, 06, 00, 01, 0c, 00, 14, 00, 00, 15, 02, 0a, 00, 02, 09, 00, 0a, 00, 01, 09, 00, 2e, 00, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 6 +- Code(Zero) at (prev + 130, 5) to (start + 0, 6) +- Code(Zero) at (prev + 1, 12) to (start + 0, 20) +- Code(Zero) at (prev + 0, 21) to (start + 2, 10) +- Code(Zero) at (prev + 2, 9) to (start + 0, 10) +- Code(Zero) at (prev + 1, 9) to (start + 0, 46) +- Code(Zero) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: (none) + +Function name: closure::main::{closure#4} (unused) +Raw bytes (15): 0x[01, 01, 00, 02, 00, 8a, 01, 35, 00, 3e, 00, 00, 42, 00, 43] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 2 +- Code(Zero) at (prev + 138, 53) to (start + 0, 62) +- Code(Zero) at (prev + 0, 66) to (start + 0, 67) +Highest counter ID seen: (none) + +Function name: closure::main::{closure#5} +Raw bytes (15): 0x[01, 01, 00, 02, 01, 8d, 01, 3d, 00, 45, 01, 00, 46, 00, 4e] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 2 +- Code(Counter(0)) at (prev + 141, 61) to (start + 0, 69) +- Code(Counter(0)) at (prev + 0, 70) to (start + 0, 78) +Highest counter ID seen: c0 + +Function name: closure::main::{closure#6} +Raw bytes (15): 0x[01, 01, 00, 02, 01, 8e, 01, 41, 00, 49, 01, 00, 4a, 00, 56] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 2 +- Code(Counter(0)) at (prev + 142, 65) to (start + 0, 73) +- Code(Counter(0)) at (prev + 0, 74) to (start + 0, 86) +Highest counter ID seen: c0 + +Function name: closure::main::{closure#7} (unused) +Raw bytes (15): 0x[01, 01, 00, 02, 00, 8f, 01, 3b, 00, 43, 00, 00, 44, 00, 50] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 2 +- Code(Zero) at (prev + 143, 59) to (start + 0, 67) +- Code(Zero) at (prev + 0, 68) to (start + 0, 80) +Highest counter ID seen: (none) + +Function name: closure::main::{closure#8} (unused) +Raw bytes (25): 0x[01, 01, 00, 04, 00, 94, 01, 3b, 00, 3c, 00, 00, 3d, 00, 45, 00, 00, 46, 00, 52, 00, 00, 54, 00, 55] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Zero) at (prev + 148, 59) to (start + 0, 60) +- Code(Zero) at (prev + 0, 61) to (start + 0, 69) +- Code(Zero) at (prev + 0, 70) to (start + 0, 82) +- Code(Zero) at (prev + 0, 84) to (start + 0, 85) +Highest counter ID seen: (none) + +Function name: closure::main::{closure#9} (unused) +Raw bytes (25): 0x[01, 01, 00, 04, 00, 96, 01, 38, 00, 39, 00, 01, 09, 00, 11, 00, 00, 12, 00, 1e, 00, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/closure.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Zero) at (prev + 150, 56) to (start + 0, 57) +- Code(Zero) at (prev + 1, 9) to (start + 0, 17) +- Code(Zero) at (prev + 0, 18) to (start + 0, 30) +- Code(Zero) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: (none) + diff --git a/tests/coverage/closure.coverage b/tests/coverage/iffy/closure.coverage similarity index 79% rename from tests/coverage/closure.coverage rename to tests/coverage/iffy/closure.coverage index 64e6006bbe8cd..a00dcc1377145 100644 --- a/tests/coverage/closure.coverage +++ b/tests/coverage/iffy/closure.coverage @@ -1,5 +1,6 @@ LL| |#![allow(unused_assignments, unused_variables)] LL| |//@ compile-flags: -C opt-level=2 + LL| |//@ min-llvm-version: 23 LL| | LL| |// This test used to be sensitive to certain coverage-specific hacks in LL| |// `rustc_middle/mir/mono.rs`, but those hacks were later cleaned up by @@ -19,7 +20,7 @@ LL| | , LL| 1| some_string LL| | . - LL| 1| unwrap_or_else + LL| | unwrap_or_else LL| | ( LL| | || LL| 0| { @@ -34,7 +35,7 @@ LL| | LL| 1| some_string = Some(String::from("the string content")); LL| | let - LL| 1| a + LL| | a LL| | = LL| | || LL| 0| { @@ -48,11 +49,11 @@ LL| | "The string or alt: {}" LL| | , LL| 1| some_string - LL| | . + LL| 1| . LL| 1| unwrap_or_else - LL| | ( + LL| 1| ( LL| 1| a - LL| | ) + LL| 1| ) LL| | ); LL| | LL| 1| some_string = None; @@ -61,7 +62,7 @@ LL| | , LL| 1| some_string LL| | . - LL| 1| unwrap_or_else + LL| | unwrap_or_else LL| | ( LL| | || LL| 1| { @@ -76,7 +77,7 @@ LL| | LL| 1| some_string = None; LL| | let - LL| 1| a + LL| | a LL| | = LL| | || LL| 1| { @@ -90,15 +91,15 @@ LL| | "The string or alt: {}" LL| | , LL| 1| some_string - LL| | . + LL| 1| . LL| 1| unwrap_or_else - LL| | ( + LL| 1| ( LL| 1| a - LL| | ) + LL| 1| ) LL| | ); LL| | LL| | let - LL| 1| quote_closure + LL| | quote_closure LL| | = LL| | |val| LL| 5| { @@ -114,14 +115,14 @@ LL| 1| std::iter::repeat("repeat me") LL| 1| .take(5) LL| 1| .map - LL| | ( + LL| 1| ( LL| 1| quote_closure - LL| | ) + LL| 1| ) LL| 1| .collect::>() LL| | ); LL| | LL| | let - LL| 1| _unused_closure + LL| | _unused_closure LL| | = LL| | | LL| | mut countdown @@ -134,31 +135,27 @@ LL| 0| }; LL| | LL| 1| let mut countdown = 10; - LL| 1| let _short_unused_closure = | _unused_arg: u8 | countdown += 1; + LL| 0| let _short_unused_closure = | _unused_arg: u8 | countdown += 1; LL| | LL| | LL| 1| let short_used_covered_closure_macro = | used_arg: u8 | println!("called"); - LL| 1| let short_used_not_covered_closure_macro = | used_arg: u8 | println!("not called"); - ^0 - LL| 1| let _short_unused_closure_macro = | _unused_arg: u8 | println!("not called"); - ^0 + LL| 0| let short_used_not_covered_closure_macro = | used_arg: u8 | println!("not called"); + LL| 0| let _short_unused_closure_macro = | _unused_arg: u8 | println!("not called"); LL| | LL| | LL| | LL| | - LL| 1| let _short_unused_closure_block = | _unused_arg: u8 | { println!("not called") }; - ^0^0 ^0 + LL| 0| let _short_unused_closure_block = | _unused_arg: u8 | { println!("not called") }; LL| | - LL| 1| let _shortish_unused_closure = | _unused_arg: u8 | { - ^0 + LL| 0| let _shortish_unused_closure = | _unused_arg: u8 | { LL| 0| println!("not called") LL| 0| }; LL| | - LL| 1| let _as_short_unused_closure = | + LL| | let _as_short_unused_closure = | LL| | _unused_arg: u8 LL| 0| | { println!("not called") }; LL| | - LL| 1| let _almost_as_short_unused_closure = | + LL| | let _almost_as_short_unused_closure = | LL| | _unused_arg: u8 LL| 0| | { println!("not called") } LL| | ; @@ -167,26 +164,26 @@ LL| | LL| | LL| | - LL| 1| let _short_unused_closure_line_break_no_block = | _unused_arg: u8 | + LL| | let _short_unused_closure_line_break_no_block = | _unused_arg: u8 | LL| 0|println!("not called") LL| | ; LL| | - LL| 1| let _short_unused_closure_line_break_no_block2 = + LL| | let _short_unused_closure_line_break_no_block2 = LL| | | _unused_arg: u8 | LL| 0| println!( - LL| | "not called" + LL| 0| "not called" LL| | ) LL| | ; LL| | - LL| 1| let short_used_not_covered_closure_line_break_no_block_embedded_branch = + LL| | let short_used_not_covered_closure_line_break_no_block_embedded_branch = LL| | | _unused_arg: u8 | - LL| | println!( + LL| 0| println!( LL| | "not called: {}", LL| 0| if is_true { "check" } else { "me" } LL| | ) LL| | ; LL| | - LL| 1| let short_used_not_covered_closure_line_break_block_embedded_branch = + LL| | let short_used_not_covered_closure_line_break_block_embedded_branch = LL| | | _unused_arg: u8 | LL| 0| { LL| 0| println!( @@ -196,22 +193,22 @@ LL| 0| } LL| | ; LL| | - LL| 1| let short_used_covered_closure_line_break_no_block_embedded_branch = + LL| | let short_used_covered_closure_line_break_no_block_embedded_branch = LL| | | _unused_arg: u8 | - LL| | println!( + LL| 1| println!( LL| | "not called: {}", LL| 1| if is_true { "check" } else { "me" } - ^0 + ^0 LL| | ) LL| | ; LL| | - LL| 1| let short_used_covered_closure_line_break_block_embedded_branch = + LL| | let short_used_covered_closure_line_break_block_embedded_branch = LL| | | _unused_arg: u8 | LL| 1| { LL| 1| println!( LL| | "not called: {}", LL| 1| if is_true { "check" } else { "me" } - ^0 + ^0 LL| | ) LL| 1| } LL| | ; diff --git a/tests/coverage/closure.rs b/tests/coverage/iffy/closure.rs similarity index 99% rename from tests/coverage/closure.rs rename to tests/coverage/iffy/closure.rs index 1e433b61a6c38..4ada30efb75fe 100644 --- a/tests/coverage/closure.rs +++ b/tests/coverage/iffy/closure.rs @@ -1,5 +1,6 @@ #![allow(unused_assignments, unused_variables)] //@ compile-flags: -C opt-level=2 +//@ min-llvm-version: 23 // This test used to be sensitive to certain coverage-specific hacks in // `rustc_middle/mir/mono.rs`, but those hacks were later cleaned up by diff --git a/tests/coverage/closure_macro.cov-map b/tests/coverage/iffy/closure_macro.cov-map similarity index 58% rename from tests/coverage/closure_macro.cov-map rename to tests/coverage/iffy/closure_macro.cov-map index dd3629771085f..d10924c51102e 100644 --- a/tests/coverage/closure_macro.cov-map +++ b/tests/coverage/iffy/closure_macro.cov-map @@ -10,22 +10,19 @@ Number of file 0 mappings: 3 Highest counter ID seen: c0 Function name: closure_macro::main -Raw bytes (61): 0x[01, 01, 01, 01, 05, 0b, 01, 21, 01, 00, 24, 01, 01, 05, 00, 0d, 02, 01, 09, 00, 0f, 01, 00, 12, 00, 1b, 01, 00, 1c, 00, 34, 05, 00, 54, 00, 55, 02, 02, 09, 00, 1f, 02, 00, 22, 00, 2e, 02, 01, 0d, 00, 2d, 02, 01, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (56): 0x[01, 01, 01, 01, 05, 0a, 01, 21, 01, 00, 24, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 20, 01, 01, 12, 00, 1b, 01, 00, 1c, 00, 36, 05, 00, 54, 00, 55, 02, 02, 22, 00, 35, 02, 01, 0d, 00, 2d, 02, 01, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/closure_macro.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 11 +Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 33, 1) to (start + 0, 36) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) - = (c0 - c1) -- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 27) -- Code(Counter(0)) at (prev + 0, 28) to (start + 0, 52) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 32) +- Code(Counter(0)) at (prev + 1, 18) to (start + 0, 27) +- Code(Counter(0)) at (prev + 0, 28) to (start + 0, 54) - Code(Counter(1)) at (prev + 0, 84) to (start + 0, 85) -- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 31) - = (c0 - c1) -- Code(Expression(0, Sub)) at (prev + 0, 34) to (start + 0, 46) +- Code(Expression(0, Sub)) at (prev + 2, 34) to (start + 0, 53) = (c0 - c1) - Code(Expression(0, Sub)) at (prev + 1, 13) to (start + 0, 45) = (c0 - c1) @@ -35,19 +32,20 @@ Number of file 0 mappings: 11 Highest counter ID seen: c1 Function name: closure_macro::main::{closure#0} -Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 10, 1c, 00, 1d, 01, 02, 11, 00, 18, 01, 00, 1b, 00, 22, 01, 01, 10, 00, 21, 05, 01, 11, 00, 19, 05, 01, 11, 00, 27, 02, 02, 11, 00, 16, 02, 00, 17, 00, 1e, 01, 02, 09, 00, 0a] +Raw bytes (56): 0x[01, 01, 01, 01, 05, 0a, 01, 10, 1c, 00, 1d, 01, 02, 1b, 00, 22, 01, 00, 33, 00, 34, 01, 01, 10, 00, 21, 05, 00, 22, 03, 0e, 05, 01, 11, 00, 19, 05, 00, 20, 00, 27, 02, 03, 11, 00, 16, 02, 00, 17, 00, 1e, 01, 02, 09, 00, 0a] Number of files: 1 - file 0 => $DIR/closure_macro.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 9 +Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 16, 28) to (start + 0, 29) -- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 24) -- Code(Counter(0)) at (prev + 0, 27) to (start + 0, 34) +- Code(Counter(0)) at (prev + 2, 27) to (start + 0, 34) +- Code(Counter(0)) at (prev + 0, 51) to (start + 0, 52) - Code(Counter(0)) at (prev + 1, 16) to (start + 0, 33) +- Code(Counter(1)) at (prev + 0, 34) to (start + 3, 14) - Code(Counter(1)) at (prev + 1, 17) to (start + 0, 25) -- Code(Counter(1)) at (prev + 1, 17) to (start + 0, 39) -- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 22) +- Code(Counter(1)) at (prev + 0, 32) to (start + 0, 39) +- Code(Expression(0, Sub)) at (prev + 3, 17) to (start + 0, 22) = (c0 - c1) - Code(Expression(0, Sub)) at (prev + 0, 23) to (start + 0, 30) = (c0 - c1) diff --git a/tests/coverage/closure_macro.coverage b/tests/coverage/iffy/closure_macro.coverage similarity index 97% rename from tests/coverage/closure_macro.coverage rename to tests/coverage/iffy/closure_macro.coverage index b1d7a8327a4e1..9f71238d1c951 100644 --- a/tests/coverage/closure_macro.coverage +++ b/tests/coverage/iffy/closure_macro.coverage @@ -19,7 +19,7 @@ LL| 0| if message.len() > 0 { LL| 0| println!("{}", message); LL| 0| Ok(String::from("ok")) - LL| | } else { + LL| 0| } else { LL| 0| bail!("error"); LL| | } LL| 0| }) diff --git a/tests/coverage/closure_macro.rs b/tests/coverage/iffy/closure_macro.rs similarity index 100% rename from tests/coverage/closure_macro.rs rename to tests/coverage/iffy/closure_macro.rs diff --git a/tests/coverage/iffy/conditions.cov-map b/tests/coverage/iffy/conditions.cov-map new file mode 100644 index 0000000000000..fdbb61eca2b1d --- /dev/null +++ b/tests/coverage/iffy/conditions.cov-map @@ -0,0 +1,182 @@ +Function name: conditions::main +Raw bytes (528): 0x[01, 01, 3f, 01, 05, 09, 51, 09, 0f, 51, 55, 01, 43, 05, 09, 05, 09, 05, 09, 05, 09, 05, 09, 43, 0d, 05, 09, 11, 49, 11, 3b, 49, 4d, 43, 77, 05, 09, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 0d, 11, 77, 15, 0d, 11, 19, 41, 19, 6f, 41, 45, 77, bf, 01, 0d, 11, 15, 19, 15, 19, 15, 19, 15, 19, 15, 19, bf, 01, 1d, 15, 19, 21, 39, 21, 9f, 01, 39, 3d, bf, 01, f7, 01, 15, 19, 1d, 21, bf, 01, f7, 01, 15, 19, 1d, 21, bf, 01, f7, 01, 15, 19, 1d, 21, 1d, 21, f7, 01, 25, 1d, 21, 29, 2d, 29, ef, 01, 2d, 31, ef, 01, 35, 2d, 31, 29, eb, 01, ef, 01, 35, 2d, 31, f7, 01, fb, 01, 1d, 21, 25, 29, 49, 01, 03, 01, 00, 0a, 01, 01, 19, 00, 1a, 01, 01, 08, 00, 0c, 01, 00, 0d, 02, 06, 00, 02, 05, 00, 06, 01, 03, 10, 00, 1d, 05, 00, 1e, 03, 06, 02, 03, 0f, 00, 1c, 09, 01, 0c, 00, 19, 06, 00, 1d, 00, 2a, 0a, 00, 2e, 00, 3c, 09, 00, 3d, 02, 0a, 00, 02, 09, 00, 0a, 09, 01, 09, 00, 17, 09, 01, 09, 00, 12, 12, 01, 0c, 02, 06, 43, 04, 19, 00, 1a, 43, 01, 08, 00, 0c, 43, 00, 0d, 02, 06, 00, 02, 05, 00, 06, 43, 02, 08, 00, 15, 0d, 00, 16, 02, 06, 2a, 02, 0f, 00, 1c, 11, 01, 0c, 00, 19, 32, 00, 1d, 00, 2a, 36, 00, 2e, 00, 3c, 11, 00, 3d, 02, 0a, 00, 02, 09, 00, 0a, 11, 01, 09, 00, 17, 3e, 01, 0c, 02, 06, 77, 04, 08, 00, 0c, 77, 01, 1d, 00, 1e, 77, 01, 0c, 00, 10, 77, 00, 11, 02, 0a, 00, 02, 09, 00, 0a, 77, 02, 0c, 00, 19, 15, 00, 1a, 02, 0a, 5e, 04, 11, 00, 1e, 19, 01, 10, 00, 1d, 66, 00, 21, 00, 2e, 6a, 00, 32, 00, 40, 19, 00, 41, 02, 0e, 00, 02, 0d, 00, 0e, 19, 01, 0d, 00, 1b, 72, 01, 10, 02, 0a, 00, 03, 05, 00, 06, bf, 01, 02, 19, 00, 1a, bf, 01, 01, 08, 00, 0c, bf, 01, 00, 0d, 02, 06, 00, 02, 05, 00, 06, bf, 01, 02, 10, 00, 1d, 1d, 00, 1e, 02, 06, 8e, 01, 02, 0f, 00, 1c, 21, 01, 0c, 00, 19, 96, 01, 00, 1d, 00, 2a, 9a, 01, 00, 2e, 00, 3c, 21, 00, 3d, 02, 0a, 00, 02, 09, 00, 0a, 21, 01, 09, 00, 17, ba, 01, 01, 0c, 04, 06, ba, 01, 01, 23, 00, 2c, ba, 01, 01, 09, 00, 11, f7, 01, 04, 10, 00, 1d, 25, 00, 1e, 02, 06, ca, 01, 02, 0f, 00, 1c, 29, 01, 0c, 00, 19, d2, 01, 00, 1d, 00, 2a, d6, 01, 00, 2e, 00, 3c, eb, 01, 00, 3d, 02, 0a, e6, 01, 02, 09, 00, 0a, 29, 01, 09, 00, 17, f2, 01, 01, 0c, 02, 06, 01, 03, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/conditions.rs +Number of expressions: 63 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(2), rhs = Counter(20) +- expression 2 operands: lhs = Counter(2), rhs = Expression(3, Add) +- expression 3 operands: lhs = Counter(20), rhs = Counter(21) +- expression 4 operands: lhs = Counter(0), rhs = Expression(16, Add) +- expression 5 operands: lhs = Counter(1), rhs = Counter(2) +- expression 6 operands: lhs = Counter(1), rhs = Counter(2) +- expression 7 operands: lhs = Counter(1), rhs = Counter(2) +- expression 8 operands: lhs = Counter(1), rhs = Counter(2) +- expression 9 operands: lhs = Counter(1), rhs = Counter(2) +- expression 10 operands: lhs = Expression(16, Add), rhs = Counter(3) +- expression 11 operands: lhs = Counter(1), rhs = Counter(2) +- expression 12 operands: lhs = Counter(4), rhs = Counter(18) +- expression 13 operands: lhs = Counter(4), rhs = Expression(14, Add) +- expression 14 operands: lhs = Counter(18), rhs = Counter(19) +- expression 15 operands: lhs = Expression(16, Add), rhs = Expression(29, Add) +- expression 16 operands: lhs = Counter(1), rhs = Counter(2) +- expression 17 operands: lhs = Counter(3), rhs = Counter(4) +- expression 18 operands: lhs = Counter(3), rhs = Counter(4) +- expression 19 operands: lhs = Counter(3), rhs = Counter(4) +- expression 20 operands: lhs = Counter(3), rhs = Counter(4) +- expression 21 operands: lhs = Counter(3), rhs = Counter(4) +- expression 22 operands: lhs = Counter(3), rhs = Counter(4) +- expression 23 operands: lhs = Expression(29, Add), rhs = Counter(5) +- expression 24 operands: lhs = Counter(3), rhs = Counter(4) +- expression 25 operands: lhs = Counter(6), rhs = Counter(16) +- expression 26 operands: lhs = Counter(6), rhs = Expression(27, Add) +- expression 27 operands: lhs = Counter(16), rhs = Counter(17) +- expression 28 operands: lhs = Expression(29, Add), rhs = Expression(47, Add) +- expression 29 operands: lhs = Counter(3), rhs = Counter(4) +- expression 30 operands: lhs = Counter(5), rhs = Counter(6) +- expression 31 operands: lhs = Counter(5), rhs = Counter(6) +- expression 32 operands: lhs = Counter(5), rhs = Counter(6) +- expression 33 operands: lhs = Counter(5), rhs = Counter(6) +- expression 34 operands: lhs = Counter(5), rhs = Counter(6) +- expression 35 operands: lhs = Expression(47, Add), rhs = Counter(7) +- expression 36 operands: lhs = Counter(5), rhs = Counter(6) +- expression 37 operands: lhs = Counter(8), rhs = Counter(14) +- expression 38 operands: lhs = Counter(8), rhs = Expression(39, Add) +- expression 39 operands: lhs = Counter(14), rhs = Counter(15) +- expression 40 operands: lhs = Expression(47, Add), rhs = Expression(61, Add) +- expression 41 operands: lhs = Counter(5), rhs = Counter(6) +- expression 42 operands: lhs = Counter(7), rhs = Counter(8) +- expression 43 operands: lhs = Expression(47, Add), rhs = Expression(61, Add) +- expression 44 operands: lhs = Counter(5), rhs = Counter(6) +- expression 45 operands: lhs = Counter(7), rhs = Counter(8) +- expression 46 operands: lhs = Expression(47, Add), rhs = Expression(61, Add) +- expression 47 operands: lhs = Counter(5), rhs = Counter(6) +- expression 48 operands: lhs = Counter(7), rhs = Counter(8) +- expression 49 operands: lhs = Counter(7), rhs = Counter(8) +- expression 50 operands: lhs = Expression(61, Add), rhs = Counter(9) +- expression 51 operands: lhs = Counter(7), rhs = Counter(8) +- expression 52 operands: lhs = Counter(10), rhs = Counter(11) +- expression 53 operands: lhs = Counter(10), rhs = Expression(59, Add) +- expression 54 operands: lhs = Counter(11), rhs = Counter(12) +- expression 55 operands: lhs = Expression(59, Add), rhs = Counter(13) +- expression 56 operands: lhs = Counter(11), rhs = Counter(12) +- expression 57 operands: lhs = Counter(10), rhs = Expression(58, Add) +- expression 58 operands: lhs = Expression(59, Add), rhs = Counter(13) +- expression 59 operands: lhs = Counter(11), rhs = Counter(12) +- expression 60 operands: lhs = Expression(61, Add), rhs = Expression(62, Add) +- expression 61 operands: lhs = Counter(7), rhs = Counter(8) +- expression 62 operands: lhs = Counter(9), rhs = Counter(10) +Number of file 0 mappings: 73 +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 25) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 12) +- Code(Counter(0)) at (prev + 0, 13) to (start + 2, 6) +- Code(Zero) at (prev + 2, 5) to (start + 0, 6) +- Code(Counter(0)) at (prev + 3, 16) to (start + 0, 29) +- Code(Counter(1)) at (prev + 0, 30) to (start + 3, 6) +- Code(Expression(0, Sub)) at (prev + 3, 15) to (start + 0, 28) + = (c0 - c1) +- Code(Counter(2)) at (prev + 1, 12) to (start + 0, 25) +- Code(Expression(1, Sub)) at (prev + 0, 29) to (start + 0, 42) + = (c2 - c20) +- Code(Expression(2, Sub)) at (prev + 0, 46) to (start + 0, 60) + = (c2 - (c20 + c21)) +- Code(Counter(2)) at (prev + 0, 61) to (start + 2, 10) +- Code(Zero) at (prev + 2, 9) to (start + 0, 10) +- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 23) +- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 18) +- Code(Expression(4, Sub)) at (prev + 1, 12) to (start + 2, 6) + = (c0 - (c1 + c2)) +- Code(Expression(16, Add)) at (prev + 4, 25) to (start + 0, 26) + = (c1 + c2) +- Code(Expression(16, Add)) at (prev + 1, 8) to (start + 0, 12) + = (c1 + c2) +- Code(Expression(16, Add)) at (prev + 0, 13) to (start + 2, 6) + = (c1 + c2) +- Code(Zero) at (prev + 2, 5) to (start + 0, 6) +- Code(Expression(16, Add)) at (prev + 2, 8) to (start + 0, 21) + = (c1 + c2) +- Code(Counter(3)) at (prev + 0, 22) to (start + 2, 6) +- Code(Expression(10, Sub)) at (prev + 2, 15) to (start + 0, 28) + = ((c1 + c2) - c3) +- Code(Counter(4)) at (prev + 1, 12) to (start + 0, 25) +- Code(Expression(12, Sub)) at (prev + 0, 29) to (start + 0, 42) + = (c4 - c18) +- Code(Expression(13, Sub)) at (prev + 0, 46) to (start + 0, 60) + = (c4 - (c18 + c19)) +- Code(Counter(4)) at (prev + 0, 61) to (start + 2, 10) +- Code(Zero) at (prev + 2, 9) to (start + 0, 10) +- Code(Counter(4)) at (prev + 1, 9) to (start + 0, 23) +- Code(Expression(15, Sub)) at (prev + 1, 12) to (start + 2, 6) + = ((c1 + c2) - (c3 + c4)) +- Code(Expression(29, Add)) at (prev + 4, 8) to (start + 0, 12) + = (c3 + c4) +- Code(Expression(29, Add)) at (prev + 1, 29) to (start + 0, 30) + = (c3 + c4) +- Code(Expression(29, Add)) at (prev + 1, 12) to (start + 0, 16) + = (c3 + c4) +- Code(Expression(29, Add)) at (prev + 0, 17) to (start + 2, 10) + = (c3 + c4) +- Code(Zero) at (prev + 2, 9) to (start + 0, 10) +- Code(Expression(29, Add)) at (prev + 2, 12) to (start + 0, 25) + = (c3 + c4) +- Code(Counter(5)) at (prev + 0, 26) to (start + 2, 10) +- Code(Expression(23, Sub)) at (prev + 4, 17) to (start + 0, 30) + = ((c3 + c4) - c5) +- Code(Counter(6)) at (prev + 1, 16) to (start + 0, 29) +- Code(Expression(25, Sub)) at (prev + 0, 33) to (start + 0, 46) + = (c6 - c16) +- Code(Expression(26, Sub)) at (prev + 0, 50) to (start + 0, 64) + = (c6 - (c16 + c17)) +- Code(Counter(6)) at (prev + 0, 65) to (start + 2, 14) +- Code(Zero) at (prev + 2, 13) to (start + 0, 14) +- Code(Counter(6)) at (prev + 1, 13) to (start + 0, 27) +- Code(Expression(28, Sub)) at (prev + 1, 16) to (start + 2, 10) + = ((c3 + c4) - (c5 + c6)) +- Code(Zero) at (prev + 3, 5) to (start + 0, 6) +- Code(Expression(47, Add)) at (prev + 2, 25) to (start + 0, 26) + = (c5 + c6) +- Code(Expression(47, Add)) at (prev + 1, 8) to (start + 0, 12) + = (c5 + c6) +- Code(Expression(47, Add)) at (prev + 0, 13) to (start + 2, 6) + = (c5 + c6) +- Code(Zero) at (prev + 2, 5) to (start + 0, 6) +- Code(Expression(47, Add)) at (prev + 2, 16) to (start + 0, 29) + = (c5 + c6) +- Code(Counter(7)) at (prev + 0, 30) to (start + 2, 6) +- Code(Expression(35, Sub)) at (prev + 2, 15) to (start + 0, 28) + = ((c5 + c6) - c7) +- Code(Counter(8)) at (prev + 1, 12) to (start + 0, 25) +- Code(Expression(37, Sub)) at (prev + 0, 29) to (start + 0, 42) + = (c8 - c14) +- Code(Expression(38, Sub)) at (prev + 0, 46) to (start + 0, 60) + = (c8 - (c14 + c15)) +- Code(Counter(8)) at (prev + 0, 61) to (start + 2, 10) +- Code(Zero) at (prev + 2, 9) to (start + 0, 10) +- Code(Counter(8)) at (prev + 1, 9) to (start + 0, 23) +- Code(Expression(46, Sub)) at (prev + 1, 12) to (start + 4, 6) + = ((c5 + c6) - (c7 + c8)) +- Code(Expression(46, Sub)) at (prev + 1, 35) to (start + 0, 44) + = ((c5 + c6) - (c7 + c8)) +- Code(Expression(46, Sub)) at (prev + 1, 9) to (start + 0, 17) + = ((c5 + c6) - (c7 + c8)) +- Code(Expression(61, Add)) at (prev + 4, 16) to (start + 0, 29) + = (c7 + c8) +- Code(Counter(9)) at (prev + 0, 30) to (start + 2, 6) +- Code(Expression(50, Sub)) at (prev + 2, 15) to (start + 0, 28) + = ((c7 + c8) - c9) +- Code(Counter(10)) at (prev + 1, 12) to (start + 0, 25) +- Code(Expression(52, Sub)) at (prev + 0, 29) to (start + 0, 42) + = (c10 - c11) +- Code(Expression(53, Sub)) at (prev + 0, 46) to (start + 0, 60) + = (c10 - (c11 + c12)) +- Code(Expression(58, Add)) at (prev + 0, 61) to (start + 2, 10) + = ((c11 + c12) + c13) +- Code(Expression(57, Sub)) at (prev + 2, 9) to (start + 0, 10) + = (c10 - ((c11 + c12) + c13)) +- Code(Counter(10)) at (prev + 1, 9) to (start + 0, 23) +- Code(Expression(60, Sub)) at (prev + 1, 12) to (start + 2, 6) + = ((c7 + c8) - (c9 + c10)) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c10 + diff --git a/tests/coverage/conditions.coverage b/tests/coverage/iffy/conditions.coverage similarity index 89% rename from tests/coverage/conditions.coverage rename to tests/coverage/iffy/conditions.coverage index 83944d37c9808..9d94df0258fda 100644 --- a/tests/coverage/conditions.coverage +++ b/tests/coverage/iffy/conditions.coverage @@ -11,15 +11,16 @@ LL| 1| let x = if countdown > 7 { LL| 1| countdown -= 4; LL| 1| B - LL| 0| } else if countdown > 2 { + LL| 1| } else if countdown > 2 { + ^0 LL| 0| if countdown < 1 || countdown > 5 || countdown != 9 { LL| 0| countdown = 0; LL| 0| } LL| 0| countdown -= 5; LL| 0| countdown - LL| | } else { + LL| 0| } else { LL| 0| return; - LL| | }; + LL| 0| }; LL| | LL| 1| let mut countdown = 0; LL| 1| if true { @@ -35,9 +36,9 @@ LL| 0| countdown = 0; LL| 0| } LL| 0| countdown -= 5; - LL| | } else { + LL| 0| } else { LL| 0| return; - LL| | } + LL| 0| } LL| | LL| 1| if true { LL| 1| let mut countdown = 0; @@ -55,9 +56,9 @@ LL| 0| countdown = 0; LL| 0| } LL| 0| countdown -= 5; - LL| | } else { + LL| 0| } else { LL| 0| return; - LL| | } + LL| 0| } LL| 0| } LL| | LL| 1| let mut countdown = 0; @@ -67,18 +68,17 @@ ^0 LL| | LL| 1| let z = if countdown > 7 { - ^0 LL| 0| countdown -= 4; LL| 1| } else if countdown > 2 { LL| 0| if countdown < 1 || countdown > 5 || countdown != 9 { LL| 0| countdown = 0; LL| 0| } LL| 0| countdown -= 5; - LL| | } else { + LL| 1| } else { LL| 1| let should_be_reachable = countdown; LL| 1| println!("reached"); LL| 1| return; - LL| | }; + LL| 1| }; LL| | LL| 0| let w = if countdown > 7 { LL| 0| countdown -= 4; @@ -87,8 +87,8 @@ LL| 0| countdown = 0; LL| 0| } LL| 0| countdown -= 5; - LL| | } else { + LL| 0| } else { LL| 0| return; - LL| | }; + LL| 0| }; LL| 1|} diff --git a/tests/coverage/conditions.rs b/tests/coverage/iffy/conditions.rs similarity index 100% rename from tests/coverage/conditions.rs rename to tests/coverage/iffy/conditions.rs diff --git a/tests/coverage/continue.cov-map b/tests/coverage/iffy/continue.cov-map similarity index 67% rename from tests/coverage/continue.cov-map rename to tests/coverage/iffy/continue.cov-map index 05efd2707817a..ce4aa503782e6 100644 --- a/tests/coverage/continue.cov-map +++ b/tests/coverage/iffy/continue.cov-map @@ -1,5 +1,5 @@ Function name: continue::main -Raw bytes (241): 0x[01, 01, 1a, 05, 01, 05, 13, 01, 09, 05, 13, 01, 09, 0d, 01, 0d, 27, 01, 11, 0d, 27, 01, 11, 15, 01, 15, 33, 01, 19, 1d, 01, 1d, 47, 01, 21, 1d, 47, 01, 21, 25, 01, 25, 53, 01, 29, 25, 01, 31, 01, 63, 31, 01, 2d, 31, 01, 25, 01, 03, 01, 00, 0a, 01, 01, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 09, 00, 0e, 01, 00, 11, 00, 12, 01, 01, 0e, 00, 13, 02, 01, 0f, 00, 16, 09, 02, 11, 00, 19, 0e, 02, 12, 02, 0e, 0e, 04, 09, 00, 0e, 01, 02, 0e, 00, 13, 16, 01, 0f, 00, 16, 22, 01, 16, 02, 0e, 11, 04, 11, 00, 19, 22, 03, 09, 00, 0e, 01, 02, 0e, 00, 13, 2a, 01, 0f, 00, 16, 19, 01, 15, 02, 0e, 2e, 04, 11, 00, 19, 19, 03, 09, 00, 0e, 01, 02, 0e, 00, 13, 36, 01, 0c, 00, 13, 21, 01, 0d, 00, 15, 42, 01, 09, 00, 0a, 42, 01, 09, 00, 0e, 01, 02, 0e, 00, 13, 56, 01, 0f, 00, 16, 4e, 01, 16, 02, 0e, 29, 03, 12, 02, 0e, 56, 04, 09, 00, 0e, 01, 02, 0e, 00, 13, 2d, 01, 0f, 00, 16, 66, 01, 16, 02, 0e, 5e, 04, 11, 00, 16, 66, 03, 09, 00, 0e, 01, 02, 0d, 00, 0e, 01, 01, 01, 00, 02] +Raw bytes (231): 0x[01, 01, 1a, 05, 01, 05, 13, 01, 09, 05, 13, 01, 09, 0d, 01, 0d, 27, 01, 11, 0d, 27, 01, 11, 15, 01, 15, 33, 01, 19, 1d, 01, 1d, 47, 01, 21, 1d, 47, 01, 21, 25, 01, 25, 53, 01, 29, 25, 01, 31, 01, 63, 31, 01, 2d, 31, 01, 23, 01, 03, 01, 00, 0a, 01, 01, 13, 00, 2e, 01, 02, 11, 00, 12, 01, 01, 0e, 00, 13, 02, 01, 0f, 00, 16, 09, 01, 15, 02, 0e, 0e, 03, 12, 02, 0e, 0e, 04, 09, 00, 0e, 01, 02, 0e, 00, 13, 16, 01, 0f, 00, 16, 22, 01, 16, 02, 0e, 11, 03, 12, 02, 0e, 22, 04, 09, 00, 0e, 01, 02, 0e, 00, 13, 2a, 01, 0f, 00, 16, 19, 01, 15, 02, 0e, 2e, 03, 12, 02, 0e, 19, 04, 09, 00, 0e, 01, 02, 0e, 00, 13, 36, 01, 0c, 00, 13, 21, 00, 14, 02, 0a, 42, 02, 09, 00, 0a, 42, 01, 09, 00, 0e, 01, 02, 0e, 00, 13, 56, 01, 0f, 00, 16, 4e, 01, 16, 02, 0e, 29, 03, 12, 02, 0e, 56, 04, 09, 00, 0e, 01, 02, 0e, 00, 13, 2d, 01, 0f, 00, 16, 66, 01, 16, 02, 0e, 5e, 03, 12, 02, 0e, 66, 04, 09, 00, 0e, 01, 02, 0d, 00, 0e, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/continue.rs Number of expressions: 26 @@ -29,17 +29,15 @@ Number of expressions: 26 - expression 23 operands: lhs = Expression(24, Add), rhs = Counter(12) - expression 24 operands: lhs = Counter(0), rhs = Counter(11) - expression 25 operands: lhs = Counter(12), rhs = Counter(0) -Number of file 0 mappings: 37 +Number of file 0 mappings: 35 - Code(Counter(0)) at (prev + 3, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 2, 17) to (start + 0, 18) - Code(Counter(0)) at (prev + 1, 14) to (start + 0, 19) - Code(Expression(0, Sub)) at (prev + 1, 15) to (start + 0, 22) = (c1 - c0) -- Code(Counter(2)) at (prev + 2, 17) to (start + 0, 25) -- Code(Expression(3, Sub)) at (prev + 2, 18) to (start + 2, 14) +- Code(Counter(2)) at (prev + 1, 21) to (start + 2, 14) +- Code(Expression(3, Sub)) at (prev + 3, 18) to (start + 2, 14) = (c1 - (c0 + c2)) - Code(Expression(3, Sub)) at (prev + 4, 9) to (start + 0, 14) = (c1 - (c0 + c2)) @@ -48,21 +46,21 @@ Number of file 0 mappings: 37 = (c3 - c0) - Code(Expression(8, Sub)) at (prev + 1, 22) to (start + 2, 14) = (c3 - (c0 + c4)) -- Code(Counter(4)) at (prev + 4, 17) to (start + 0, 25) -- Code(Expression(8, Sub)) at (prev + 3, 9) to (start + 0, 14) +- Code(Counter(4)) at (prev + 3, 18) to (start + 2, 14) +- Code(Expression(8, Sub)) at (prev + 4, 9) to (start + 0, 14) = (c3 - (c0 + c4)) - Code(Counter(0)) at (prev + 2, 14) to (start + 0, 19) - Code(Expression(10, Sub)) at (prev + 1, 15) to (start + 0, 22) = (c5 - c0) - Code(Counter(6)) at (prev + 1, 21) to (start + 2, 14) -- Code(Expression(11, Sub)) at (prev + 4, 17) to (start + 0, 25) +- Code(Expression(11, Sub)) at (prev + 3, 18) to (start + 2, 14) = (c5 - (c0 + c6)) -- Code(Counter(6)) at (prev + 3, 9) to (start + 0, 14) +- Code(Counter(6)) at (prev + 4, 9) to (start + 0, 14) - Code(Counter(0)) at (prev + 2, 14) to (start + 0, 19) - Code(Expression(13, Sub)) at (prev + 1, 12) to (start + 0, 19) = (c7 - c0) -- Code(Counter(8)) at (prev + 1, 13) to (start + 0, 21) -- Code(Expression(16, Sub)) at (prev + 1, 9) to (start + 0, 10) +- Code(Counter(8)) at (prev + 0, 20) to (start + 2, 10) +- Code(Expression(16, Sub)) at (prev + 2, 9) to (start + 0, 10) = (c7 - (c0 + c8)) - Code(Expression(16, Sub)) at (prev + 1, 9) to (start + 0, 14) = (c7 - (c0 + c8)) @@ -78,9 +76,9 @@ Number of file 0 mappings: 37 - Code(Counter(11)) at (prev + 1, 15) to (start + 0, 22) - Code(Expression(25, Sub)) at (prev + 1, 22) to (start + 2, 14) = (c12 - c0) -- Code(Expression(23, Sub)) at (prev + 4, 17) to (start + 0, 22) +- Code(Expression(23, Sub)) at (prev + 3, 18) to (start + 2, 14) = ((c0 + c11) - c12) -- Code(Expression(25, Sub)) at (prev + 3, 9) to (start + 0, 14) +- Code(Expression(25, Sub)) at (prev + 4, 9) to (start + 0, 14) = (c12 - c0) - Code(Counter(0)) at (prev + 2, 13) to (start + 0, 14) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) diff --git a/tests/coverage/continue.coverage b/tests/coverage/iffy/continue.coverage similarity index 86% rename from tests/coverage/continue.coverage rename to tests/coverage/iffy/continue.coverage index 310701a1543cb..df3b2de70edba 100644 --- a/tests/coverage/continue.coverage +++ b/tests/coverage/iffy/continue.coverage @@ -6,9 +6,9 @@ LL| 1| let mut x = 0; LL| 1| for _ in 0..10 { LL| 10| match is_true { - LL| | true => { + LL| 10| true => { LL| 10| continue; - LL| | } + LL| 10| } LL| 0| _ => { LL| 0| x = 1; LL| 0| } @@ -20,9 +20,9 @@ LL| 0| false => { LL| 0| x = 1; LL| 0| } - LL| | _ => { + LL| 10| _ => { LL| 10| continue; - LL| | } + LL| 10| } LL| | } LL| 0| x = 3; LL| | } @@ -31,16 +31,17 @@ LL| 10| true => { LL| 10| x = 1; LL| 10| } - LL| | _ => { + LL| 0| _ => { LL| 0| continue; - LL| | } + LL| 0| } LL| | } LL| 10| x = 3; LL| | } LL| 1| for _ in 0..10 { LL| 10| if is_true { LL| 10| continue; - LL| 0| } + LL| 10| } + ^0 LL| 0| x = 3; LL| | } LL| 1| for _ in 0..10 { @@ -59,9 +60,9 @@ LL| 0| false => { LL| 0| x = 1; LL| 0| } - LL| | _ => { + LL| 1| _ => { LL| 1| break; - LL| | } + LL| 1| } LL| | } LL| 0| x = 3; LL| | } diff --git a/tests/coverage/continue.rs b/tests/coverage/iffy/continue.rs similarity index 100% rename from tests/coverage/continue.rs rename to tests/coverage/iffy/continue.rs diff --git a/tests/coverage/coroutine.cov-map b/tests/coverage/iffy/coroutine.cov-map similarity index 50% rename from tests/coverage/coroutine.cov-map rename to tests/coverage/iffy/coroutine.cov-map index 9599af9f0ab2c..4cc93b638cbe0 100644 --- a/tests/coverage/coroutine.cov-map +++ b/tests/coverage/iffy/coroutine.cov-map @@ -1,5 +1,5 @@ Function name: coroutine::get_u32 -Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 0c, 01, 00, 2d, 01, 01, 08, 00, 0b, 05, 01, 09, 00, 0e, 02, 02, 09, 00, 28, 01, 02, 01, 00, 02] +Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 0c, 01, 00, 2d, 01, 01, 08, 00, 0b, 05, 00, 0c, 02, 06, 02, 02, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/coroutine.rs Number of expressions: 1 @@ -7,50 +7,42 @@ Number of expressions: 1 Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 12, 1) to (start + 0, 45) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 11) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 14) -- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 40) +- Code(Counter(1)) at (prev + 0, 12) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 2, 6) = (c0 - c1) -- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) Highest counter ID seen: c1 Function name: coroutine::main -Raw bytes (93): 0x[01, 01, 02, 01, 05, 05, 09, 11, 01, 14, 01, 00, 0a, 01, 01, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 16, 01, 06, 0b, 00, 13, 01, 00, 14, 00, 22, 01, 00, 24, 00, 2a, 01, 00, 2b, 00, 2d, 05, 01, 2b, 00, 2d, 02, 01, 0e, 00, 14, 05, 02, 0b, 00, 2e, 05, 00, 0b, 00, 13, 05, 00, 14, 00, 22, 0d, 01, 22, 00, 27, 09, 00, 2c, 00, 2e, 06, 01, 0e, 00, 14, 09, 02, 01, 00, 02] +Raw bytes (53): 0x[01, 01, 02, 01, 05, 05, 09, 09, 01, 14, 01, 00, 0a, 01, 01, 13, 00, 2e, 01, 07, 0b, 00, 2e, 05, 01, 2b, 00, 2d, 02, 01, 0e, 00, 14, 05, 02, 0b, 00, 2e, 09, 01, 2c, 00, 2e, 06, 01, 0e, 00, 14, 09, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/coroutine.rs Number of expressions: 2 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) - expression 1 operands: lhs = Counter(1), rhs = Counter(2) -Number of file 0 mappings: 17 +Number of file 0 mappings: 9 - Code(Counter(0)) at (prev + 20, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 6, 11) to (start + 0, 19) -- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 34) -- Code(Counter(0)) at (prev + 0, 36) to (start + 0, 42) -- Code(Counter(0)) at (prev + 0, 43) to (start + 0, 45) +- Code(Counter(0)) at (prev + 1, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 7, 11) to (start + 0, 46) - Code(Counter(1)) at (prev + 1, 43) to (start + 0, 45) - Code(Expression(0, Sub)) at (prev + 1, 14) to (start + 0, 20) = (c0 - c1) - Code(Counter(1)) at (prev + 2, 11) to (start + 0, 46) -- Code(Counter(1)) at (prev + 0, 11) to (start + 0, 19) -- Code(Counter(1)) at (prev + 0, 20) to (start + 0, 34) -- Code(Counter(3)) at (prev + 1, 34) to (start + 0, 39) -- Code(Counter(2)) at (prev + 0, 44) to (start + 0, 46) +- Code(Counter(2)) at (prev + 1, 44) to (start + 0, 46) - Code(Expression(1, Sub)) at (prev + 1, 14) to (start + 0, 20) = (c1 - c2) - Code(Counter(2)) at (prev + 2, 1) to (start + 0, 2) -Highest counter ID seen: c3 +Highest counter ID seen: c2 Function name: coroutine::main::{closure#0} -Raw bytes (24): 0x[01, 01, 00, 04, 01, 17, 08, 00, 09, 01, 01, 09, 00, 1f, 05, 01, 10, 00, 15, 05, 01, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 17, 08, 00, 09, 01, 01, 09, 00, 1f, 05, 01, 09, 00, 15, 05, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/coroutine.rs Number of expressions: 0 Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 23, 8) to (start + 0, 9) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 31) -- Code(Counter(1)) at (prev + 1, 16) to (start + 0, 21) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 21) - Code(Counter(1)) at (prev + 1, 5) to (start + 0, 6) Highest counter ID seen: c1 diff --git a/tests/coverage/coroutine.coverage b/tests/coverage/iffy/coroutine.coverage similarity index 94% rename from tests/coverage/coroutine.coverage rename to tests/coverage/iffy/coroutine.coverage index 02fc91bcf5863..ecbdfb145e3bf 100644 --- a/tests/coverage/coroutine.coverage +++ b/tests/coverage/iffy/coroutine.coverage @@ -12,14 +12,14 @@ LL| 1|fn get_u32(val: bool) -> Result { LL| 1| if val { LL| 1| Ok(1) // - LL| | } else { + LL| 1| } else { LL| 0| Err(String::from("some error")) // - LL| | } + LL| 0| } LL| 1|} LL| | LL| 1|fn main() { LL| 1| let is_true = std::env::args().len() == 1; - LL| 1| let mut coroutine = #[coroutine] + LL| | let mut coroutine = #[coroutine] LL| 1| || { LL| 1| yield get_u32(is_true); LL| 1| return "foo"; diff --git a/tests/coverage/coroutine.rs b/tests/coverage/iffy/coroutine.rs similarity index 100% rename from tests/coverage/coroutine.rs rename to tests/coverage/iffy/coroutine.rs diff --git a/tests/coverage/drop_trait.cov-map b/tests/coverage/iffy/drop_trait.cov-map similarity index 51% rename from tests/coverage/drop_trait.cov-map rename to tests/coverage/iffy/drop_trait.cov-map index b4a1499d5f95f..3c78a4403d0fb 100644 --- a/tests/coverage/drop_trait.cov-map +++ b/tests/coverage/iffy/drop_trait.cov-map @@ -1,29 +1,28 @@ Function name: ::drop -Raw bytes (19): 0x[01, 01, 00, 03, 01, 09, 05, 00, 17, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 09, 05, 00, 17, 01, 01, 09, 00, 11, 01, 00, 26, 00, 33, 01, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/drop_trait.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 9, 5) to (start + 0, 23) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) +- Code(Counter(0)) at (prev + 0, 38) to (start + 0, 51) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) Highest counter ID seen: c0 Function name: drop_trait::main -Raw bytes (64): 0x[01, 01, 00, 0c, 01, 0e, 01, 00, 1c, 01, 01, 09, 00, 15, 01, 00, 18, 00, 30, 01, 02, 09, 00, 0d, 01, 00, 10, 00, 2a, 01, 02, 08, 00, 0c, 01, 01, 09, 00, 11, 01, 01, 10, 00, 16, 00, 01, 05, 00, 06, 00, 02, 0d, 00, 28, 00, 02, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (54): 0x[01, 01, 00, 0a, 01, 0e, 01, 00, 1c, 01, 01, 18, 00, 30, 01, 02, 10, 00, 2a, 01, 02, 08, 00, 0c, 01, 00, 0d, 03, 06, 01, 01, 09, 00, 11, 00, 02, 05, 00, 06, 00, 02, 0d, 00, 28, 00, 02, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/drop_trait.rs Number of expressions: 0 -Number of file 0 mappings: 12 +Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 14, 1) to (start + 0, 28) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 21) -- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 48) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 13) -- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 42) +- Code(Counter(0)) at (prev + 1, 24) to (start + 0, 48) +- Code(Counter(0)) at (prev + 2, 16) to (start + 0, 42) - Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12) +- Code(Counter(0)) at (prev + 0, 13) to (start + 3, 6) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 1, 16) to (start + 0, 22) -- Code(Zero) at (prev + 1, 5) to (start + 0, 6) +- Code(Zero) at (prev + 2, 5) to (start + 0, 6) - Code(Zero) at (prev + 2, 13) to (start + 0, 40) - Code(Zero) at (prev + 2, 5) to (start + 0, 11) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) diff --git a/tests/coverage/drop_trait.coverage b/tests/coverage/iffy/drop_trait.coverage similarity index 96% rename from tests/coverage/drop_trait.coverage rename to tests/coverage/iffy/drop_trait.coverage index 10ed8c0f154f0..f6d2305d2b52f 100644 --- a/tests/coverage/drop_trait.coverage +++ b/tests/coverage/iffy/drop_trait.coverage @@ -19,7 +19,8 @@ LL| 1| if true { LL| 1| println!("Exiting with error..."); LL| 1| return Err(1); - LL| 0| } + LL| 1| } + ^0 LL| | LL| 0| let _ = Firework { strength: 1000 }; LL| | diff --git a/tests/coverage/drop_trait.rs b/tests/coverage/iffy/drop_trait.rs similarity index 100% rename from tests/coverage/drop_trait.rs rename to tests/coverage/iffy/drop_trait.rs diff --git a/tests/coverage/generics.cov-map b/tests/coverage/iffy/generics.cov-map similarity index 60% rename from tests/coverage/generics.cov-map rename to tests/coverage/iffy/generics.cov-map index 0d9cf9a1449b3..6663fc539492a 100644 --- a/tests/coverage/generics.cov-map +++ b/tests/coverage/iffy/generics.cov-map @@ -1,11 +1,12 @@ Function name: as core::ops::drop::Drop>::drop -Raw bytes (19): 0x[01, 01, 00, 03, 01, 11, 05, 00, 17, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 11, 05, 00, 17, 01, 01, 09, 00, 11, 01, 00, 26, 00, 33, 01, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/generics.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 17, 5) to (start + 0, 23) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) +- Code(Counter(0)) at (prev + 0, 38) to (start + 0, 51) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) Highest counter ID seen: c0 @@ -21,13 +22,14 @@ Number of file 0 mappings: 3 Highest counter ID seen: c0 Function name: as core::ops::drop::Drop>::drop -Raw bytes (19): 0x[01, 01, 00, 03, 01, 11, 05, 00, 17, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 11, 05, 00, 17, 01, 01, 09, 00, 11, 01, 00, 26, 00, 33, 01, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/generics.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 17, 5) to (start + 0, 23) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) +- Code(Counter(0)) at (prev + 0, 38) to (start + 0, 51) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) Highest counter ID seen: c0 @@ -43,26 +45,21 @@ Number of file 0 mappings: 3 Highest counter ID seen: c0 Function name: generics::main -Raw bytes (94): 0x[01, 01, 00, 12, 01, 16, 01, 00, 1c, 01, 01, 09, 00, 18, 01, 00, 1b, 00, 33, 01, 01, 05, 00, 10, 01, 00, 11, 00, 1d, 01, 02, 09, 00, 10, 01, 00, 13, 00, 2f, 01, 01, 05, 00, 08, 01, 00, 09, 00, 15, 01, 01, 05, 00, 08, 01, 00, 09, 00, 15, 01, 02, 08, 00, 0c, 01, 01, 09, 00, 11, 01, 01, 10, 00, 16, 00, 01, 05, 00, 06, 00, 02, 0d, 00, 28, 00, 02, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (69): 0x[01, 01, 00, 0d, 01, 16, 01, 00, 1c, 01, 01, 1b, 00, 33, 01, 01, 05, 00, 20, 01, 02, 13, 00, 2f, 01, 01, 05, 00, 1c, 01, 01, 05, 00, 1c, 01, 02, 08, 00, 0c, 01, 00, 0d, 03, 06, 01, 01, 09, 00, 11, 00, 02, 05, 00, 06, 00, 02, 0d, 00, 28, 00, 02, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/generics.rs Number of expressions: 0 -Number of file 0 mappings: 18 +Number of file 0 mappings: 13 - Code(Counter(0)) at (prev + 22, 1) to (start + 0, 28) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 24) -- Code(Counter(0)) at (prev + 0, 27) to (start + 0, 51) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 29) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 47) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 8) -- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 21) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 8) -- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 21) +- Code(Counter(0)) at (prev + 1, 27) to (start + 0, 51) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 32) +- Code(Counter(0)) at (prev + 2, 19) to (start + 0, 47) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 28) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 28) - Code(Counter(0)) at (prev + 2, 8) to (start + 0, 12) +- Code(Counter(0)) at (prev + 0, 13) to (start + 3, 6) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 1, 16) to (start + 0, 22) -- Code(Zero) at (prev + 1, 5) to (start + 0, 6) +- Code(Zero) at (prev + 2, 5) to (start + 0, 6) - Code(Zero) at (prev + 2, 13) to (start + 0, 40) - Code(Zero) at (prev + 2, 5) to (start + 0, 11) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) diff --git a/tests/coverage/generics.coverage b/tests/coverage/iffy/generics.coverage similarity index 98% rename from tests/coverage/generics.coverage rename to tests/coverage/iffy/generics.coverage index 43697cacb9a51..5664c6ee4d7e7 100644 --- a/tests/coverage/generics.coverage +++ b/tests/coverage/iffy/generics.coverage @@ -52,7 +52,8 @@ LL| 1| if true { LL| 1| println!("Exiting with error..."); LL| 1| return Err(1); - LL| 0| } + LL| 1| } + ^0 LL| | LL| 0| let _ = Firework { strength: 1000 }; LL| | diff --git a/tests/coverage/generics.rs b/tests/coverage/iffy/generics.rs similarity index 100% rename from tests/coverage/generics.rs rename to tests/coverage/iffy/generics.rs diff --git a/tests/coverage/if.cov-map b/tests/coverage/iffy/if.cov-map similarity index 50% rename from tests/coverage/if.cov-map rename to tests/coverage/iffy/if.cov-map index 044c0f2ba0894..90f9f43b1f2b8 100644 --- a/tests/coverage/if.cov-map +++ b/tests/coverage/iffy/if.cov-map @@ -1,15 +1,13 @@ Function name: if::main -Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 04, 01, 00, 0a, 01, 05, 05, 00, 0c, 01, 02, 09, 02, 0a, 01, 05, 09, 01, 0e, 01, 03, 09, 00, 0a, 01, 03, 09, 00, 10, 05, 01, 05, 05, 06, 02, 05, 05, 00, 06, 01, 01, 01, 00, 02] +Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 04, 01, 00, 0a, 01, 07, 09, 02, 0a, 01, 08, 09, 00, 0a, 01, 03, 09, 00, 10, 05, 01, 05, 05, 06, 02, 05, 05, 00, 06, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/if.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 9 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 5, 5) to (start + 0, 12) -- Code(Counter(0)) at (prev + 2, 9) to (start + 2, 10) -- Code(Counter(0)) at (prev + 5, 9) to (start + 1, 14) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 10) +- Code(Counter(0)) at (prev + 7, 9) to (start + 2, 10) +- Code(Counter(0)) at (prev + 8, 9) to (start + 0, 10) - Code(Counter(0)) at (prev + 3, 9) to (start + 0, 16) - Code(Counter(1)) at (prev + 1, 5) to (start + 5, 6) - Code(Expression(0, Sub)) at (prev + 5, 5) to (start + 0, 6) diff --git a/tests/coverage/if.coverage b/tests/coverage/iffy/if.coverage similarity index 91% rename from tests/coverage/if.coverage rename to tests/coverage/iffy/if.coverage index c3c8a1bf38a48..c3105ede2a882 100644 --- a/tests/coverage/if.coverage +++ b/tests/coverage/iffy/if.coverage @@ -6,15 +6,15 @@ LL| | // rustc and LLVM cannot optimize out statements (or coverage counters) downstream from LL| | // dependent conditions. LL| | let - LL| 1| is_true + LL| | is_true LL| | = LL| 1| std::env::args().len() LL| 1| == LL| 1| 1 LL| | ; LL| | let - LL| 1| mut - LL| 1| countdown + LL| | mut + LL| | countdown LL| | = LL| 1| 0 LL| | ; diff --git a/tests/coverage/if.rs b/tests/coverage/iffy/if.rs similarity index 100% rename from tests/coverage/if.rs rename to tests/coverage/iffy/if.rs diff --git a/tests/coverage/iffy/if_else.cov-map b/tests/coverage/iffy/if_else.cov-map new file mode 100644 index 0000000000000..794024e8424ab --- /dev/null +++ b/tests/coverage/iffy/if_else.cov-map @@ -0,0 +1,22 @@ +Function name: if_else::main +Raw bytes (58): 0x[01, 01, 02, 01, 05, 01, 09, 0a, 01, 04, 01, 00, 0a, 01, 04, 13, 00, 2e, 01, 02, 19, 00, 1a, 01, 02, 09, 00, 10, 05, 01, 05, 05, 06, 02, 07, 05, 04, 06, 01, 07, 09, 00, 10, 09, 01, 05, 05, 06, 06, 07, 05, 05, 06, 01, 06, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/if_else.rs +Number of expressions: 2 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Counter(2) +Number of file 0 mappings: 10 +- Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 4, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 2, 25) to (start + 0, 26) +- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 16) +- Code(Counter(1)) at (prev + 1, 5) to (start + 5, 6) +- Code(Expression(0, Sub)) at (prev + 7, 5) to (start + 4, 6) + = (c0 - c1) +- Code(Counter(0)) at (prev + 7, 9) to (start + 0, 16) +- Code(Counter(2)) at (prev + 1, 5) to (start + 5, 6) +- Code(Expression(1, Sub)) at (prev + 7, 5) to (start + 5, 6) + = (c0 - c2) +- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 2) +Highest counter ID seen: c2 + diff --git a/tests/coverage/if_else.coverage b/tests/coverage/iffy/if_else.coverage similarity index 96% rename from tests/coverage/if_else.coverage rename to tests/coverage/iffy/if_else.coverage index 148e2b1951739..9c4278443c176 100644 --- a/tests/coverage/if_else.coverage +++ b/tests/coverage/iffy/if_else.coverage @@ -17,11 +17,11 @@ LL| 1| ; LL| 1| } LL| | else // Note coverage region difference without semicolon - LL| | { + LL| 0| { LL| 0| countdown LL| 0| = LL| 0| 100 - LL| | } + LL| 0| } LL| | LL| | if LL| 1| is_true diff --git a/tests/coverage/if_else.rs b/tests/coverage/iffy/if_else.rs similarity index 100% rename from tests/coverage/if_else.rs rename to tests/coverage/iffy/if_else.rs diff --git a/tests/coverage/inline-dead.cov-map b/tests/coverage/iffy/inline-dead.cov-map similarity index 73% rename from tests/coverage/inline-dead.cov-map rename to tests/coverage/iffy/inline-dead.cov-map index c461b3a6eedcc..e2f0a9d4229f4 100644 --- a/tests/coverage/inline-dead.cov-map +++ b/tests/coverage/iffy/inline-dead.cov-map @@ -10,7 +10,7 @@ Number of file 0 mappings: 3 Highest counter ID seen: (none) Function name: inline_dead::live:: -Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 0e, 01, 00, 20, 01, 01, 08, 00, 09, 05, 01, 09, 00, 0d, 02, 02, 09, 00, 0a, 01, 02, 01, 00, 02] +Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 0e, 01, 00, 20, 01, 01, 08, 00, 09, 05, 00, 0a, 02, 06, 02, 02, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/inline-dead.rs Number of expressions: 1 @@ -18,23 +18,22 @@ Number of expressions: 1 Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 14, 1) to (start + 0, 32) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 9) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 13) -- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10) +- Code(Counter(1)) at (prev + 0, 10) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 2, 6) = (c0 - c1) -- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) Highest counter ID seen: c1 Function name: inline_dead::main -Raw bytes (34): 0x[01, 01, 00, 06, 01, 04, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 00, 14, 00, 21, 01, 02, 09, 00, 0a, 01, 03, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 04, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 00, 14, 00, 23, 01, 05, 05, 00, 0d, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/inline-dead.rs Number of expressions: 0 -Number of file 0 mappings: 6 +Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 33) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 35) +- Code(Counter(0)) at (prev + 5, 5) to (start + 0, 13) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/inline-dead.coverage b/tests/coverage/iffy/inline-dead.coverage similarity index 93% rename from tests/coverage/inline-dead.coverage rename to tests/coverage/iffy/inline-dead.coverage index d75aaf300623b..95e61a108cab7 100644 --- a/tests/coverage/inline-dead.coverage +++ b/tests/coverage/iffy/inline-dead.coverage @@ -15,9 +15,9 @@ LL| 1|fn live() -> u32 { LL| 1| if B { LL| 0| dead() // - LL| | } else { + LL| 1| } else { LL| 1| 0 - LL| | } + LL| 1| } LL| 1|} LL| | LL| |#[inline] diff --git a/tests/coverage/inline-dead.rs b/tests/coverage/iffy/inline-dead.rs similarity index 100% rename from tests/coverage/inline-dead.rs rename to tests/coverage/iffy/inline-dead.rs diff --git a/tests/coverage/iffy/inline.cov-map b/tests/coverage/iffy/inline.cov-map new file mode 100644 index 0000000000000..4274e70b1e20f --- /dev/null +++ b/tests/coverage/iffy/inline.cov-map @@ -0,0 +1,124 @@ +Function name: inline::display:: +Raw bytes (31): 0x[01, 01, 01, 05, 01, 05, 01, 2a, 01, 00, 21, 01, 01, 0e, 00, 10, 02, 00, 11, 02, 06, 01, 03, 05, 00, 0d, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/inline.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +Number of file 0 mappings: 5 +- Code(Counter(0)) at (prev + 42, 1) to (start + 0, 33) +- Code(Counter(0)) at (prev + 1, 14) to (start + 0, 16) +- Code(Expression(0, Sub)) at (prev + 0, 17) to (start + 2, 6) + = (c1 - c0) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + +Function name: inline::error +Raw bytes (14): 0x[01, 01, 00, 02, 01, 32, 01, 00, 0b, 01, 01, 05, 00, 0b] +Number of files: 1 +- file 0 => $DIR/inline.rs +Number of expressions: 0 +Number of file 0 mappings: 2 +- Code(Counter(0)) at (prev + 50, 1) to (start + 0, 11) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) +Highest counter ID seen: c0 + +Function name: inline::length:: +Raw bytes (19): 0x[01, 01, 00, 03, 01, 1f, 01, 00, 20, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/inline.rs +Number of expressions: 0 +Number of file 0 mappings: 3 +- Code(Counter(0)) at (prev + 31, 1) to (start + 0, 32) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + +Function name: inline::main +Raw bytes (29): 0x[01, 01, 00, 05, 01, 06, 01, 00, 0a, 01, 01, 05, 00, 23, 01, 00, 05, 00, 11, 01, 00, 14, 00, 17, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/inline.rs +Number of expressions: 0 +Number of file 0 mappings: 5 +- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 35) +- Code(Counter(0)) at (prev + 0, 5) to (start + 0, 17) +- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 23) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + +Function name: inline::permutate:: +Raw bytes (113): 0x[01, 01, 0c, 01, 05, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 01, 2f, 05, 09, 11, 01, 10, 01, 00, 38, 01, 01, 0d, 00, 17, 01, 01, 08, 00, 0e, 05, 00, 0f, 02, 06, 02, 02, 0f, 00, 14, 09, 01, 12, 00, 16, 26, 00, 17, 04, 0a, 26, 01, 0d, 00, 1b, 26, 00, 0d, 00, 11, 26, 00, 12, 00, 14, 26, 01, 0d, 00, 21, 26, 00, 0d, 00, 16, 26, 00, 17, 00, 19, 26, 01, 0d, 00, 11, 26, 00, 12, 00, 14, 2a, 02, 0c, 02, 06, 01, 03, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/inline.rs +Number of expressions: 12 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(3), rhs = Counter(2) +- expression 2 operands: lhs = Counter(3), rhs = Counter(2) +- expression 3 operands: lhs = Counter(3), rhs = Counter(2) +- expression 4 operands: lhs = Counter(3), rhs = Counter(2) +- expression 5 operands: lhs = Counter(3), rhs = Counter(2) +- expression 6 operands: lhs = Counter(3), rhs = Counter(2) +- expression 7 operands: lhs = Counter(3), rhs = Counter(2) +- expression 8 operands: lhs = Counter(3), rhs = Counter(2) +- expression 9 operands: lhs = Counter(3), rhs = Counter(2) +- expression 10 operands: lhs = Counter(0), rhs = Expression(11, Add) +- expression 11 operands: lhs = Counter(1), rhs = Counter(2) +Number of file 0 mappings: 17 +- Code(Counter(0)) at (prev + 16, 1) to (start + 0, 56) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 23) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 14) +- Code(Counter(1)) at (prev + 0, 15) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 2, 15) to (start + 0, 20) + = (c0 - c1) +- Code(Counter(2)) at (prev + 1, 18) to (start + 0, 22) +- Code(Expression(9, Sub)) at (prev + 0, 23) to (start + 4, 10) + = (c3 - c2) +- Code(Expression(9, Sub)) at (prev + 1, 13) to (start + 0, 27) + = (c3 - c2) +- Code(Expression(9, Sub)) at (prev + 0, 13) to (start + 0, 17) + = (c3 - c2) +- Code(Expression(9, Sub)) at (prev + 0, 18) to (start + 0, 20) + = (c3 - c2) +- Code(Expression(9, Sub)) at (prev + 1, 13) to (start + 0, 33) + = (c3 - c2) +- Code(Expression(9, Sub)) at (prev + 0, 13) to (start + 0, 22) + = (c3 - c2) +- Code(Expression(9, Sub)) at (prev + 0, 23) to (start + 0, 25) + = (c3 - c2) +- Code(Expression(9, Sub)) at (prev + 1, 13) to (start + 0, 17) + = (c3 - c2) +- Code(Expression(9, Sub)) at (prev + 0, 18) to (start + 0, 20) + = (c3 - c2) +- Code(Expression(10, Sub)) at (prev + 2, 12) to (start + 2, 6) + = (c0 - (c1 + c2)) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c2 + +Function name: inline::permutations:: +Raw bytes (29): 0x[01, 01, 00, 05, 01, 0b, 01, 00, 2d, 01, 01, 12, 00, 1f, 01, 01, 05, 00, 1a, 01, 00, 05, 00, 0e, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/inline.rs +Number of expressions: 0 +Number of file 0 mappings: 5 +- Code(Counter(0)) at (prev + 11, 1) to (start + 0, 45) +- Code(Counter(0)) at (prev + 1, 18) to (start + 0, 31) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 0, 5) to (start + 0, 14) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + +Function name: inline::swap:: +Raw bytes (34): 0x[01, 01, 00, 06, 01, 24, 01, 00, 33, 01, 01, 0d, 00, 12, 01, 01, 05, 00, 12, 01, 00, 05, 00, 0a, 01, 01, 05, 00, 0e, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/inline.rs +Number of expressions: 0 +Number of file 0 mappings: 6 +- Code(Counter(0)) at (prev + 36, 1) to (start + 0, 51) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 0, 5) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/inline.coverage b/tests/coverage/iffy/inline.coverage similarity index 97% rename from tests/coverage/inline.coverage rename to tests/coverage/iffy/inline.coverage index 190d5a3a22b1f..f6ec2e086fc5b 100644 --- a/tests/coverage/inline.coverage +++ b/tests/coverage/iffy/inline.coverage @@ -1,4 +1,5 @@ LL| |//@ compile-flags: -Zinline-mir + LL| |//@ min-llvm-version: 23 LL| | LL| |use std::fmt::Display; LL| | diff --git a/tests/coverage/inline.rs b/tests/coverage/iffy/inline.rs similarity index 97% rename from tests/coverage/inline.rs rename to tests/coverage/iffy/inline.rs index 04a308ea5dd96..2defc0a68626f 100644 --- a/tests/coverage/inline.rs +++ b/tests/coverage/iffy/inline.rs @@ -1,4 +1,5 @@ //@ compile-flags: -Zinline-mir +//@ min-llvm-version: 23 use std::fmt::Display; diff --git a/tests/coverage/iffy/inner_items.cov-map b/tests/coverage/iffy/inner_items.cov-map new file mode 100644 index 0000000000000..000a3d6764912 --- /dev/null +++ b/tests/coverage/iffy/inner_items.cov-map @@ -0,0 +1,62 @@ +Function name: ::default_trait_func +Raw bytes (24): 0x[01, 01, 00, 04, 01, 21, 09, 00, 29, 01, 01, 0d, 00, 1e, 01, 01, 0d, 00, 26, 01, 01, 09, 00, 0a] +Number of files: 1 +- file 0 => $DIR/inner_items.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 33, 9) to (start + 0, 41) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 38) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) +Highest counter ID seen: c0 + +Function name: ::trait_func +Raw bytes (24): 0x[01, 01, 00, 04, 01, 28, 09, 00, 2c, 01, 01, 0d, 00, 29, 01, 01, 0d, 00, 2a, 01, 01, 09, 00, 0a] +Number of files: 1 +- file 0 => $DIR/inner_items.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 40, 9) to (start + 0, 44) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 41) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 42) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) +Highest counter ID seen: c0 + +Function name: inner_items::main +Raw bytes (68): 0x[01, 01, 02, 01, 05, 01, 09, 0c, 01, 03, 01, 00, 0a, 01, 04, 13, 00, 2e, 01, 02, 19, 00, 1a, 01, 01, 08, 00, 0f, 05, 00, 10, 02, 06, 02, 02, 05, 00, 06, 01, 24, 08, 00, 0f, 09, 00, 10, 02, 06, 06, 02, 05, 00, 06, 01, 02, 13, 02, 06, 01, 04, 05, 00, 1d, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/inner_items.rs +Number of expressions: 2 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Counter(2) +Number of file 0 mappings: 12 +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 4, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 2, 25) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 15) +- Code(Counter(1)) at (prev + 0, 16) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) + = (c0 - c1) +- Code(Counter(0)) at (prev + 36, 8) to (start + 0, 15) +- Code(Counter(2)) at (prev + 0, 16) to (start + 2, 6) +- Code(Expression(1, Sub)) at (prev + 2, 5) to (start + 0, 6) + = (c0 - c2) +- Code(Counter(0)) at (prev + 2, 19) to (start + 2, 6) +- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 29) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c2 + +Function name: inner_items::main::in_func +Raw bytes (34): 0x[01, 01, 00, 06, 01, 12, 05, 00, 17, 01, 01, 11, 00, 12, 01, 01, 11, 00, 16, 01, 01, 09, 00, 11, 01, 00, 1c, 00, 1d, 01, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/inner_items.rs +Number of expressions: 0 +Number of file 0 mappings: 6 +- Code(Counter(0)) at (prev + 18, 5) to (start + 0, 23) +- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 22) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) +- Code(Counter(0)) at (prev + 0, 28) to (start + 0, 29) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: c0 + diff --git a/tests/coverage/inner_items.coverage b/tests/coverage/iffy/inner_items.coverage similarity index 100% rename from tests/coverage/inner_items.coverage rename to tests/coverage/iffy/inner_items.coverage diff --git a/tests/coverage/inner_items.rs b/tests/coverage/iffy/inner_items.rs similarity index 100% rename from tests/coverage/inner_items.rs rename to tests/coverage/iffy/inner_items.rs diff --git a/tests/coverage/iffy/issue-83601.cov-map b/tests/coverage/iffy/issue-83601.cov-map new file mode 100644 index 0000000000000..e2bd5838c83ea --- /dev/null +++ b/tests/coverage/iffy/issue-83601.cov-map @@ -0,0 +1,24 @@ +Function name: issue_83601::main +Raw bytes (84): 0x[01, 01, 00, 10, 01, 06, 01, 00, 0a, 01, 01, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 13, 01, 00, 15, 00, 1b, 01, 01, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 13, 01, 00, 15, 00, 1b, 01, 01, 05, 00, 0d, 01, 00, 16, 00, 1c, 01, 01, 05, 00, 0d, 01, 00, 16, 00, 19, 01, 01, 05, 00, 0d, 01, 00, 16, 00, 19, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/issue-83601.rs +Number of expressions: 0 +Number of file 0 mappings: 16 +- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 15) to (start + 0, 21) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(0)) at (prev + 0, 21) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 15) to (start + 0, 21) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(0)) at (prev + 0, 21) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 28) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 25) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 25) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/issue-83601.coverage b/tests/coverage/iffy/issue-83601.coverage similarity index 100% rename from tests/coverage/issue-83601.coverage rename to tests/coverage/iffy/issue-83601.coverage diff --git a/tests/coverage/issue-83601.rs b/tests/coverage/iffy/issue-83601.rs similarity index 100% rename from tests/coverage/issue-83601.rs rename to tests/coverage/iffy/issue-83601.rs diff --git a/tests/coverage/iffy/issue-84561.cov-map b/tests/coverage/iffy/issue-84561.cov-map new file mode 100644 index 0000000000000..b5b9e47e6edf9 --- /dev/null +++ b/tests/coverage/iffy/issue-84561.cov-map @@ -0,0 +1,202 @@ +Function name: ::fmt +Raw bytes (42): 0x[01, 01, 01, 01, 05, 07, 01, 8a, 01, 05, 00, 43, 01, 01, 09, 00, 0f, 01, 00, 10, 00, 11, 01, 00, 13, 00, 24, 05, 00, 25, 00, 26, 02, 01, 09, 00, 0f, 01, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/issue-84561.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 7 +- Code(Counter(0)) at (prev + 138, 5) to (start + 0, 67) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 17) +- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 36) +- Code(Counter(1)) at (prev + 0, 37) to (start + 0, 38) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: c1 + +Function name: issue_84561::main +Raw bytes (30): 0x[01, 01, 00, 05, 01, b4, 01, 01, 00, 0a, 01, 01, 05, 00, 0c, 01, 01, 05, 00, 0c, 01, 01, 05, 00, 0c, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/issue-84561.rs +Number of expressions: 0 +Number of file 0 mappings: 5 +- Code(Counter(0)) at (prev + 180, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c0 + +Function name: issue_84561::test1 +Raw bytes (65): 0x[01, 01, 00, 0c, 01, 9a, 01, 01, 00, 0b, 01, 01, 05, 00, 0b, 05, 00, 0c, 00, 1e, 01, 01, 05, 00, 0b, 09, 00, 0c, 00, 1e, 01, 01, 0d, 00, 0e, 01, 01, 05, 00, 0b, 0d, 00, 0c, 00, 1e, 01, 01, 05, 02, 06, 01, 03, 05, 00, 0b, 11, 00, 0c, 00, 1e, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/issue-84561.rs +Number of expressions: 0 +Number of file 0 mappings: 12 +- Code(Counter(0)) at (prev + 154, 1) to (start + 0, 11) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) +- Code(Counter(1)) at (prev + 0, 12) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) +- Code(Counter(2)) at (prev + 0, 12) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) +- Code(Counter(3)) at (prev + 0, 12) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 5) to (start + 2, 6) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 11) +- Code(Counter(4)) at (prev + 0, 12) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c4 + +Function name: issue_84561::test2 +Raw bytes (25): 0x[01, 01, 00, 04, 01, b0, 01, 01, 00, 0b, 01, 01, 05, 00, 10, 05, 00, 11, 00, 23, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/issue-84561.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 176, 1) to (start + 0, 11) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 16) +- Code(Counter(1)) at (prev + 0, 17) to (start + 0, 35) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 + +Function name: issue_84561::test2::call_print +Raw bytes (25): 0x[01, 01, 00, 04, 01, a7, 01, 09, 00, 1f, 01, 01, 0d, 00, 13, 01, 00, 1a, 00, 1b, 01, 01, 09, 00, 0a] +Number of files: 1 +- file 0 => $DIR/issue-84561.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 167, 9) to (start + 0, 31) +- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 19) +- Code(Counter(0)) at (prev + 0, 26) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) +Highest counter ID seen: c0 + +Function name: issue_84561::test3 +Raw bytes (519): 0x[01, 01, 0a, 01, 05, 01, 09, 01, 09, 01, 0d, 11, 15, 19, 1d, 19, 1d, 19, 1d, 19, 1d, 1d, 21, 63, 01, 08, 01, 00, 0b, 01, 01, 13, 00, 2e, 01, 01, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 13, 01, 00, 15, 00, 1b, 01, 01, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 13, 01, 00, 15, 00, 1b, 01, 01, 05, 00, 0d, 01, 00, 16, 00, 1c, 01, 01, 05, 00, 0d, 01, 00, 16, 00, 19, 01, 01, 05, 00, 0d, 01, 00, 16, 00, 19, 01, 02, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 01, 01, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 13, 01, 00, 15, 00, 1b, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 01, 01, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 01, 01, 05, 00, 0d, 01, 00, 16, 00, 19, 01, 01, 05, 00, 0d, 01, 00, 16, 00, 1c, 01, 02, 05, 00, 0f, 01, 00, 10, 00, 16, 01, 00, 18, 00, 1e, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0f, 01, 02, 09, 00, 0f, 01, 0d, 13, 00, 2e, 01, 02, 05, 00, 0f, 01, 01, 09, 00, 0f, 01, 01, 09, 00, 0f, 01, 02, 05, 00, 0f, 01, 01, 09, 00, 0f, 01, 01, 09, 00, 0f, 01, 02, 05, 00, 0f, 01, 01, 09, 00, 0f, 01, 01, 09, 00, 0f, 01, 02, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 01, 09, 00, 0f, 01, 02, 08, 00, 0f, 05, 00, 10, 05, 06, 05, 01, 09, 00, 13, 02, 04, 0c, 05, 06, 02, 01, 09, 00, 13, 01, 05, 08, 00, 0f, 09, 00, 10, 06, 06, 09, 01, 09, 00, 13, 0a, 05, 0c, 06, 06, 0a, 01, 09, 00, 13, 01, 06, 05, 00, 0f, 01, 01, 0c, 00, 13, 0d, 00, 14, 02, 0a, 0e, 02, 10, 02, 0a, 01, 03, 09, 00, 0f, 11, 02, 05, 00, 0f, 11, 01, 09, 00, 0f, 11, 01, 0c, 00, 13, 15, 00, 14, 02, 0a, 12, 02, 10, 02, 0a, 19, 04, 05, 00, 0f, 19, 01, 0c, 00, 13, 1d, 01, 0d, 00, 17, 1d, 01, 11, 00, 17, 1d, 01, 11, 00, 17, 1d, 02, 0d, 00, 13, 22, 02, 0d, 00, 17, 22, 01, 14, 00, 1b, 00, 00, 1c, 02, 12, 22, 02, 18, 02, 12, 22, 03, 11, 00, 17, 21, 02, 0d, 00, 13, 27, 02, 09, 00, 0f, 25, 03, 05, 00, 0f, 25, 01, 09, 00, 0f, 25, 01, 09, 00, 0f, 00, 03, 05, 00, 0f, 00, 01, 09, 00, 0f, 00, 01, 09, 00, 0f, 00, 03, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/issue-84561.rs +Number of expressions: 10 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(0), rhs = Counter(2) +- expression 2 operands: lhs = Counter(0), rhs = Counter(2) +- expression 3 operands: lhs = Counter(0), rhs = Counter(3) +- expression 4 operands: lhs = Counter(4), rhs = Counter(5) +- expression 5 operands: lhs = Counter(6), rhs = Counter(7) +- expression 6 operands: lhs = Counter(6), rhs = Counter(7) +- expression 7 operands: lhs = Counter(6), rhs = Counter(7) +- expression 8 operands: lhs = Counter(6), rhs = Counter(7) +- expression 9 operands: lhs = Counter(7), rhs = Counter(8) +Number of file 0 mappings: 99 +- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 11) +- Code(Counter(0)) at (prev + 1, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 1, 15) to (start + 0, 21) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(0)) at (prev + 0, 21) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 15) to (start + 0, 21) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(0)) at (prev + 0, 21) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 28) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 25) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 25) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 15) to (start + 0, 21) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 19) +- Code(Counter(0)) at (prev + 0, 21) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 25) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 28) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 13, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 2, 15) to (start + 0, 21) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 15) +- Code(Counter(1)) at (prev + 0, 16) to (start + 5, 6) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 19) +- Code(Expression(0, Sub)) at (prev + 4, 12) to (start + 5, 6) + = (c0 - c1) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 19) + = (c0 - c1) +- Code(Counter(0)) at (prev + 5, 8) to (start + 0, 15) +- Code(Counter(2)) at (prev + 0, 16) to (start + 6, 6) +- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 19) +- Code(Expression(2, Sub)) at (prev + 5, 12) to (start + 6, 6) + = (c0 - c2) +- Code(Expression(2, Sub)) at (prev + 1, 9) to (start + 0, 19) + = (c0 - c2) +- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 19) +- Code(Counter(3)) at (prev + 0, 20) to (start + 2, 10) +- Code(Expression(3, Sub)) at (prev + 2, 16) to (start + 2, 10) + = (c0 - c3) +- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 15) +- Code(Counter(4)) at (prev + 2, 5) to (start + 0, 15) +- Code(Counter(4)) at (prev + 1, 9) to (start + 0, 15) +- Code(Counter(4)) at (prev + 1, 12) to (start + 0, 19) +- Code(Counter(5)) at (prev + 0, 20) to (start + 2, 10) +- Code(Expression(4, Sub)) at (prev + 2, 16) to (start + 2, 10) + = (c4 - c5) +- Code(Counter(6)) at (prev + 4, 5) to (start + 0, 15) +- Code(Counter(6)) at (prev + 1, 12) to (start + 0, 19) +- Code(Counter(7)) at (prev + 1, 13) to (start + 0, 23) +- Code(Counter(7)) at (prev + 1, 17) to (start + 0, 23) +- Code(Counter(7)) at (prev + 1, 17) to (start + 0, 23) +- Code(Counter(7)) at (prev + 2, 13) to (start + 0, 19) +- Code(Expression(8, Sub)) at (prev + 2, 13) to (start + 0, 23) + = (c6 - c7) +- Code(Expression(8, Sub)) at (prev + 1, 20) to (start + 0, 27) + = (c6 - c7) +- Code(Zero) at (prev + 0, 28) to (start + 2, 18) +- Code(Expression(8, Sub)) at (prev + 2, 24) to (start + 2, 18) + = (c6 - c7) +- Code(Expression(8, Sub)) at (prev + 3, 17) to (start + 0, 23) + = (c6 - c7) +- Code(Counter(8)) at (prev + 2, 13) to (start + 0, 19) +- Code(Expression(9, Add)) at (prev + 2, 9) to (start + 0, 15) + = (c7 + c8) +- Code(Counter(9)) at (prev + 3, 5) to (start + 0, 15) +- Code(Counter(9)) at (prev + 1, 9) to (start + 0, 15) +- Code(Counter(9)) at (prev + 1, 9) to (start + 0, 15) +- Code(Zero) at (prev + 3, 5) to (start + 0, 15) +- Code(Zero) at (prev + 1, 9) to (start + 0, 15) +- Code(Zero) at (prev + 1, 9) to (start + 0, 15) +- Code(Zero) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c9 + diff --git a/tests/coverage/issue-84561.coverage b/tests/coverage/iffy/issue-84561.coverage similarity index 74% rename from tests/coverage/issue-84561.coverage rename to tests/coverage/iffy/issue-84561.coverage index 8a8396e95d2b5..940e37faa6b7a 100644 --- a/tests/coverage/issue-84561.coverage +++ b/tests/coverage/iffy/issue-84561.coverage @@ -26,111 +26,110 @@ LL| 1| println!("{:?}", Foo(1)); LL| | LL| 1| assert_ne!(Foo(0), Foo(5), "{}", if is_true { "true message" } else { "false message" }); - ^0 ^0 ^0 LL| 1| assert_ne!( - LL| | Foo(0) + LL| 1| Foo(0) LL| | , - LL| | Foo(5) + LL| 1| Foo(5) LL| | , LL| | "{}" LL| | , LL| | if - LL| 0| is_true + LL| | is_true LL| | { - LL| 0| "true message" + LL| | "true message" LL| | } else { - LL| 0| "false message" + LL| | "false message" LL| | } LL| | ); LL| | LL| 1| let is_true = std::env::args().len() == 1; LL| | LL| 1| assert_eq!( - LL| | Foo(1), - LL| | Foo(1) + LL| 1| Foo(1), + LL| 1| Foo(1) LL| | ); LL| 1| assert_ne!( - LL| | Foo(0), - LL| | Foo(1) + LL| 1| Foo(0), + LL| 1| Foo(1) LL| | ); LL| 1| assert_eq!( - LL| | Foo(2), - LL| | Foo(2) + LL| 1| Foo(2), + LL| 1| Foo(2) LL| | ); LL| 1| let bar = Foo(1); LL| 1| assert_ne!( - LL| | bar, - LL| | Foo(3) + LL| 1| bar, + LL| 1| Foo(3) LL| | ); LL| 1| if is_true { LL| 1| assert_ne!( - LL| | Foo(0), - LL| | Foo(4) - LL| | ); - LL| | } else { + LL| 1| Foo(0), + LL| 1| Foo(4) + LL| 1| ); + LL| 1| } else { LL| 0| assert_eq!( - LL| | Foo(3), - LL| | Foo(3) - LL| | ); - LL| | } + LL| 0| Foo(3), + LL| 0| Foo(3) + LL| 0| ); + LL| 0| } LL| 1| if is_true { LL| 1| assert_ne!( - LL| | Foo(0), - LL| | Foo(4), - LL| | "with a message" - LL| | ); - LL| | } else { + LL| 1| Foo(0), + LL| 1| Foo(4), + LL| 1| "with a message" + LL| 1| ); + LL| 1| } else { LL| 0| assert_eq!( - LL| | Foo(3), - LL| | Foo(3), - LL| | "with a message" - LL| | ); - LL| | } + LL| 0| Foo(3), + LL| 0| Foo(3), + LL| 0| "with a message" + LL| 0| ); + LL| 0| } LL| 1| assert_ne!( LL| 1| if is_true { LL| 1| Foo(0) - LL| | } else { + LL| 1| } else { LL| 0| Foo(1) - LL| | }, - LL| | Foo(5) + LL| 0| }, + LL| 1| Foo(5) LL| | ); LL| 1| assert_ne!( - LL| | Foo(5), + LL| 1| Foo(5), LL| 1| if is_true { LL| 1| Foo(0) - LL| | } else { + LL| 1| } else { LL| 0| Foo(1) - LL| | } + LL| 0| } LL| | ); LL| 1| assert_ne!( LL| 1| if is_true { LL| 1| assert_eq!( - LL| | Foo(3), - LL| | Foo(3) + LL| 1| Foo(3), + LL| 1| Foo(3) LL| | ); LL| 1| Foo(0) LL| | } else { LL| 0| assert_ne!( LL| 0| if is_true { LL| 0| Foo(0) - LL| | } else { + LL| 0| } else { LL| 0| Foo(1) - LL| | }, - LL| | Foo(5) + LL| 0| }, + LL| 0| Foo(5) LL| | ); LL| 0| Foo(1) LL| | }, - LL| | Foo(5), + LL| 1| Foo(5), LL| | "with a message" LL| | ); LL| 1| assert_eq!( - LL| | Foo(1), - LL| | Foo(3), + LL| 1| Foo(1), + LL| 1| Foo(3), LL| | "this assert should fail" LL| | ); LL| 0| assert_eq!( - LL| | Foo(3), - LL| | Foo(3), + LL| 0| Foo(3), + LL| 0| Foo(3), LL| | "this assert should not be reached" LL| | ); LL| 0|} @@ -155,9 +154,12 @@ LL| | LL| 1|fn test1() { LL| 1| debug!("debug is enabled"); + ^0 LL| 1| debug!("debug is enabled"); + ^0 LL| 1| let _ = 0; LL| 1| debug!("debug is enabled"); + ^0 LL| 1| unsafe { LL| 1| DEBUG_LEVEL_ENABLED = true; LL| 1| } diff --git a/tests/coverage/issue-84561.rs b/tests/coverage/iffy/issue-84561.rs similarity index 100% rename from tests/coverage/issue-84561.rs rename to tests/coverage/iffy/issue-84561.rs diff --git a/tests/coverage/issue-85461.cov-map b/tests/coverage/iffy/issue-85461.cov-map similarity index 67% rename from tests/coverage/issue-85461.cov-map rename to tests/coverage/iffy/issue-85461.cov-map index b08d70336930c..aac4bf0ea4812 100644 --- a/tests/coverage/issue-85461.cov-map +++ b/tests/coverage/iffy/issue-85461.cov-map @@ -1,12 +1,12 @@ Function name: issue_85461::main -Raw bytes (24): 0x[01, 01, 00, 04, 01, 08, 01, 00, 0a, 01, 01, 05, 00, 11, 01, 01, 05, 00, 11, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 08, 01, 00, 0a, 01, 01, 05, 00, 13, 01, 01, 05, 00, 13, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/issue-85461.rs Number of expressions: 0 Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 8, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 19) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/issue-85461.coverage b/tests/coverage/iffy/issue-85461.coverage similarity index 100% rename from tests/coverage/issue-85461.coverage rename to tests/coverage/iffy/issue-85461.coverage diff --git a/tests/coverage/issue-85461.rs b/tests/coverage/iffy/issue-85461.rs similarity index 100% rename from tests/coverage/issue-85461.rs rename to tests/coverage/iffy/issue-85461.rs diff --git a/tests/coverage/issue-93054.cov-map b/tests/coverage/iffy/issue-93054.cov-map similarity index 100% rename from tests/coverage/issue-93054.cov-map rename to tests/coverage/iffy/issue-93054.cov-map diff --git a/tests/coverage/issue-93054.coverage b/tests/coverage/iffy/issue-93054.coverage similarity index 100% rename from tests/coverage/issue-93054.coverage rename to tests/coverage/iffy/issue-93054.coverage diff --git a/tests/coverage/issue-93054.rs b/tests/coverage/iffy/issue-93054.rs similarity index 100% rename from tests/coverage/issue-93054.rs rename to tests/coverage/iffy/issue-93054.rs diff --git a/tests/coverage/lazy_boolean.cov-map b/tests/coverage/iffy/lazy_boolean.cov-map similarity index 52% rename from tests/coverage/lazy_boolean.cov-map rename to tests/coverage/iffy/lazy_boolean.cov-map index cbbe6a89fb0fa..8b0f3864b191b 100644 --- a/tests/coverage/lazy_boolean.cov-map +++ b/tests/coverage/iffy/lazy_boolean.cov-map @@ -1,5 +1,5 @@ Function name: lazy_boolean::main -Raw bytes (198): 0x[01, 01, 07, 01, 05, 01, 25, 01, 21, 01, 11, 01, 15, 01, 19, 01, 1d, 24, 01, 04, 01, 00, 0a, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 0a, 00, 0f, 01, 00, 11, 00, 16, 01, 00, 18, 00, 1d, 01, 00, 21, 00, 2a, 01, 01, 08, 00, 0f, 05, 00, 10, 04, 06, 05, 01, 09, 00, 0e, 02, 03, 05, 00, 06, 01, 02, 09, 00, 11, 01, 02, 0d, 00, 12, 06, 02, 0d, 00, 12, 01, 03, 09, 00, 11, 01, 02, 0d, 00, 12, 0a, 02, 0d, 00, 12, 01, 02, 09, 00, 11, 01, 00, 14, 00, 19, 09, 00, 1d, 00, 22, 01, 01, 09, 00, 11, 01, 00, 14, 00, 19, 0d, 00, 1d, 00, 22, 01, 03, 09, 01, 10, 0e, 02, 05, 03, 06, 11, 03, 05, 00, 06, 01, 03, 09, 00, 10, 15, 01, 05, 03, 06, 12, 05, 05, 03, 06, 01, 05, 08, 00, 10, 16, 00, 11, 02, 06, 19, 02, 05, 00, 06, 01, 02, 08, 00, 0f, 1d, 00, 10, 02, 06, 1a, 02, 0c, 02, 06, 01, 03, 01, 00, 02] +Raw bytes (168): 0x[01, 01, 07, 01, 05, 01, 25, 01, 21, 01, 11, 01, 15, 01, 19, 01, 1d, 1e, 01, 04, 01, 00, 0a, 01, 04, 13, 00, 2e, 01, 02, 21, 00, 2a, 01, 00, 22, 00, 23, 01, 01, 08, 00, 0f, 05, 00, 10, 04, 06, 05, 01, 09, 00, 0e, 05, 01, 09, 00, 0f, 02, 02, 05, 00, 06, 01, 04, 0d, 00, 12, 06, 02, 0d, 00, 12, 01, 05, 0d, 00, 12, 0a, 02, 0d, 00, 12, 01, 02, 14, 00, 19, 09, 00, 1d, 00, 22, 01, 01, 14, 00, 19, 0d, 00, 1d, 00, 22, 01, 03, 09, 01, 10, 0e, 02, 05, 03, 06, 11, 03, 05, 00, 06, 01, 03, 09, 00, 10, 15, 01, 05, 03, 06, 12, 05, 05, 03, 06, 01, 05, 08, 00, 10, 16, 00, 11, 02, 06, 19, 02, 05, 00, 06, 01, 02, 08, 00, 0f, 1d, 00, 10, 02, 06, 1a, 02, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/lazy_boolean.rs Number of expressions: 7 @@ -10,32 +10,26 @@ Number of expressions: 7 - expression 4 operands: lhs = Counter(0), rhs = Counter(5) - expression 5 operands: lhs = Counter(0), rhs = Counter(6) - expression 6 operands: lhs = Counter(0), rhs = Counter(7) -Number of file 0 mappings: 36 +Number of file 0 mappings: 30 - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 2, 10) to (start + 0, 15) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 29) -- Code(Counter(0)) at (prev + 0, 33) to (start + 0, 42) +- Code(Counter(0)) at (prev + 4, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 2, 33) to (start + 0, 42) +- Code(Counter(0)) at (prev + 0, 34) to (start + 0, 35) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 15) - Code(Counter(1)) at (prev + 0, 16) to (start + 4, 6) - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 14) -- Code(Expression(0, Sub)) at (prev + 3, 5) to (start + 0, 6) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15) +- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) = (c0 - c1) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 18) +- Code(Counter(0)) at (prev + 4, 13) to (start + 0, 18) - Code(Expression(1, Sub)) at (prev + 2, 13) to (start + 0, 18) = (c0 - c9) -- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 2, 13) to (start + 0, 18) +- Code(Counter(0)) at (prev + 5, 13) to (start + 0, 18) - Code(Expression(2, Sub)) at (prev + 2, 13) to (start + 0, 18) = (c0 - c8) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 25) +- Code(Counter(0)) at (prev + 2, 20) to (start + 0, 25) - Code(Counter(2)) at (prev + 0, 29) to (start + 0, 34) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 25) +- Code(Counter(0)) at (prev + 1, 20) to (start + 0, 25) - Code(Counter(3)) at (prev + 0, 29) to (start + 0, 34) - Code(Counter(0)) at (prev + 3, 9) to (start + 1, 16) - Code(Expression(3, Sub)) at (prev + 2, 5) to (start + 3, 6) diff --git a/tests/coverage/lazy_boolean.coverage b/tests/coverage/iffy/lazy_boolean.coverage similarity index 96% rename from tests/coverage/lazy_boolean.coverage rename to tests/coverage/iffy/lazy_boolean.coverage index 0a30038e02fa2..f206edb99bb9c 100644 --- a/tests/coverage/lazy_boolean.coverage +++ b/tests/coverage/iffy/lazy_boolean.coverage @@ -15,14 +15,14 @@ LL| 1| } ^0 LL| | let - LL| 1| somebool + LL| | somebool LL| | = LL| 1| a < b LL| | || LL| 0| b < c LL| | ; LL| | let - LL| 1| somebool + LL| | somebool LL| | = LL| 1| b < a LL| | || diff --git a/tests/coverage/lazy_boolean.rs b/tests/coverage/iffy/lazy_boolean.rs similarity index 100% rename from tests/coverage/lazy_boolean.rs rename to tests/coverage/iffy/lazy_boolean.rs diff --git a/tests/coverage/loops_branches.cov-map b/tests/coverage/iffy/loops_branches.cov-map similarity index 74% rename from tests/coverage/loops_branches.cov-map rename to tests/coverage/iffy/loops_branches.cov-map index 8d6cc0a470c00..603600946d776 100644 --- a/tests/coverage/loops_branches.cov-map +++ b/tests/coverage/iffy/loops_branches.cov-map @@ -1,5 +1,5 @@ Function name: ::fmt -Raw bytes (129): 0x[01, 01, 05, 01, 05, 0b, 0f, 01, 09, 05, 0d, 0d, 09, 17, 01, 09, 05, 00, 43, 01, 01, 0c, 00, 10, 01, 01, 10, 00, 15, 00, 01, 17, 00, 1b, 00, 00, 1c, 00, 1e, 01, 01, 0d, 00, 0e, 01, 01, 0d, 00, 13, 01, 00, 14, 00, 15, 05, 00, 1e, 00, 1f, 00, 01, 10, 01, 0a, 09, 03, 0d, 00, 0e, 02, 00, 12, 00, 17, 09, 01, 10, 00, 14, 09, 01, 14, 00, 19, 00, 01, 1b, 00, 1f, 00, 00, 20, 00, 22, 09, 01, 11, 00, 12, 09, 01, 11, 00, 17, 09, 00, 18, 00, 19, 06, 00, 22, 00, 23, 00, 01, 14, 01, 0e, 12, 03, 09, 00, 0f, 01, 01, 05, 00, 06] +Raw bytes (134): 0x[01, 01, 05, 01, 05, 0b, 0f, 01, 09, 05, 0d, 0d, 09, 18, 01, 09, 05, 00, 43, 01, 01, 0c, 00, 10, 01, 01, 10, 00, 15, 00, 01, 17, 00, 1b, 00, 00, 1c, 00, 1e, 01, 01, 0d, 00, 0e, 01, 01, 0d, 00, 13, 01, 00, 14, 00, 15, 01, 00, 17, 00, 1d, 05, 00, 1e, 00, 1f, 00, 01, 10, 01, 0a, 02, 03, 12, 00, 17, 09, 01, 10, 00, 14, 09, 01, 14, 00, 19, 00, 01, 1b, 00, 1f, 00, 00, 20, 00, 22, 09, 01, 11, 00, 12, 09, 01, 11, 00, 17, 09, 00, 18, 00, 19, 09, 00, 1b, 00, 21, 06, 00, 22, 00, 23, 00, 01, 14, 01, 0e, 12, 03, 09, 00, 0f, 01, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/loops_branches.rs Number of expressions: 5 @@ -8,7 +8,7 @@ Number of expressions: 5 - expression 2 operands: lhs = Counter(0), rhs = Counter(2) - expression 3 operands: lhs = Counter(1), rhs = Counter(3) - expression 4 operands: lhs = Counter(3), rhs = Counter(2) -Number of file 0 mappings: 23 +Number of file 0 mappings: 24 - Code(Counter(0)) at (prev + 9, 5) to (start + 0, 67) - Code(Counter(0)) at (prev + 1, 12) to (start + 0, 16) - Code(Counter(0)) at (prev + 1, 16) to (start + 0, 21) @@ -17,10 +17,10 @@ Number of file 0 mappings: 23 - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 19) - Code(Counter(0)) at (prev + 0, 20) to (start + 0, 21) +- Code(Counter(0)) at (prev + 0, 23) to (start + 0, 29) - Code(Counter(1)) at (prev + 0, 30) to (start + 0, 31) - Code(Zero) at (prev + 1, 16) to (start + 1, 10) -- Code(Counter(2)) at (prev + 3, 13) to (start + 0, 14) -- Code(Expression(0, Sub)) at (prev + 0, 18) to (start + 0, 23) +- Code(Expression(0, Sub)) at (prev + 3, 18) to (start + 0, 23) = (c0 - c1) - Code(Counter(2)) at (prev + 1, 16) to (start + 0, 20) - Code(Counter(2)) at (prev + 1, 20) to (start + 0, 25) @@ -29,6 +29,7 @@ Number of file 0 mappings: 23 - Code(Counter(2)) at (prev + 1, 17) to (start + 0, 18) - Code(Counter(2)) at (prev + 1, 17) to (start + 0, 23) - Code(Counter(2)) at (prev + 0, 24) to (start + 0, 25) +- Code(Counter(2)) at (prev + 0, 27) to (start + 0, 33) - Code(Expression(1, Sub)) at (prev + 0, 34) to (start + 0, 35) = ((c0 + c2) - (c1 + c3)) - Code(Zero) at (prev + 1, 20) to (start + 1, 14) @@ -38,7 +39,7 @@ Number of file 0 mappings: 23 Highest counter ID seen: c2 Function name: ::fmt -Raw bytes (129): 0x[01, 01, 05, 01, 05, 0b, 0f, 01, 09, 0d, 05, 0d, 09, 17, 01, 22, 05, 00, 43, 01, 01, 0c, 00, 11, 00, 00, 12, 01, 0a, 01, 02, 10, 00, 15, 00, 01, 17, 00, 1b, 00, 00, 1c, 00, 1e, 01, 01, 0d, 00, 0e, 01, 01, 0d, 00, 13, 01, 00, 14, 00, 15, 05, 00, 1e, 00, 1f, 09, 02, 0d, 00, 0e, 02, 00, 12, 00, 17, 09, 01, 10, 00, 15, 00, 00, 16, 01, 0e, 09, 02, 14, 00, 19, 00, 01, 1b, 00, 1f, 00, 00, 20, 00, 22, 09, 01, 11, 00, 12, 09, 01, 11, 00, 17, 09, 00, 18, 00, 19, 06, 00, 22, 00, 23, 12, 03, 09, 00, 0f, 01, 01, 05, 00, 06] +Raw bytes (134): 0x[01, 01, 05, 01, 05, 0b, 0f, 01, 09, 0d, 05, 0d, 09, 18, 01, 22, 05, 00, 43, 01, 01, 0c, 00, 11, 00, 00, 12, 01, 0a, 01, 02, 10, 00, 15, 00, 01, 17, 00, 1b, 00, 00, 1c, 00, 1e, 01, 01, 0d, 00, 0e, 01, 01, 0d, 00, 13, 01, 00, 14, 00, 15, 01, 00, 17, 00, 1d, 05, 00, 1e, 00, 1f, 02, 02, 12, 00, 17, 09, 01, 10, 00, 15, 00, 00, 16, 01, 0e, 09, 02, 14, 00, 19, 00, 01, 1b, 00, 1f, 00, 00, 20, 00, 22, 09, 01, 11, 00, 12, 09, 01, 11, 00, 17, 09, 00, 18, 00, 19, 09, 00, 1b, 00, 21, 06, 00, 22, 00, 23, 12, 03, 09, 00, 0f, 01, 01, 05, 00, 06] Number of files: 1 - file 0 => $DIR/loops_branches.rs Number of expressions: 5 @@ -47,7 +48,7 @@ Number of expressions: 5 - expression 2 operands: lhs = Counter(0), rhs = Counter(2) - expression 3 operands: lhs = Counter(3), rhs = Counter(1) - expression 4 operands: lhs = Counter(3), rhs = Counter(2) -Number of file 0 mappings: 23 +Number of file 0 mappings: 24 - Code(Counter(0)) at (prev + 34, 5) to (start + 0, 67) - Code(Counter(0)) at (prev + 1, 12) to (start + 0, 17) - Code(Zero) at (prev + 0, 18) to (start + 1, 10) @@ -57,9 +58,9 @@ Number of file 0 mappings: 23 - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) - Code(Counter(0)) at (prev + 1, 13) to (start + 0, 19) - Code(Counter(0)) at (prev + 0, 20) to (start + 0, 21) +- Code(Counter(0)) at (prev + 0, 23) to (start + 0, 29) - Code(Counter(1)) at (prev + 0, 30) to (start + 0, 31) -- Code(Counter(2)) at (prev + 2, 13) to (start + 0, 14) -- Code(Expression(0, Sub)) at (prev + 0, 18) to (start + 0, 23) +- Code(Expression(0, Sub)) at (prev + 2, 18) to (start + 0, 23) = (c0 - c1) - Code(Counter(2)) at (prev + 1, 16) to (start + 0, 21) - Code(Zero) at (prev + 0, 22) to (start + 1, 14) @@ -69,6 +70,7 @@ Number of file 0 mappings: 23 - Code(Counter(2)) at (prev + 1, 17) to (start + 0, 18) - Code(Counter(2)) at (prev + 1, 17) to (start + 0, 23) - Code(Counter(2)) at (prev + 0, 24) to (start + 0, 25) +- Code(Counter(2)) at (prev + 0, 27) to (start + 0, 33) - Code(Expression(1, Sub)) at (prev + 0, 34) to (start + 0, 35) = ((c0 + c2) - (c3 + c1)) - Code(Expression(4, Sub)) at (prev + 3, 9) to (start + 0, 15) @@ -77,18 +79,18 @@ Number of file 0 mappings: 23 Highest counter ID seen: c2 Function name: loops_branches::main -Raw bytes (44): 0x[01, 01, 00, 08, 01, 37, 01, 00, 0a, 01, 01, 09, 00, 13, 01, 00, 16, 00, 1f, 01, 01, 05, 00, 0d, 01, 01, 09, 00, 15, 01, 00, 18, 00, 23, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (44): 0x[01, 01, 00, 08, 01, 37, 01, 00, 0a, 01, 01, 16, 00, 1f, 01, 01, 05, 00, 0d, 01, 00, 16, 00, 20, 01, 01, 18, 00, 23, 01, 01, 05, 00, 0d, 01, 00, 14, 00, 20, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/loops_branches.rs Number of expressions: 0 Number of file 0 mappings: 8 - Code(Counter(0)) at (prev + 55, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 19) -- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 31) +- Code(Counter(0)) at (prev + 1, 22) to (start + 0, 31) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 21) -- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 35) +- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 32) +- Code(Counter(0)) at (prev + 1, 24) to (start + 0, 35) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 32) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/loops_branches.coverage b/tests/coverage/iffy/loops_branches.coverage similarity index 94% rename from tests/coverage/loops_branches.coverage rename to tests/coverage/iffy/loops_branches.coverage index 7bd1a680f00e3..33be65fea84a1 100644 --- a/tests/coverage/loops_branches.coverage +++ b/tests/coverage/iffy/loops_branches.coverage @@ -16,8 +16,7 @@ LL| 0| } else { LL| 0| } LL| | - LL| 10| for i in 0..10 { - ^1 + LL| 1| for i in 0..10 { LL| 10| if true { LL| 10| if false { LL| 0| while true {} @@ -43,8 +42,7 @@ LL| 1| write!(f, "cool")?; ^0 LL| | } - LL| 10| for i in 0..10 { - ^1 + LL| 1| for i in 0..10 { LL| 10| if false { LL| 0| } else { LL| 10| if false { diff --git a/tests/coverage/loops_branches.rs b/tests/coverage/iffy/loops_branches.rs similarity index 100% rename from tests/coverage/loops_branches.rs rename to tests/coverage/iffy/loops_branches.rs diff --git a/tests/coverage/match_or_pattern.cov-map b/tests/coverage/iffy/match_or_pattern.cov-map similarity index 57% rename from tests/coverage/match_or_pattern.cov-map rename to tests/coverage/iffy/match_or_pattern.cov-map index 0bb126bc09b18..373bafda11128 100644 --- a/tests/coverage/match_or_pattern.cov-map +++ b/tests/coverage/iffy/match_or_pattern.cov-map @@ -1,5 +1,5 @@ Function name: match_or_pattern::main -Raw bytes (190): 0x[01, 01, 08, 01, 05, 01, 09, 01, 0d, 01, 11, 01, 15, 01, 19, 01, 1d, 01, 21, 22, 01, 01, 01, 00, 0a, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 09, 00, 0e, 01, 00, 10, 00, 12, 01, 00, 15, 00, 16, 01, 01, 09, 00, 0e, 01, 00, 10, 00, 12, 01, 00, 15, 00, 16, 01, 01, 08, 00, 0f, 05, 00, 10, 03, 06, 02, 03, 05, 00, 06, 01, 01, 0b, 00, 11, 06, 03, 1b, 00, 1d, 09, 01, 0e, 00, 10, 01, 02, 08, 00, 0f, 0d, 00, 10, 03, 06, 0a, 03, 05, 00, 06, 01, 01, 0b, 00, 11, 0e, 01, 1b, 00, 1d, 11, 01, 0e, 00, 10, 01, 02, 08, 00, 0f, 15, 00, 10, 03, 06, 12, 03, 05, 00, 06, 01, 01, 0b, 00, 11, 16, 01, 1b, 00, 1d, 19, 01, 0e, 00, 10, 01, 02, 08, 00, 0f, 1d, 00, 10, 03, 06, 1a, 03, 05, 00, 06, 01, 01, 0b, 00, 11, 1e, 01, 1b, 00, 1d, 21, 01, 0e, 00, 10, 01, 02, 01, 00, 02] +Raw bytes (185): 0x[01, 01, 08, 01, 05, 01, 09, 01, 0d, 01, 11, 01, 15, 01, 19, 01, 1d, 01, 21, 21, 01, 01, 01, 00, 0a, 01, 04, 13, 00, 2e, 01, 02, 15, 00, 16, 01, 01, 15, 00, 16, 01, 01, 08, 00, 0f, 05, 00, 10, 03, 06, 05, 01, 09, 00, 0e, 02, 02, 05, 00, 06, 01, 01, 0b, 00, 11, 06, 03, 1b, 00, 1d, 09, 01, 0e, 00, 10, 01, 02, 08, 00, 0f, 0d, 00, 10, 03, 06, 0d, 01, 09, 00, 0e, 0a, 02, 05, 00, 06, 01, 01, 0b, 00, 11, 0e, 01, 1b, 00, 1d, 11, 01, 0e, 00, 10, 01, 02, 08, 00, 0f, 15, 00, 10, 03, 06, 15, 01, 09, 00, 0e, 12, 02, 05, 00, 06, 01, 01, 0b, 00, 11, 16, 01, 1b, 00, 1d, 19, 01, 0e, 00, 10, 01, 02, 08, 00, 0f, 1d, 00, 10, 03, 06, 1d, 01, 09, 00, 0e, 1a, 02, 05, 00, 06, 01, 01, 0b, 00, 11, 1e, 01, 1b, 00, 1d, 21, 01, 0e, 00, 10, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/match_or_pattern.rs Number of expressions: 8 @@ -11,19 +11,15 @@ Number of expressions: 8 - expression 5 operands: lhs = Counter(0), rhs = Counter(6) - expression 6 operands: lhs = Counter(0), rhs = Counter(7) - expression 7 operands: lhs = Counter(0), rhs = Counter(8) -Number of file 0 mappings: 34 +Number of file 0 mappings: 33 - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 18) -- Code(Counter(0)) at (prev + 0, 21) to (start + 0, 22) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 18) -- Code(Counter(0)) at (prev + 0, 21) to (start + 0, 22) +- Code(Counter(0)) at (prev + 4, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 2, 21) to (start + 0, 22) +- Code(Counter(0)) at (prev + 1, 21) to (start + 0, 22) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 15) - Code(Counter(1)) at (prev + 0, 16) to (start + 3, 6) -- Code(Expression(0, Sub)) at (prev + 3, 5) to (start + 0, 6) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 14) +- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) = (c0 - c1) - Code(Counter(0)) at (prev + 1, 11) to (start + 0, 17) - Code(Expression(1, Sub)) at (prev + 3, 27) to (start + 0, 29) @@ -31,7 +27,8 @@ Number of file 0 mappings: 34 - Code(Counter(2)) at (prev + 1, 14) to (start + 0, 16) - Code(Counter(0)) at (prev + 2, 8) to (start + 0, 15) - Code(Counter(3)) at (prev + 0, 16) to (start + 3, 6) -- Code(Expression(2, Sub)) at (prev + 3, 5) to (start + 0, 6) +- Code(Counter(3)) at (prev + 1, 9) to (start + 0, 14) +- Code(Expression(2, Sub)) at (prev + 2, 5) to (start + 0, 6) = (c0 - c3) - Code(Counter(0)) at (prev + 1, 11) to (start + 0, 17) - Code(Expression(3, Sub)) at (prev + 1, 27) to (start + 0, 29) @@ -39,7 +36,8 @@ Number of file 0 mappings: 34 - Code(Counter(4)) at (prev + 1, 14) to (start + 0, 16) - Code(Counter(0)) at (prev + 2, 8) to (start + 0, 15) - Code(Counter(5)) at (prev + 0, 16) to (start + 3, 6) -- Code(Expression(4, Sub)) at (prev + 3, 5) to (start + 0, 6) +- Code(Counter(5)) at (prev + 1, 9) to (start + 0, 14) +- Code(Expression(4, Sub)) at (prev + 2, 5) to (start + 0, 6) = (c0 - c5) - Code(Counter(0)) at (prev + 1, 11) to (start + 0, 17) - Code(Expression(5, Sub)) at (prev + 1, 27) to (start + 0, 29) @@ -47,7 +45,8 @@ Number of file 0 mappings: 34 - Code(Counter(6)) at (prev + 1, 14) to (start + 0, 16) - Code(Counter(0)) at (prev + 2, 8) to (start + 0, 15) - Code(Counter(7)) at (prev + 0, 16) to (start + 3, 6) -- Code(Expression(6, Sub)) at (prev + 3, 5) to (start + 0, 6) +- Code(Counter(7)) at (prev + 1, 9) to (start + 0, 14) +- Code(Expression(6, Sub)) at (prev + 2, 5) to (start + 0, 6) = (c0 - c7) - Code(Counter(0)) at (prev + 1, 11) to (start + 0, 17) - Code(Expression(7, Sub)) at (prev + 1, 27) to (start + 0, 29) diff --git a/tests/coverage/match_or_pattern.coverage b/tests/coverage/iffy/match_or_pattern.coverage similarity index 100% rename from tests/coverage/match_or_pattern.coverage rename to tests/coverage/iffy/match_or_pattern.coverage diff --git a/tests/coverage/match_or_pattern.rs b/tests/coverage/iffy/match_or_pattern.rs similarity index 100% rename from tests/coverage/match_or_pattern.rs rename to tests/coverage/iffy/match_or_pattern.rs diff --git a/tests/coverage/nested_loops.cov-map b/tests/coverage/iffy/nested_loops.cov-map similarity index 66% rename from tests/coverage/nested_loops.cov-map rename to tests/coverage/iffy/nested_loops.cov-map index 598068714b9a1..4b380e95bcd09 100644 --- a/tests/coverage/nested_loops.cov-map +++ b/tests/coverage/iffy/nested_loops.cov-map @@ -1,5 +1,5 @@ Function name: nested_loops::main -Raw bytes (164): 0x[01, 01, 14, 07, 47, 05, 0d, 01, 11, 47, 05, 01, 11, 47, 05, 01, 11, 47, 05, 01, 11, 47, 05, 01, 11, 3f, 05, 01, 09, 4b, 3f, 05, 15, 01, 09, 47, 4b, 01, 11, 05, 15, 05, 01, 18, 01, 01, 01, 00, 0a, 01, 01, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1b, 05, 02, 13, 00, 20, 09, 01, 0d, 00, 12, 09, 00, 15, 00, 18, 09, 01, 0d, 00, 12, 09, 00, 15, 00, 18, 09, 01, 12, 00, 17, 0d, 01, 10, 00, 16, 02, 01, 11, 00, 16, 26, 01, 0d, 00, 0e, 26, 01, 0d, 00, 13, 26, 01, 0d, 00, 13, 26, 01, 10, 00, 16, 15, 01, 11, 00, 18, 15, 01, 14, 00, 1b, 2e, 01, 15, 00, 21, 36, 01, 18, 02, 12, 42, 03, 0d, 00, 0e, 4e, 02, 09, 00, 17, 01, 02, 01, 00, 02] +Raw bytes (144): 0x[01, 01, 14, 07, 47, 05, 0d, 01, 11, 47, 05, 01, 11, 47, 05, 01, 11, 47, 05, 01, 11, 47, 05, 01, 11, 3f, 05, 01, 09, 4b, 3f, 05, 15, 01, 09, 47, 4b, 01, 11, 05, 15, 05, 01, 14, 01, 01, 01, 00, 0a, 01, 01, 13, 00, 2e, 01, 01, 19, 00, 1b, 05, 02, 13, 00, 20, 09, 01, 15, 00, 18, 09, 01, 15, 00, 18, 09, 01, 12, 00, 17, 0d, 01, 10, 00, 16, 02, 00, 17, 02, 0e, 26, 02, 0d, 00, 0e, 26, 01, 0d, 00, 13, 26, 01, 0d, 00, 13, 26, 01, 10, 00, 16, 15, 01, 11, 00, 18, 15, 01, 14, 00, 1b, 2e, 00, 1c, 02, 12, 36, 02, 18, 02, 12, 42, 03, 0d, 00, 0e, 4e, 02, 09, 00, 17, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/nested_loops.rs Number of expressions: 20 @@ -23,22 +23,18 @@ Number of expressions: 20 - expression 17 operands: lhs = Counter(0), rhs = Counter(4) - expression 18 operands: lhs = Counter(1), rhs = Counter(5) - expression 19 operands: lhs = Counter(1), rhs = Counter(0) -Number of file 0 mappings: 24 +Number of file 0 mappings: 20 - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 1, 25) to (start + 0, 27) - Code(Counter(1)) at (prev + 2, 19) to (start + 0, 32) -- Code(Counter(2)) at (prev + 1, 13) to (start + 0, 18) -- Code(Counter(2)) at (prev + 0, 21) to (start + 0, 24) -- Code(Counter(2)) at (prev + 1, 13) to (start + 0, 18) -- Code(Counter(2)) at (prev + 0, 21) to (start + 0, 24) +- Code(Counter(2)) at (prev + 1, 21) to (start + 0, 24) +- Code(Counter(2)) at (prev + 1, 21) to (start + 0, 24) - Code(Counter(2)) at (prev + 1, 18) to (start + 0, 23) - Code(Counter(3)) at (prev + 1, 16) to (start + 0, 22) -- Code(Expression(0, Sub)) at (prev + 1, 17) to (start + 0, 22) +- Code(Expression(0, Sub)) at (prev + 0, 23) to (start + 2, 14) = ((c1 + c3) - (c0 + c4)) -- Code(Expression(9, Sub)) at (prev + 1, 13) to (start + 0, 14) +- Code(Expression(9, Sub)) at (prev + 2, 13) to (start + 0, 14) = ((c0 + c4) - c1) - Code(Expression(9, Sub)) at (prev + 1, 13) to (start + 0, 19) = ((c0 + c4) - c1) @@ -48,9 +44,9 @@ Number of file 0 mappings: 24 = ((c0 + c4) - c1) - Code(Counter(5)) at (prev + 1, 17) to (start + 0, 24) - Code(Counter(5)) at (prev + 1, 20) to (start + 0, 27) -- Code(Expression(11, Sub)) at (prev + 1, 21) to (start + 0, 33) +- Code(Expression(11, Sub)) at (prev + 0, 28) to (start + 2, 18) = ((c0 + c2) - c1) -- Code(Expression(13, Sub)) at (prev + 1, 24) to (start + 2, 18) +- Code(Expression(13, Sub)) at (prev + 2, 24) to (start + 2, 18) = ((c1 + c5) - (c0 + c2)) - Code(Expression(16, Sub)) at (prev + 3, 13) to (start + 0, 14) = ((c0 + c4) - (c1 + c5)) diff --git a/tests/coverage/nested_loops.coverage b/tests/coverage/iffy/nested_loops.coverage similarity index 95% rename from tests/coverage/nested_loops.coverage rename to tests/coverage/iffy/nested_loops.coverage index fbbec43309ed8..e103791f893ba 100644 --- a/tests/coverage/nested_loops.coverage +++ b/tests/coverage/iffy/nested_loops.coverage @@ -15,7 +15,7 @@ LL| 1| a -= 10; LL| 1| if is_true { LL| 1| break 'outer; - LL| 0| } else { + LL| 1| } else { LL| 0| a -= 2; LL| 0| } LL| 2| } diff --git a/tests/coverage/nested_loops.rs b/tests/coverage/iffy/nested_loops.rs similarity index 100% rename from tests/coverage/nested_loops.rs rename to tests/coverage/iffy/nested_loops.rs diff --git a/tests/coverage/no_cov_crate.cov-map b/tests/coverage/iffy/no_cov_crate.cov-map similarity index 61% rename from tests/coverage/no_cov_crate.cov-map rename to tests/coverage/iffy/no_cov_crate.cov-map index bdbce570b1964..8fec86b22026e 100644 --- a/tests/coverage/no_cov_crate.cov-map +++ b/tests/coverage/iffy/no_cov_crate.cov-map @@ -1,81 +1,80 @@ Function name: no_cov_crate::add_coverage_1 -Raw bytes (19): 0x[01, 01, 00, 03, 01, 16, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 16, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 22, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 22, 1) to (start + 0, 20) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 34) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: no_cov_crate::add_coverage_2 -Raw bytes (19): 0x[01, 01, 00, 03, 01, 1a, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 1a, 01, 00, 14, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 22, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 26, 1) to (start + 0, 20) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 34) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: no_cov_crate::add_coverage_not_called (unused) -Raw bytes (19): 0x[01, 01, 00, 03, 00, 1f, 01, 00, 1d, 00, 01, 05, 00, 0d, 00, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 00, 1f, 01, 00, 1d, 00, 01, 05, 00, 0d, 00, 00, 0e, 00, 26, 00, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Zero) at (prev + 31, 1) to (start + 0, 29) - Code(Zero) at (prev + 1, 5) to (start + 0, 13) +- Code(Zero) at (prev + 0, 14) to (start + 0, 38) - Code(Zero) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: (none) Function name: no_cov_crate::main -Raw bytes (74): 0x[01, 01, 00, 0e, 01, 4f, 01, 00, 0a, 01, 01, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 05, 00, 1a, 01, 01, 05, 00, 1a, 01, 01, 05, 00, 13, 01, 01, 05, 00, 13, 01, 02, 05, 00, 22, 01, 00, 23, 00, 2a, 01, 01, 05, 00, 16, 01, 00, 17, 00, 1e, 01, 01, 05, 00, 23, 01, 00, 24, 00, 2b, 01, 01, 01, 00, 02] +Raw bytes (54): 0x[01, 01, 00, 0a, 01, 4f, 01, 00, 0a, 01, 01, 13, 00, 2e, 01, 02, 05, 00, 1c, 01, 01, 05, 00, 1c, 01, 01, 05, 00, 15, 01, 01, 05, 00, 15, 01, 02, 05, 00, 2b, 01, 01, 05, 00, 1f, 01, 01, 05, 00, 2c, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 -Number of file 0 mappings: 14 +Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 79, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 26) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 19) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 19) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 34) -- Code(Counter(0)) at (prev + 0, 35) to (start + 0, 42) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 23) to (start + 0, 30) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 35) -- Code(Counter(0)) at (prev + 0, 36) to (start + 0, 43) +- Code(Counter(0)) at (prev + 1, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 28) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 28) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 21) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 21) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 43) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 31) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 44) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: no_cov_crate::nested_fns::outer -Raw bytes (29): 0x[01, 01, 00, 05, 01, 33, 05, 00, 20, 01, 01, 09, 00, 11, 01, 01, 09, 00, 1a, 01, 00, 1b, 00, 22, 01, 0a, 05, 00, 06] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 33, 05, 00, 20, 01, 01, 09, 00, 11, 01, 00, 12, 00, 26, 01, 01, 09, 00, 23, 01, 0a, 05, 00, 06] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 51, 5) to (start + 0, 32) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 26) -- Code(Counter(0)) at (prev + 0, 27) to (start + 0, 34) +- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 38) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 35) - Code(Counter(0)) at (prev + 10, 5) to (start + 0, 6) Highest counter ID seen: c0 Function name: no_cov_crate::nested_fns::outer_both_covered -Raw bytes (29): 0x[01, 01, 00, 05, 01, 41, 05, 00, 2d, 01, 01, 09, 00, 11, 01, 01, 09, 00, 0e, 01, 00, 0f, 00, 16, 01, 09, 05, 00, 06] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 41, 05, 00, 2d, 01, 01, 09, 00, 11, 01, 00, 12, 00, 26, 01, 01, 09, 00, 17, 01, 09, 05, 00, 06] Number of files: 1 - file 0 => $DIR/no_cov_crate.rs Number of expressions: 0 Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 65, 5) to (start + 0, 45) - Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 22) +- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 38) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 23) - Code(Counter(0)) at (prev + 9, 5) to (start + 0, 6) Highest counter ID seen: c0 diff --git a/tests/coverage/no_cov_crate.coverage b/tests/coverage/iffy/no_cov_crate.coverage similarity index 100% rename from tests/coverage/no_cov_crate.coverage rename to tests/coverage/iffy/no_cov_crate.coverage diff --git a/tests/coverage/no_cov_crate.rs b/tests/coverage/iffy/no_cov_crate.rs similarity index 100% rename from tests/coverage/no_cov_crate.rs rename to tests/coverage/iffy/no_cov_crate.rs diff --git a/tests/coverage/overflow.cov-map b/tests/coverage/iffy/overflow.cov-map similarity index 63% rename from tests/coverage/overflow.cov-map rename to tests/coverage/iffy/overflow.cov-map index 22a4ed0d49cd3..9e85f649bfe6b 100644 --- a/tests/coverage/overflow.cov-map +++ b/tests/coverage/iffy/overflow.cov-map @@ -1,5 +1,5 @@ Function name: overflow::main -Raw bytes (86): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 0e, 01, 10, 01, 00, 1c, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 03, 0a, 09, 01, 11, 00, 17, 06, 02, 13, 00, 20, 0d, 00, 21, 03, 0a, 0d, 01, 11, 00, 17, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (81): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 0d, 01, 10, 01, 00, 1c, 01, 01, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 03, 0a, 09, 01, 1a, 00, 2c, 06, 02, 13, 00, 20, 0d, 00, 21, 03, 0a, 0d, 01, 1a, 00, 2b, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/overflow.rs Number of expressions: 6 @@ -9,19 +9,18 @@ Number of expressions: 6 - expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) - expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3) - expression 5 operands: lhs = Counter(0), rhs = Counter(2) -Number of file 0 mappings: 14 +Number of file 0 mappings: 13 - Code(Counter(0)) at (prev + 16, 1) to (start + 0, 28) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 25) to (start + 0, 27) - Code(Counter(1)) at (prev + 1, 11) to (start + 0, 24) - Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 26) = (c1 - c0) - Code(Counter(2)) at (prev + 0, 27) to (start + 3, 10) -- Code(Counter(2)) at (prev + 1, 17) to (start + 0, 23) +- Code(Counter(2)) at (prev + 1, 26) to (start + 0, 44) - Code(Expression(1, Sub)) at (prev + 2, 19) to (start + 0, 32) = (c1 - (c0 + c2)) - Code(Counter(3)) at (prev + 0, 33) to (start + 3, 10) -- Code(Counter(3)) at (prev + 1, 17) to (start + 0, 23) +- Code(Counter(3)) at (prev + 1, 26) to (start + 0, 43) - Code(Expression(3, Sub)) at (prev + 2, 9) to (start + 0, 10) = (c1 - ((c0 + c2) + c3)) - Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 23) @@ -31,23 +30,24 @@ Number of file 0 mappings: 14 Highest counter ID seen: c3 Function name: overflow::might_overflow -Raw bytes (66): 0x[01, 01, 01, 01, 05, 0c, 01, 05, 01, 00, 26, 01, 01, 08, 00, 12, 05, 00, 13, 02, 06, 02, 02, 05, 00, 06, 01, 01, 09, 00, 0f, 01, 00, 12, 00, 1e, 01, 01, 05, 00, 0d, 01, 01, 09, 00, 0f, 01, 00, 12, 00, 21, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (71): 0x[01, 01, 01, 01, 05, 0d, 01, 05, 01, 00, 26, 01, 01, 08, 00, 12, 05, 00, 13, 02, 06, 02, 02, 05, 00, 06, 01, 01, 12, 00, 1e, 01, 01, 05, 00, 0d, 01, 00, 28, 00, 2e, 01, 00, 30, 00, 36, 01, 01, 12, 00, 21, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 2f, 01, 01, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/overflow.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 12 +Number of file 0 mappings: 13 - Code(Counter(0)) at (prev + 5, 1) to (start + 0, 38) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 18) - Code(Counter(1)) at (prev + 0, 19) to (start + 2, 6) - Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) = (c0 - c1) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) -- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 30) +- Code(Counter(0)) at (prev + 1, 18) to (start + 0, 30) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) -- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 33) +- Code(Counter(0)) at (prev + 0, 40) to (start + 0, 46) +- Code(Counter(0)) at (prev + 0, 48) to (start + 0, 54) +- Code(Counter(0)) at (prev + 1, 18) to (start + 0, 33) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 47) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c1 diff --git a/tests/coverage/overflow.coverage b/tests/coverage/iffy/overflow.coverage similarity index 100% rename from tests/coverage/overflow.coverage rename to tests/coverage/iffy/overflow.coverage diff --git a/tests/coverage/overflow.rs b/tests/coverage/iffy/overflow.rs similarity index 100% rename from tests/coverage/overflow.rs rename to tests/coverage/iffy/overflow.rs diff --git a/tests/coverage/panic_unwind.cov-map b/tests/coverage/iffy/panic_unwind.cov-map similarity index 72% rename from tests/coverage/panic_unwind.cov-map rename to tests/coverage/iffy/panic_unwind.cov-map index 42a3587786194..fad5f6f86d20c 100644 --- a/tests/coverage/panic_unwind.cov-map +++ b/tests/coverage/iffy/panic_unwind.cov-map @@ -1,5 +1,5 @@ Function name: panic_unwind::main -Raw bytes (76): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 0c, 01, 0d, 01, 00, 1c, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 02, 0a, 06, 02, 13, 00, 20, 0d, 00, 21, 02, 0a, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (71): 0x[01, 01, 06, 05, 01, 05, 17, 01, 09, 05, 13, 17, 0d, 01, 09, 0b, 01, 0d, 01, 00, 1c, 01, 01, 19, 00, 1b, 05, 01, 0b, 00, 18, 02, 01, 0c, 00, 1a, 09, 00, 1b, 02, 0a, 06, 02, 13, 00, 20, 0d, 00, 21, 02, 0a, 0e, 02, 09, 00, 0a, 02, 01, 09, 00, 17, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/panic_unwind.rs Number of expressions: 6 @@ -9,10 +9,9 @@ Number of expressions: 6 - expression 3 operands: lhs = Counter(1), rhs = Expression(4, Add) - expression 4 operands: lhs = Expression(5, Add), rhs = Counter(3) - expression 5 operands: lhs = Counter(0), rhs = Counter(2) -Number of file 0 mappings: 12 +Number of file 0 mappings: 11 - Code(Counter(0)) at (prev + 13, 1) to (start + 0, 28) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 25) to (start + 0, 27) - Code(Counter(1)) at (prev + 1, 11) to (start + 0, 24) - Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 0, 26) = (c1 - c0) @@ -29,7 +28,7 @@ Number of file 0 mappings: 12 Highest counter ID seen: c3 Function name: panic_unwind::might_panic -Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 04, 01, 00, 23, 01, 01, 08, 00, 14, 05, 01, 09, 00, 11, 05, 01, 09, 00, 0f, 02, 01, 0c, 02, 06, 02, 03, 01, 00, 02] +Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 04, 01, 00, 23, 01, 01, 08, 00, 14, 05, 00, 15, 03, 06, 05, 01, 09, 00, 11, 02, 02, 0c, 02, 06, 02, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/panic_unwind.rs Number of expressions: 1 @@ -37,9 +36,9 @@ Number of expressions: 1 Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 35) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 20) +- Code(Counter(1)) at (prev + 0, 21) to (start + 3, 6) - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15) -- Code(Expression(0, Sub)) at (prev + 1, 12) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 2, 6) = (c0 - c1) - Code(Expression(0, Sub)) at (prev + 3, 1) to (start + 0, 2) = (c0 - c1) diff --git a/tests/coverage/panic_unwind.coverage b/tests/coverage/iffy/panic_unwind.coverage similarity index 100% rename from tests/coverage/panic_unwind.coverage rename to tests/coverage/iffy/panic_unwind.coverage diff --git a/tests/coverage/panic_unwind.rs b/tests/coverage/iffy/panic_unwind.rs similarity index 100% rename from tests/coverage/panic_unwind.rs rename to tests/coverage/iffy/panic_unwind.rs diff --git a/tests/coverage/iffy/partial_eq.cov-map b/tests/coverage/iffy/partial_eq.cov-map new file mode 100644 index 0000000000000..ad07e2d6f5308 --- /dev/null +++ b/tests/coverage/iffy/partial_eq.cov-map @@ -0,0 +1,32 @@ +Function name: ::new +Raw bytes (24): 0x[01, 01, 00, 04, 01, 0e, 05, 00, 41, 01, 01, 09, 00, 25, 01, 00, 10, 00, 15, 01, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/partial_eq.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 14, 5) to (start + 0, 65) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 37) +- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 21) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: c0 + +Function name: partial_eq::main +Raw bytes (64): 0x[01, 01, 00, 0c, 01, 13, 01, 00, 0a, 01, 01, 19, 00, 2e, 01, 00, 19, 00, 25, 01, 00, 26, 00, 27, 01, 01, 19, 00, 2e, 01, 00, 19, 00, 25, 01, 00, 26, 00, 27, 01, 02, 05, 00, 0d, 01, 02, 09, 00, 16, 01, 01, 09, 00, 16, 01, 01, 09, 00, 26, 01, 02, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/partial_eq.rs +Number of expressions: 0 +Number of file 0 mappings: 12 +- Code(Counter(0)) at (prev + 19, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 25) to (start + 0, 46) +- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 37) +- Code(Counter(0)) at (prev + 0, 38) to (start + 0, 39) +- Code(Counter(0)) at (prev + 1, 25) to (start + 0, 46) +- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 37) +- Code(Counter(0)) at (prev + 0, 38) to (start + 0, 39) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 22) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 38) +- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/partial_eq.coverage b/tests/coverage/iffy/partial_eq.coverage similarity index 94% rename from tests/coverage/partial_eq.coverage rename to tests/coverage/iffy/partial_eq.coverage index 6efe6d71245e7..19e16535e27a6 100644 --- a/tests/coverage/partial_eq.coverage +++ b/tests/coverage/iffy/partial_eq.coverage @@ -1,3 +1,5 @@ + LL| |//@ min-llvm-version: 23 + LL| | LL| |// This test confirms an earlier problem was resolved, supporting the MIR graph generated by the LL| |// structure of this test. LL| | @@ -20,8 +22,8 @@ LL| | LL| 1| println!( LL| | "{:?} < {:?} = {}", - LL| | version_3_2_1, - LL| | version_3_3_0, + LL| 1| version_3_2_1, + LL| 1| version_3_3_0, LL| 1| version_3_2_1 < version_3_3_0, // LL| | ); LL| 1|} diff --git a/tests/coverage/partial_eq.rs b/tests/coverage/iffy/partial_eq.rs similarity index 98% rename from tests/coverage/partial_eq.rs rename to tests/coverage/iffy/partial_eq.rs index 081502d4a9d64..d81ecbd8b3b7e 100644 --- a/tests/coverage/partial_eq.rs +++ b/tests/coverage/iffy/partial_eq.rs @@ -1,3 +1,5 @@ +//@ min-llvm-version: 23 + // This test confirms an earlier problem was resolved, supporting the MIR graph generated by the // structure of this test. diff --git a/tests/coverage/simple_loop.cov-map b/tests/coverage/iffy/simple_loop.cov-map similarity index 52% rename from tests/coverage/simple_loop.cov-map rename to tests/coverage/iffy/simple_loop.cov-map index 5447ffdb6e7c7..dc1fee466b6b2 100644 --- a/tests/coverage/simple_loop.cov-map +++ b/tests/coverage/iffy/simple_loop.cov-map @@ -1,24 +1,22 @@ Function name: simple_loop::main -Raw bytes (75): 0x[01, 01, 03, 01, 05, 09, 01, 09, 01, 0d, 01, 04, 01, 00, 0a, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 09, 00, 16, 01, 00, 19, 00, 1a, 01, 03, 09, 00, 10, 05, 01, 05, 05, 06, 02, 05, 05, 00, 06, 09, 05, 0d, 02, 0e, 01, 04, 0d, 00, 12, 0a, 02, 09, 00, 0a, 0a, 01, 09, 02, 0a, 01, 05, 01, 00, 02] +Raw bytes (65): 0x[01, 01, 03, 01, 05, 09, 01, 09, 01, 0b, 01, 04, 01, 00, 0a, 01, 04, 13, 00, 2e, 01, 02, 19, 00, 1a, 01, 03, 09, 00, 10, 05, 01, 05, 05, 06, 02, 05, 05, 00, 06, 09, 05, 0d, 02, 0e, 01, 03, 09, 03, 0a, 0a, 03, 09, 00, 0a, 0a, 01, 09, 02, 0a, 01, 05, 01, 00, 02] Number of files: 1 - file 0 => $DIR/simple_loop.rs Number of expressions: 3 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) - expression 1 operands: lhs = Counter(2), rhs = Counter(0) - expression 2 operands: lhs = Counter(2), rhs = Counter(0) -Number of file 0 mappings: 13 +Number of file 0 mappings: 11 - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 26) +- Code(Counter(0)) at (prev + 4, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 2, 25) to (start + 0, 26) - Code(Counter(0)) at (prev + 3, 9) to (start + 0, 16) - Code(Counter(1)) at (prev + 1, 5) to (start + 5, 6) - Code(Expression(0, Sub)) at (prev + 5, 5) to (start + 0, 6) = (c0 - c1) - Code(Counter(2)) at (prev + 5, 13) to (start + 2, 14) -- Code(Counter(0)) at (prev + 4, 13) to (start + 0, 18) -- Code(Expression(2, Sub)) at (prev + 2, 9) to (start + 0, 10) +- Code(Counter(0)) at (prev + 3, 9) to (start + 3, 10) +- Code(Expression(2, Sub)) at (prev + 3, 9) to (start + 0, 10) = (c2 - c0) - Code(Expression(2, Sub)) at (prev + 1, 9) to (start + 2, 10) = (c2 - c0) diff --git a/tests/coverage/simple_loop.coverage b/tests/coverage/iffy/simple_loop.coverage similarity index 95% rename from tests/coverage/simple_loop.coverage rename to tests/coverage/iffy/simple_loop.coverage index a75263f633e55..39cadd18abac9 100644 --- a/tests/coverage/simple_loop.coverage +++ b/tests/coverage/iffy/simple_loop.coverage @@ -25,9 +25,9 @@ LL| 11| countdown LL| 11| == LL| 11| 0 - LL| | { + LL| 1| { LL| 1| break - LL| | ; + LL| 1| ; LL| 10| } LL| 10| countdown LL| 10| -= diff --git a/tests/coverage/simple_loop.rs b/tests/coverage/iffy/simple_loop.rs similarity index 100% rename from tests/coverage/simple_loop.rs rename to tests/coverage/iffy/simple_loop.rs diff --git a/tests/coverage/simple_match.cov-map b/tests/coverage/iffy/simple_match.cov-map similarity index 56% rename from tests/coverage/simple_match.cov-map rename to tests/coverage/iffy/simple_match.cov-map index bc5a7e7b4bef4..6a0119b515006 100644 --- a/tests/coverage/simple_match.cov-map +++ b/tests/coverage/iffy/simple_match.cov-map @@ -1,5 +1,5 @@ Function name: simple_match::main -Raw bytes (99): 0x[01, 01, 05, 01, 05, 09, 01, 09, 01, 09, 13, 01, 0d, 11, 01, 04, 01, 00, 0a, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 09, 00, 16, 01, 00, 19, 00, 1a, 01, 01, 08, 00, 0f, 05, 00, 10, 02, 06, 02, 02, 05, 00, 06, 01, 05, 09, 00, 0d, 0a, 05, 0d, 00, 16, 0d, 02, 0d, 00, 0e, 0a, 02, 11, 02, 12, 0d, 04, 0d, 07, 0e, 0d, 01, 11, 00, 1e, 0d, 02, 15, 00, 16, 0e, 07, 0d, 00, 0f, 01, 03, 01, 00, 02] +Raw bytes (84): 0x[01, 01, 05, 01, 05, 09, 01, 09, 01, 09, 13, 01, 0d, 0e, 01, 04, 01, 00, 0a, 01, 04, 13, 00, 2e, 01, 02, 19, 00, 1a, 01, 01, 08, 00, 0f, 05, 00, 10, 02, 06, 02, 02, 05, 00, 06, 01, 05, 09, 00, 0d, 0a, 05, 0d, 00, 16, 0a, 04, 11, 02, 12, 0d, 04, 0d, 07, 0e, 0d, 01, 11, 00, 1e, 0d, 02, 19, 00, 22, 0e, 07, 0d, 00, 0f, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/simple_match.rs Number of expressions: 5 @@ -8,12 +8,10 @@ Number of expressions: 5 - expression 2 operands: lhs = Counter(2), rhs = Counter(0) - expression 3 operands: lhs = Counter(2), rhs = Expression(4, Add) - expression 4 operands: lhs = Counter(0), rhs = Counter(3) -Number of file 0 mappings: 17 +Number of file 0 mappings: 14 - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 26) +- Code(Counter(0)) at (prev + 4, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 2, 25) to (start + 0, 26) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 15) - Code(Counter(1)) at (prev + 0, 16) to (start + 2, 6) - Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) @@ -21,12 +19,11 @@ Number of file 0 mappings: 17 - Code(Counter(0)) at (prev + 5, 9) to (start + 0, 13) - Code(Expression(2, Sub)) at (prev + 5, 13) to (start + 0, 22) = (c2 - c0) -- Code(Counter(3)) at (prev + 2, 13) to (start + 0, 14) -- Code(Expression(2, Sub)) at (prev + 2, 17) to (start + 2, 18) +- Code(Expression(2, Sub)) at (prev + 4, 17) to (start + 2, 18) = (c2 - c0) - Code(Counter(3)) at (prev + 4, 13) to (start + 7, 14) - Code(Counter(3)) at (prev + 1, 17) to (start + 0, 30) -- Code(Counter(3)) at (prev + 2, 21) to (start + 0, 22) +- Code(Counter(3)) at (prev + 2, 25) to (start + 0, 34) - Code(Expression(3, Sub)) at (prev + 7, 13) to (start + 0, 15) = (c2 - (c0 + c3)) - Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) diff --git a/tests/coverage/simple_match.coverage b/tests/coverage/iffy/simple_match.coverage similarity index 98% rename from tests/coverage/simple_match.coverage rename to tests/coverage/iffy/simple_match.coverage index bd3f81aa8a1eb..ebbc4b52659d4 100644 --- a/tests/coverage/simple_match.coverage +++ b/tests/coverage/iffy/simple_match.coverage @@ -23,7 +23,7 @@ LL| | match LL| 2| countdown LL| | { - LL| 1| x + LL| | x LL| | if LL| 2| x LL| 2| < diff --git a/tests/coverage/simple_match.rs b/tests/coverage/iffy/simple_match.rs similarity index 100% rename from tests/coverage/simple_match.rs rename to tests/coverage/iffy/simple_match.rs diff --git a/tests/coverage/try_error_result.cov-map b/tests/coverage/iffy/try_error_result.cov-map similarity index 51% rename from tests/coverage/try_error_result.cov-map rename to tests/coverage/iffy/try_error_result.cov-map index fa937cfb7755c..afea60ca58dad 100644 --- a/tests/coverage/try_error_result.cov-map +++ b/tests/coverage/iffy/try_error_result.cov-map @@ -1,5 +1,5 @@ Function name: ::get_thing_2 -Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 29, 05, 00, 44, 01, 01, 0c, 00, 18, 05, 01, 0d, 00, 14, 02, 02, 0d, 00, 1a, 01, 02, 05, 00, 06] +Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 29, 05, 00, 44, 01, 01, 0c, 00, 18, 05, 00, 19, 02, 0a, 02, 02, 10, 02, 0a, 01, 03, 05, 00, 06] Number of files: 1 - file 0 => $DIR/try_error_result.rs Number of expressions: 1 @@ -7,14 +7,14 @@ Number of expressions: 1 Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 41, 5) to (start + 0, 68) - Code(Counter(0)) at (prev + 1, 12) to (start + 0, 24) -- Code(Counter(1)) at (prev + 1, 13) to (start + 0, 20) -- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 26) +- Code(Counter(1)) at (prev + 0, 25) to (start + 2, 10) +- Code(Expression(0, Sub)) at (prev + 2, 16) to (start + 2, 10) = (c0 - c1) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 6) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 6) Highest counter ID seen: c1 Function name: ::call -Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 34, 05, 00, 3a, 01, 01, 0c, 00, 18, 05, 01, 0d, 00, 14, 02, 02, 0d, 00, 13, 01, 02, 05, 00, 06] +Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 34, 05, 00, 3a, 01, 01, 0c, 00, 18, 05, 00, 19, 02, 0a, 02, 02, 10, 02, 0a, 01, 03, 05, 00, 06] Number of files: 1 - file 0 => $DIR/try_error_result.rs Number of expressions: 1 @@ -22,14 +22,14 @@ Number of expressions: 1 Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 52, 5) to (start + 0, 58) - Code(Counter(0)) at (prev + 1, 12) to (start + 0, 24) -- Code(Counter(1)) at (prev + 1, 13) to (start + 0, 20) -- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 19) +- Code(Counter(1)) at (prev + 0, 25) to (start + 2, 10) +- Code(Expression(0, Sub)) at (prev + 2, 16) to (start + 2, 10) = (c0 - c1) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 6) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 6) Highest counter ID seen: c1 Function name: try_error_result::call -Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 05, 01, 00, 2e, 01, 01, 08, 00, 14, 05, 01, 09, 00, 10, 02, 02, 09, 00, 0f, 01, 02, 01, 00, 02] +Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 05, 01, 00, 2e, 01, 01, 08, 00, 14, 05, 00, 15, 02, 06, 02, 02, 0c, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/try_error_result.rs Number of expressions: 1 @@ -37,24 +37,22 @@ Number of expressions: 1 Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 5, 1) to (start + 0, 46) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 20) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 16) -- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 15) +- Code(Counter(1)) at (prev + 0, 21) to (start + 2, 6) +- Code(Expression(0, Sub)) at (prev + 2, 12) to (start + 2, 6) = (c0 - c1) -- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) Highest counter ID seen: c1 Function name: try_error_result::main -Raw bytes (46): 0x[01, 01, 01, 01, 05, 08, 01, 71, 01, 00, 1c, 01, 01, 05, 00, 0a, 01, 00, 0d, 00, 17, 01, 00, 18, 00, 2b, 01, 01, 05, 00, 0a, 05, 01, 05, 00, 06, 02, 02, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (36): 0x[01, 01, 01, 01, 05, 06, 01, 71, 01, 00, 1c, 01, 01, 05, 00, 2c, 01, 01, 05, 00, 0c, 05, 01, 05, 00, 06, 02, 02, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/try_error_result.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 8 +Number of file 0 mappings: 6 - Code(Counter(0)) at (prev + 113, 1) to (start + 0, 28) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 23) -- Code(Counter(0)) at (prev + 0, 24) to (start + 0, 43) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 44) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 12) - Code(Counter(1)) at (prev + 1, 5) to (start + 0, 6) - Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 11) = (c0 - c1) @@ -62,7 +60,7 @@ Number of file 0 mappings: 8 Highest counter ID seen: c1 Function name: try_error_result::test1 -Raw bytes (82): 0x[01, 01, 04, 07, 09, 01, 05, 09, 01, 09, 05, 0e, 01, 0d, 01, 00, 1d, 01, 01, 09, 01, 12, 01, 01, 15, 00, 17, 01, 05, 09, 00, 0e, 05, 02, 09, 01, 11, 05, 04, 0d, 00, 1a, 02, 02, 0d, 00, 11, 02, 00, 29, 00, 2a, 00, 01, 0d, 00, 11, 00, 00, 2a, 00, 2b, 0a, 04, 0d, 00, 11, 00, 00, 2a, 00, 2b, 0e, 03, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (77): 0x[01, 01, 04, 07, 09, 01, 05, 09, 01, 09, 05, 0d, 01, 0d, 01, 00, 1d, 01, 02, 15, 00, 17, 01, 05, 09, 00, 0e, 05, 02, 09, 01, 11, 05, 04, 0d, 00, 1a, 02, 02, 0d, 00, 29, 02, 00, 29, 00, 2a, 00, 01, 0d, 00, 2a, 00, 00, 2a, 00, 2b, 0a, 04, 0d, 00, 2a, 00, 00, 2a, 00, 2b, 0e, 03, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/try_error_result.rs Number of expressions: 4 @@ -70,20 +68,19 @@ Number of expressions: 4 - expression 1 operands: lhs = Counter(0), rhs = Counter(1) - expression 2 operands: lhs = Counter(2), rhs = Counter(0) - expression 3 operands: lhs = Counter(2), rhs = Counter(1) -Number of file 0 mappings: 14 +Number of file 0 mappings: 13 - Code(Counter(0)) at (prev + 13, 1) to (start + 0, 29) -- Code(Counter(0)) at (prev + 1, 9) to (start + 1, 18) -- Code(Counter(0)) at (prev + 1, 21) to (start + 0, 23) +- Code(Counter(0)) at (prev + 2, 21) to (start + 0, 23) - Code(Counter(0)) at (prev + 5, 9) to (start + 0, 14) - Code(Counter(1)) at (prev + 2, 9) to (start + 1, 17) - Code(Counter(1)) at (prev + 4, 13) to (start + 0, 26) -- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 17) +- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 41) = ((c0 + c1) - c2) - Code(Expression(0, Sub)) at (prev + 0, 41) to (start + 0, 42) = ((c0 + c1) - c2) -- Code(Zero) at (prev + 1, 13) to (start + 0, 17) +- Code(Zero) at (prev + 1, 13) to (start + 0, 42) - Code(Zero) at (prev + 0, 42) to (start + 0, 43) -- Code(Expression(2, Sub)) at (prev + 4, 13) to (start + 0, 17) +- Code(Expression(2, Sub)) at (prev + 4, 13) to (start + 0, 42) = (c2 - c0) - Code(Zero) at (prev + 0, 42) to (start + 0, 43) - Code(Expression(3, Sub)) at (prev + 3, 5) to (start + 0, 11) @@ -92,7 +89,7 @@ Number of file 0 mappings: 14 Highest counter ID seen: c1 Function name: try_error_result::test2 -Raw bytes (325): 0x[01, 01, 12, 07, 09, 01, 05, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 05, 39, 01, 3d, 01, 00, 1d, 01, 01, 09, 00, 0f, 01, 00, 12, 00, 1a, 01, 01, 09, 01, 12, 01, 01, 15, 00, 17, 01, 05, 09, 00, 0e, 05, 02, 09, 01, 11, 05, 04, 0d, 00, 1a, 02, 02, 0d, 00, 13, 02, 00, 14, 00, 1f, 00, 00, 2f, 00, 30, 02, 00, 31, 00, 35, 02, 00, 45, 00, 4f, 02, 00, 50, 00, 62, 02, 01, 0d, 00, 13, 02, 02, 11, 00, 1c, 00, 01, 11, 00, 12, 02, 02, 11, 00, 15, 02, 02, 11, 00, 1b, 02, 01, 15, 00, 27, 00, 02, 11, 00, 14, 02, 00, 17, 00, 1d, 02, 00, 1e, 00, 29, 02, 00, 41, 00, 42, 00, 00, 43, 00, 47, 00, 00, 5f, 00, 60, 00, 01, 0d, 00, 17, 00, 01, 11, 00, 14, 00, 00, 17, 00, 1d, 00, 00, 1e, 00, 29, 00, 00, 41, 00, 42, 00, 00, 43, 00, 47, 00, 00, 60, 00, 61, 00, 01, 0d, 00, 17, 42, 04, 11, 00, 14, 42, 00, 17, 00, 1d, 42, 00, 1e, 00, 29, 00, 00, 42, 00, 43, 42, 00, 44, 00, 48, 00, 00, 61, 00, 62, 42, 01, 0d, 00, 17, 42, 01, 11, 00, 14, 42, 00, 17, 00, 1d, 42, 01, 12, 00, 1d, 00, 00, 36, 00, 37, 42, 01, 12, 00, 16, 00, 00, 2f, 00, 30, 42, 01, 0d, 00, 17, 42, 01, 11, 00, 14, 42, 00, 17, 00, 1d, 42, 01, 12, 00, 1d, 00, 01, 11, 00, 12, 42, 01, 12, 00, 16, 00, 01, 11, 00, 12, 42, 02, 0d, 00, 17, 46, 03, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (295): 0x[01, 01, 12, 07, 09, 01, 05, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 01, 09, 05, 33, 01, 3d, 01, 00, 1d, 01, 01, 12, 00, 1a, 01, 02, 15, 00, 17, 01, 05, 09, 00, 0e, 05, 02, 09, 01, 11, 05, 04, 0d, 00, 1a, 02, 02, 0d, 00, 2f, 00, 00, 2f, 00, 30, 02, 00, 3f, 00, 43, 02, 00, 50, 00, 62, 02, 01, 0d, 02, 35, 00, 03, 11, 00, 12, 02, 02, 28, 00, 2c, 02, 03, 15, 00, 27, 02, 02, 17, 00, 41, 02, 00, 41, 00, 42, 00, 00, 5a, 00, 5e, 00, 00, 5f, 00, 60, 00, 01, 0d, 00, 17, 00, 00, 18, 00, 1b, 00, 00, 1d, 00, 1f, 00, 01, 17, 00, 41, 00, 00, 41, 00, 42, 00, 00, 5a, 00, 5f, 00, 00, 60, 00, 61, 00, 01, 0d, 00, 17, 00, 00, 18, 00, 1b, 00, 00, 1d, 00, 1f, 42, 04, 17, 00, 42, 00, 00, 42, 00, 43, 42, 00, 5b, 00, 60, 00, 00, 61, 00, 62, 42, 01, 0d, 00, 17, 42, 00, 18, 00, 1b, 42, 00, 1d, 00, 1f, 42, 01, 17, 01, 36, 00, 01, 36, 00, 37, 42, 01, 29, 00, 2e, 00, 00, 2f, 00, 30, 42, 01, 0d, 00, 17, 42, 00, 18, 00, 1b, 42, 00, 1d, 00, 1f, 42, 01, 17, 01, 36, 00, 02, 11, 00, 12, 42, 01, 29, 00, 2e, 00, 01, 11, 00, 12, 42, 02, 0d, 00, 17, 42, 00, 18, 00, 1b, 42, 00, 1d, 00, 1f, 46, 03, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/try_error_result.rs Number of expressions: 18 @@ -114,90 +111,79 @@ Number of expressions: 18 - expression 15 operands: lhs = Counter(2), rhs = Counter(0) - expression 16 operands: lhs = Counter(2), rhs = Counter(0) - expression 17 operands: lhs = Counter(2), rhs = Counter(1) -Number of file 0 mappings: 57 +Number of file 0 mappings: 51 - Code(Counter(0)) at (prev + 61, 1) to (start + 0, 29) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) -- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 26) -- Code(Counter(0)) at (prev + 1, 9) to (start + 1, 18) -- Code(Counter(0)) at (prev + 1, 21) to (start + 0, 23) +- Code(Counter(0)) at (prev + 1, 18) to (start + 0, 26) +- Code(Counter(0)) at (prev + 2, 21) to (start + 0, 23) - Code(Counter(0)) at (prev + 5, 9) to (start + 0, 14) - Code(Counter(1)) at (prev + 2, 9) to (start + 1, 17) - Code(Counter(1)) at (prev + 4, 13) to (start + 0, 26) -- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 19) - = ((c0 + c1) - c2) -- Code(Expression(0, Sub)) at (prev + 0, 20) to (start + 0, 31) +- Code(Expression(0, Sub)) at (prev + 2, 13) to (start + 0, 47) = ((c0 + c1) - c2) - Code(Zero) at (prev + 0, 47) to (start + 0, 48) -- Code(Expression(0, Sub)) at (prev + 0, 49) to (start + 0, 53) - = ((c0 + c1) - c2) -- Code(Expression(0, Sub)) at (prev + 0, 69) to (start + 0, 79) +- Code(Expression(0, Sub)) at (prev + 0, 63) to (start + 0, 67) = ((c0 + c1) - c2) - Code(Expression(0, Sub)) at (prev + 0, 80) to (start + 0, 98) = ((c0 + c1) - c2) -- Code(Expression(0, Sub)) at (prev + 1, 13) to (start + 0, 19) - = ((c0 + c1) - c2) -- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 28) - = ((c0 + c1) - c2) -- Code(Zero) at (prev + 1, 17) to (start + 0, 18) -- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 21) - = ((c0 + c1) - c2) -- Code(Expression(0, Sub)) at (prev + 2, 17) to (start + 0, 27) +- Code(Expression(0, Sub)) at (prev + 1, 13) to (start + 2, 53) = ((c0 + c1) - c2) -- Code(Expression(0, Sub)) at (prev + 1, 21) to (start + 0, 39) +- Code(Zero) at (prev + 3, 17) to (start + 0, 18) +- Code(Expression(0, Sub)) at (prev + 2, 40) to (start + 0, 44) = ((c0 + c1) - c2) -- Code(Zero) at (prev + 2, 17) to (start + 0, 20) -- Code(Expression(0, Sub)) at (prev + 0, 23) to (start + 0, 29) +- Code(Expression(0, Sub)) at (prev + 3, 21) to (start + 0, 39) = ((c0 + c1) - c2) -- Code(Expression(0, Sub)) at (prev + 0, 30) to (start + 0, 41) +- Code(Expression(0, Sub)) at (prev + 2, 23) to (start + 0, 65) = ((c0 + c1) - c2) - Code(Expression(0, Sub)) at (prev + 0, 65) to (start + 0, 66) = ((c0 + c1) - c2) -- Code(Zero) at (prev + 0, 67) to (start + 0, 71) +- Code(Zero) at (prev + 0, 90) to (start + 0, 94) - Code(Zero) at (prev + 0, 95) to (start + 0, 96) - Code(Zero) at (prev + 1, 13) to (start + 0, 23) -- Code(Zero) at (prev + 1, 17) to (start + 0, 20) -- Code(Zero) at (prev + 0, 23) to (start + 0, 29) -- Code(Zero) at (prev + 0, 30) to (start + 0, 41) +- Code(Zero) at (prev + 0, 24) to (start + 0, 27) +- Code(Zero) at (prev + 0, 29) to (start + 0, 31) +- Code(Zero) at (prev + 1, 23) to (start + 0, 65) - Code(Zero) at (prev + 0, 65) to (start + 0, 66) -- Code(Zero) at (prev + 0, 67) to (start + 0, 71) +- Code(Zero) at (prev + 0, 90) to (start + 0, 95) - Code(Zero) at (prev + 0, 96) to (start + 0, 97) - Code(Zero) at (prev + 1, 13) to (start + 0, 23) -- Code(Expression(16, Sub)) at (prev + 4, 17) to (start + 0, 20) - = (c2 - c0) -- Code(Expression(16, Sub)) at (prev + 0, 23) to (start + 0, 29) - = (c2 - c0) -- Code(Expression(16, Sub)) at (prev + 0, 30) to (start + 0, 41) +- Code(Zero) at (prev + 0, 24) to (start + 0, 27) +- Code(Zero) at (prev + 0, 29) to (start + 0, 31) +- Code(Expression(16, Sub)) at (prev + 4, 23) to (start + 0, 66) = (c2 - c0) - Code(Zero) at (prev + 0, 66) to (start + 0, 67) -- Code(Expression(16, Sub)) at (prev + 0, 68) to (start + 0, 72) +- Code(Expression(16, Sub)) at (prev + 0, 91) to (start + 0, 96) = (c2 - c0) - Code(Zero) at (prev + 0, 97) to (start + 0, 98) - Code(Expression(16, Sub)) at (prev + 1, 13) to (start + 0, 23) = (c2 - c0) -- Code(Expression(16, Sub)) at (prev + 1, 17) to (start + 0, 20) +- Code(Expression(16, Sub)) at (prev + 0, 24) to (start + 0, 27) = (c2 - c0) -- Code(Expression(16, Sub)) at (prev + 0, 23) to (start + 0, 29) +- Code(Expression(16, Sub)) at (prev + 0, 29) to (start + 0, 31) = (c2 - c0) -- Code(Expression(16, Sub)) at (prev + 1, 18) to (start + 0, 29) +- Code(Expression(16, Sub)) at (prev + 1, 23) to (start + 1, 54) = (c2 - c0) -- Code(Zero) at (prev + 0, 54) to (start + 0, 55) -- Code(Expression(16, Sub)) at (prev + 1, 18) to (start + 0, 22) +- Code(Zero) at (prev + 1, 54) to (start + 0, 55) +- Code(Expression(16, Sub)) at (prev + 1, 41) to (start + 0, 46) = (c2 - c0) - Code(Zero) at (prev + 0, 47) to (start + 0, 48) - Code(Expression(16, Sub)) at (prev + 1, 13) to (start + 0, 23) = (c2 - c0) -- Code(Expression(16, Sub)) at (prev + 1, 17) to (start + 0, 20) +- Code(Expression(16, Sub)) at (prev + 0, 24) to (start + 0, 27) = (c2 - c0) -- Code(Expression(16, Sub)) at (prev + 0, 23) to (start + 0, 29) +- Code(Expression(16, Sub)) at (prev + 0, 29) to (start + 0, 31) = (c2 - c0) -- Code(Expression(16, Sub)) at (prev + 1, 18) to (start + 0, 29) +- Code(Expression(16, Sub)) at (prev + 1, 23) to (start + 1, 54) = (c2 - c0) -- Code(Zero) at (prev + 1, 17) to (start + 0, 18) -- Code(Expression(16, Sub)) at (prev + 1, 18) to (start + 0, 22) +- Code(Zero) at (prev + 2, 17) to (start + 0, 18) +- Code(Expression(16, Sub)) at (prev + 1, 41) to (start + 0, 46) = (c2 - c0) - Code(Zero) at (prev + 1, 17) to (start + 0, 18) - Code(Expression(16, Sub)) at (prev + 2, 13) to (start + 0, 23) = (c2 - c0) +- Code(Expression(16, Sub)) at (prev + 0, 24) to (start + 0, 27) + = (c2 - c0) +- Code(Expression(16, Sub)) at (prev + 0, 29) to (start + 0, 31) + = (c2 - c0) - Code(Expression(17, Sub)) at (prev + 3, 5) to (start + 0, 11) = (c2 - c1) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) diff --git a/tests/coverage/try_error_result.coverage b/tests/coverage/iffy/try_error_result.coverage similarity index 91% rename from tests/coverage/try_error_result.coverage rename to tests/coverage/iffy/try_error_result.coverage index 193c92cad48fe..f20824bea92e6 100644 --- a/tests/coverage/try_error_result.coverage +++ b/tests/coverage/iffy/try_error_result.coverage @@ -5,13 +5,13 @@ LL| 6|fn call(return_error: bool) -> Result<(), ()> { LL| 6| if return_error { LL| 1| Err(()) - LL| | } else { + LL| 5| } else { LL| 5| Ok(()) - LL| | } + LL| 5| } LL| 6|} LL| | LL| 1|fn test1() -> Result<(), ()> { - LL| 1| let mut + LL| | let mut LL| 1| countdown = 10 LL| | ; LL| | for @@ -42,9 +42,9 @@ LL| 18| fn get_thing_2(&self, return_error: bool) -> Result { LL| 18| if return_error { LL| 1| Err(()) - LL| | } else { + LL| 17| } else { LL| 17| Ok(Thing2 {}) - LL| | } + LL| 17| } LL| 18| } LL| |} LL| | @@ -53,15 +53,15 @@ LL| 17| fn call(&self, return_error: bool) -> Result { LL| 17| if return_error { LL| 2| Err(()) - LL| | } else { + LL| 15| } else { LL| 15| Ok(57) - LL| | } + LL| 15| } LL| 17| } LL| |} LL| | LL| 1|fn test2() -> Result<(), ()> { LL| 1| let thing1 = Thing1{}; - LL| 1| let mut + LL| | let mut LL| 1| countdown = 10 LL| | ; LL| | for @@ -78,17 +78,17 @@ LL| 1| thing1.get_thing_2(/*err=*/ false)?.call(/*err=*/ true).expect_err("call should fail"); ^0 LL| 1| thing1 - LL| | . + LL| 1| . LL| 1| get_thing_2(/*return_error=*/ false) LL| 0| ? LL| | . LL| 1| call(/*return_error=*/ true) LL| | . - LL| 1| expect_err( + LL| | expect_err( LL| 1| "call should fail" LL| | ); LL| 1| let val = thing1.get_thing_2(/*return_error=*/ true)?.call(/*return_error=*/ true)?; - ^0 ^0 ^0 + ^0 ^0 LL| 0| assert_eq!(val, 57); LL| 0| let val = thing1.get_thing_2(/*return_error=*/ true)?.call(/*return_error=*/ false)?; LL| 0| assert_eq!(val, 57); diff --git a/tests/coverage/try_error_result.rs b/tests/coverage/iffy/try_error_result.rs similarity index 100% rename from tests/coverage/try_error_result.rs rename to tests/coverage/iffy/try_error_result.rs diff --git a/tests/coverage/uses_crate.cov-map b/tests/coverage/iffy/uses_crate.cov-map similarity index 51% rename from tests/coverage/uses_crate.cov-map rename to tests/coverage/iffy/uses_crate.cov-map index fd65fa03dcdb6..92dc4d3301960 100644 --- a/tests/coverage/uses_crate.cov-map +++ b/tests/coverage/iffy/uses_crate.cov-map @@ -1,63 +1,68 @@ Function name: used_crate::used_from_bin_crate_and_lib_crate_generic_function::> -Raw bytes (19): 0x[01, 01, 00, 03, 01, 1b, 01, 00, 4c, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 1b, 01, 00, 4c, 01, 01, 05, 00, 0d, 01, 00, 48, 00, 4b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auxiliary/used_crate.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 27, 1) to (start + 0, 76) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 72) to (start + 0, 75) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: used_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec> -Raw bytes (19): 0x[01, 01, 00, 03, 01, 13, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 13, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 00, 3f, 00, 42, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auxiliary/used_crate.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 19, 1) to (start + 0, 67) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 63) to (start + 0, 66) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: used_crate::used_only_from_bin_crate_generic_function::<&str> -Raw bytes (19): 0x[01, 01, 00, 03, 01, 13, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 13, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 00, 3f, 00, 42, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auxiliary/used_crate.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 19, 1) to (start + 0, 67) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 63) to (start + 0, 66) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: used_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function::<&str> -Raw bytes (19): 0x[01, 01, 00, 03, 01, 1f, 01, 00, 5b, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 1f, 01, 00, 5b, 01, 01, 05, 00, 0d, 01, 00, 57, 00, 5a, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auxiliary/used_crate.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 31, 1) to (start + 0, 91) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 87) to (start + 0, 90) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: uses_crate::main -Raw bytes (59): 0x[01, 02, 00, 0b, 01, 0c, 01, 00, 0a, 01, 01, 05, 00, 1e, 01, 01, 09, 00, 11, 01, 00, 14, 00, 18, 01, 01, 05, 00, 3a, 01, 00, 3b, 00, 44, 01, 01, 05, 00, 3a, 01, 01, 05, 00, 43, 01, 00, 44, 00, 4c, 01, 01, 05, 00, 52, 01, 01, 01, 00, 02] +Raw bytes (64): 0x[01, 02, 00, 0c, 01, 0c, 01, 00, 0a, 01, 01, 05, 00, 20, 01, 01, 14, 00, 18, 01, 00, 19, 00, 1a, 01, 00, 1c, 00, 1d, 01, 00, 1f, 00, 20, 01, 00, 22, 00, 23, 01, 01, 05, 00, 45, 01, 01, 05, 00, 59, 01, 01, 05, 00, 4d, 01, 01, 05, 00, 62, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/uses_crate.rs Number of expressions: 0 -Number of file 0 mappings: 11 +Number of file 0 mappings: 12 - Code(Counter(0)) at (prev + 12, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 30) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 24) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 58) -- Code(Counter(0)) at (prev + 0, 59) to (start + 0, 68) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 58) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 67) -- Code(Counter(0)) at (prev + 0, 68) to (start + 0, 76) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 82) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 32) +- Code(Counter(0)) at (prev + 1, 20) to (start + 0, 24) +- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 26) +- Code(Counter(0)) at (prev + 0, 28) to (start + 0, 29) +- Code(Counter(0)) at (prev + 0, 31) to (start + 0, 32) +- Code(Counter(0)) at (prev + 0, 34) to (start + 0, 35) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 69) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 89) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 77) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 98) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/uses_crate.coverage b/tests/coverage/iffy/uses_crate.coverage similarity index 99% rename from tests/coverage/uses_crate.coverage rename to tests/coverage/iffy/uses_crate.coverage index 145c0649ac7b9..be758f5b6746c 100644 --- a/tests/coverage/uses_crate.coverage +++ b/tests/coverage/iffy/uses_crate.coverage @@ -104,8 +104,8 @@ $DIR/auxiliary/used_crate.rs: LL| 1|fn use_this_lib_crate() { LL| 1| used_from_bin_crate_and_lib_crate_generic_function("used from library used_crate.rs"); LL| 1| used_with_same_type_from_bin_crate_and_lib_crate_generic_function( - LL| | "used from library used_crate.rs", - LL| | ); + LL| 1| "used from library used_crate.rs", + LL| 1| ); LL| 1| let some_vec = vec![5, 6, 7, 8]; LL| 1| used_only_from_this_lib_crate_generic_function(some_vec); LL| 1| used_only_from_this_lib_crate_generic_function("used ONLY from library used_crate.rs"); diff --git a/tests/coverage/uses_crate.rs b/tests/coverage/iffy/uses_crate.rs similarity index 100% rename from tests/coverage/uses_crate.rs rename to tests/coverage/iffy/uses_crate.rs diff --git a/tests/coverage/uses_inline_crate.cov-map b/tests/coverage/iffy/uses_inline_crate.cov-map similarity index 53% rename from tests/coverage/uses_inline_crate.cov-map rename to tests/coverage/iffy/uses_inline_crate.cov-map index 863f6df7adb71..10d905f8bdde1 100644 --- a/tests/coverage/uses_inline_crate.cov-map +++ b/tests/coverage/iffy/uses_inline_crate.cov-map @@ -1,84 +1,87 @@ Function name: used_inline_crate::used_from_bin_crate_and_lib_crate_generic_function::> -Raw bytes (19): 0x[01, 01, 00, 03, 01, 2c, 01, 00, 4c, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 2c, 01, 00, 4c, 01, 01, 05, 00, 0d, 01, 00, 48, 00, 4b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auxiliary/used_inline_crate.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 44, 1) to (start + 0, 76) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 72) to (start + 0, 75) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: used_inline_crate::used_inline_function -Raw bytes (56): 0x[01, 01, 01, 01, 05, 0a, 01, 14, 01, 00, 1e, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1a, 01, 01, 08, 00, 0f, 05, 00, 10, 02, 06, 02, 02, 05, 00, 06, 01, 01, 05, 00, 17, 01, 01, 01, 00, 02] +Raw bytes (46): 0x[01, 01, 01, 01, 05, 08, 01, 14, 01, 00, 1e, 01, 04, 13, 00, 2e, 01, 01, 19, 00, 1a, 01, 01, 08, 00, 0f, 05, 00, 10, 02, 06, 02, 02, 05, 00, 06, 01, 01, 05, 00, 19, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auxiliary/used_inline_crate.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 10 +Number of file 0 mappings: 8 - Code(Counter(0)) at (prev + 20, 1) to (start + 0, 30) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 26) +- Code(Counter(0)) at (prev + 4, 19) to (start + 0, 46) +- Code(Counter(0)) at (prev + 1, 25) to (start + 0, 26) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 15) - Code(Counter(1)) at (prev + 0, 16) to (start + 2, 6) - Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) = (c0 - c1) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 23) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 25) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c1 Function name: used_inline_crate::used_only_from_bin_crate_generic_function::<&alloc::vec::Vec> -Raw bytes (19): 0x[01, 01, 00, 03, 01, 21, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 21, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 00, 3f, 00, 42, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auxiliary/used_inline_crate.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 33, 1) to (start + 0, 67) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 63) to (start + 0, 66) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: used_inline_crate::used_only_from_bin_crate_generic_function::<&str> -Raw bytes (19): 0x[01, 01, 00, 03, 01, 21, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 21, 01, 00, 43, 01, 01, 05, 00, 0d, 01, 00, 3f, 00, 42, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auxiliary/used_inline_crate.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 33, 1) to (start + 0, 67) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 63) to (start + 0, 66) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: used_inline_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function::<&str> -Raw bytes (19): 0x[01, 01, 00, 03, 01, 31, 01, 00, 5b, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 31, 01, 00, 5b, 01, 01, 05, 00, 0d, 01, 00, 57, 00, 5a, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auxiliary/used_inline_crate.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 49, 1) to (start + 0, 91) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 87) to (start + 0, 90) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: uses_inline_crate::main -Raw bytes (64): 0x[01, 02, 00, 0c, 01, 0c, 01, 00, 0a, 01, 01, 05, 00, 25, 01, 01, 05, 00, 2c, 01, 01, 09, 00, 11, 01, 00, 14, 00, 18, 01, 01, 05, 00, 41, 01, 00, 42, 00, 4b, 01, 01, 05, 00, 41, 01, 01, 05, 00, 4a, 01, 00, 4b, 00, 53, 01, 01, 05, 00, 59, 01, 03, 01, 00, 02] +Raw bytes (69): 0x[01, 02, 00, 0d, 01, 0c, 01, 00, 0a, 01, 01, 05, 00, 27, 01, 01, 05, 00, 2e, 01, 01, 14, 00, 18, 01, 00, 19, 00, 1a, 01, 00, 1c, 00, 1d, 01, 00, 1f, 00, 20, 01, 00, 22, 00, 23, 01, 01, 05, 00, 4c, 01, 01, 05, 00, 60, 01, 01, 05, 00, 54, 01, 01, 05, 02, 06, 01, 03, 01, 00, 02] Number of files: 1 - file 0 => $DIR/uses_inline_crate.rs Number of expressions: 0 -Number of file 0 mappings: 12 +Number of file 0 mappings: 13 - Code(Counter(0)) at (prev + 12, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 37) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 44) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 24) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 65) -- Code(Counter(0)) at (prev + 0, 66) to (start + 0, 75) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 65) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 74) -- Code(Counter(0)) at (prev + 0, 75) to (start + 0, 83) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 89) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 39) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 46) +- Code(Counter(0)) at (prev + 1, 20) to (start + 0, 24) +- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 26) +- Code(Counter(0)) at (prev + 0, 28) to (start + 0, 29) +- Code(Counter(0)) at (prev + 0, 31) to (start + 0, 32) +- Code(Counter(0)) at (prev + 0, 34) to (start + 0, 35) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 76) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 96) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 84) +- Code(Counter(0)) at (prev + 1, 5) to (start + 2, 6) - Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/uses_inline_crate.coverage b/tests/coverage/iffy/uses_inline_crate.coverage similarity index 98% rename from tests/coverage/uses_inline_crate.coverage rename to tests/coverage/iffy/uses_inline_crate.coverage index 15084bcf7ea98..eb3e189031273 100644 --- a/tests/coverage/uses_inline_crate.coverage +++ b/tests/coverage/iffy/uses_inline_crate.coverage @@ -126,8 +126,8 @@ $DIR/auxiliary/used_inline_crate.rs: LL| 2|fn use_this_lib_crate() { LL| 2| used_from_bin_crate_and_lib_crate_generic_function("used from library used_crate.rs"); LL| 2| used_with_same_type_from_bin_crate_and_lib_crate_generic_function( - LL| | "used from library used_crate.rs", - LL| | ); + LL| 2| "used from library used_crate.rs", + LL| 2| ); LL| 2| let some_vec = vec![5, 6, 7, 8]; LL| 2| used_only_from_this_lib_crate_generic_function(some_vec); LL| 2| used_only_from_this_lib_crate_generic_function("used ONLY from library used_crate.rs"); @@ -153,7 +153,7 @@ $DIR/uses_inline_crate.rs: LL| 1| used_inline_crate::used_only_from_bin_crate_generic_function("used from bin uses_crate.rs"); LL| 1| used_inline_crate::used_from_bin_crate_and_lib_crate_generic_function(some_vec); LL| 1| used_inline_crate::used_with_same_type_from_bin_crate_and_lib_crate_generic_function( - LL| | "interesting?", - LL| | ); + LL| 1| "interesting?", + LL| 1| ); LL| 1|} diff --git a/tests/coverage/uses_inline_crate.rs b/tests/coverage/iffy/uses_inline_crate.rs similarity index 100% rename from tests/coverage/uses_inline_crate.rs rename to tests/coverage/iffy/uses_inline_crate.rs diff --git a/tests/coverage/iffy/while.cov-map b/tests/coverage/iffy/while.cov-map new file mode 100644 index 0000000000000..f09e1ea78d236 --- /dev/null +++ b/tests/coverage/iffy/while.cov-map @@ -0,0 +1,13 @@ +Function name: while::main +Raw bytes (29): 0x[01, 01, 00, 05, 01, 01, 01, 00, 0a, 01, 01, 0f, 00, 10, 01, 01, 0b, 00, 14, 00, 00, 15, 02, 06, 01, 03, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/while.rs +Number of expressions: 0 +Number of file 0 mappings: 5 +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 1, 15) to (start + 0, 16) +- Code(Counter(0)) at (prev + 1, 11) to (start + 0, 20) +- Code(Zero) at (prev + 0, 21) to (start + 2, 6) +- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) +Highest counter ID seen: c0 + diff --git a/tests/coverage/iffy/while.coverage b/tests/coverage/iffy/while.coverage new file mode 100644 index 0000000000000..90c16288d668c --- /dev/null +++ b/tests/coverage/iffy/while.coverage @@ -0,0 +1,7 @@ + LL| 1|fn main() { + LL| 1| let num = 9; + LL| 1| while num >= 10 { + LL| 0| // loop body + LL| 0| } + LL| 1|} + diff --git a/tests/coverage/iffy/while.rs b/tests/coverage/iffy/while.rs new file mode 100644 index 0000000000000..d60916a979818 --- /dev/null +++ b/tests/coverage/iffy/while.rs @@ -0,0 +1,6 @@ +fn main() { + let num = 9; + while num >= 10 { + // loop body + } +} diff --git a/tests/coverage/while_early_ret.cov-map b/tests/coverage/iffy/while_early_ret.cov-map similarity index 63% rename from tests/coverage/while_early_ret.cov-map rename to tests/coverage/iffy/while_early_ret.cov-map index b29b5d40c4df8..2ced890c1b6ed 100644 --- a/tests/coverage/while_early_ret.cov-map +++ b/tests/coverage/iffy/while_early_ret.cov-map @@ -1,5 +1,5 @@ Function name: while_early_ret::main -Raw bytes (80): 0x[01, 01, 08, 0f, 05, 01, 09, 0f, 13, 01, 09, 05, 0d, 05, 01, 05, 01, 05, 09, 0c, 01, 05, 01, 00, 1c, 01, 01, 09, 00, 16, 01, 00, 19, 00, 1b, 05, 02, 09, 02, 0a, 09, 05, 0d, 02, 0e, 02, 06, 15, 02, 16, 0d, 04, 15, 00, 1b, 0a, 04, 15, 00, 1b, 1a, 03, 09, 00, 0a, 1a, 01, 09, 02, 0a, 1e, 05, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (75): 0x[01, 01, 08, 0f, 05, 01, 09, 0f, 13, 01, 09, 05, 0d, 05, 01, 05, 01, 05, 09, 0b, 01, 05, 01, 00, 1c, 01, 01, 19, 00, 1b, 05, 02, 09, 02, 0a, 09, 05, 0d, 02, 0e, 02, 06, 15, 02, 16, 0d, 03, 11, 02, 12, 0a, 04, 11, 02, 12, 1a, 04, 09, 00, 0a, 1a, 01, 09, 02, 0a, 1e, 05, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/while_early_ret.rs Number of expressions: 8 @@ -11,18 +11,17 @@ Number of expressions: 8 - expression 5 operands: lhs = Counter(1), rhs = Counter(0) - expression 6 operands: lhs = Counter(1), rhs = Counter(0) - expression 7 operands: lhs = Counter(1), rhs = Counter(2) -Number of file 0 mappings: 12 +Number of file 0 mappings: 11 - Code(Counter(0)) at (prev + 5, 1) to (start + 0, 28) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 25) to (start + 0, 27) - Code(Counter(1)) at (prev + 2, 9) to (start + 2, 10) - Code(Counter(2)) at (prev + 5, 13) to (start + 2, 14) - Code(Expression(0, Sub)) at (prev + 6, 21) to (start + 2, 22) = ((c0 + c2) - c1) -- Code(Counter(3)) at (prev + 4, 21) to (start + 0, 27) -- Code(Expression(2, Sub)) at (prev + 4, 21) to (start + 0, 27) +- Code(Counter(3)) at (prev + 3, 17) to (start + 2, 18) +- Code(Expression(2, Sub)) at (prev + 4, 17) to (start + 2, 18) = ((c0 + c2) - (c1 + c3)) -- Code(Expression(6, Sub)) at (prev + 3, 9) to (start + 0, 10) +- Code(Expression(6, Sub)) at (prev + 4, 9) to (start + 0, 10) = (c1 - c0) - Code(Expression(6, Sub)) at (prev + 1, 9) to (start + 2, 10) = (c1 - c0) diff --git a/tests/coverage/while_early_ret.coverage b/tests/coverage/iffy/while_early_ret.coverage similarity index 92% rename from tests/coverage/while_early_ret.coverage rename to tests/coverage/iffy/while_early_ret.coverage index 649642712c6f9..c2d009db87405 100644 --- a/tests/coverage/while_early_ret.coverage +++ b/tests/coverage/iffy/while_early_ret.coverage @@ -19,13 +19,13 @@ LL| 1| countdown LL| 1| > LL| 1| 8 - LL| | { + LL| 0| { LL| 0| Ok(()) - LL| | } + LL| 0| } LL| | else - LL| | { + LL| 1| { LL| 1| Err(1) - LL| | } + LL| 1| } LL| | ; LL| 6| } LL| 6| countdown diff --git a/tests/coverage/while_early_ret.rs b/tests/coverage/iffy/while_early_ret.rs similarity index 100% rename from tests/coverage/while_early_ret.rs rename to tests/coverage/iffy/while_early_ret.rs diff --git a/tests/coverage/iffy/yield.cov-map b/tests/coverage/iffy/yield.cov-map new file mode 100644 index 0000000000000..ceb96ab62305e --- /dev/null +++ b/tests/coverage/iffy/yield.cov-map @@ -0,0 +1,58 @@ +Function name: yield::main +Raw bytes (84): 0x[01, 01, 05, 01, 05, 05, 09, 09, 0d, 0d, 11, 0d, 11, 0e, 01, 08, 01, 00, 0a, 01, 07, 0b, 00, 2e, 05, 01, 27, 00, 29, 02, 01, 0e, 00, 14, 05, 02, 0b, 00, 2e, 09, 01, 2c, 00, 2e, 06, 01, 0e, 00, 14, 09, 0b, 0b, 00, 2e, 0d, 01, 27, 00, 29, 0a, 01, 0e, 00, 14, 0d, 02, 0b, 00, 2e, 12, 01, 27, 00, 29, 11, 01, 0e, 00, 14, 12, 02, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/yield.rs +Number of expressions: 5 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +- expression 1 operands: lhs = Counter(1), rhs = Counter(2) +- expression 2 operands: lhs = Counter(2), rhs = Counter(3) +- expression 3 operands: lhs = Counter(3), rhs = Counter(4) +- expression 4 operands: lhs = Counter(3), rhs = Counter(4) +Number of file 0 mappings: 14 +- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 10) +- Code(Counter(0)) at (prev + 7, 11) to (start + 0, 46) +- Code(Counter(1)) at (prev + 1, 39) to (start + 0, 41) +- Code(Expression(0, Sub)) at (prev + 1, 14) to (start + 0, 20) + = (c0 - c1) +- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 46) +- Code(Counter(2)) at (prev + 1, 44) to (start + 0, 46) +- Code(Expression(1, Sub)) at (prev + 1, 14) to (start + 0, 20) + = (c1 - c2) +- Code(Counter(2)) at (prev + 11, 11) to (start + 0, 46) +- Code(Counter(3)) at (prev + 1, 39) to (start + 0, 41) +- Code(Expression(2, Sub)) at (prev + 1, 14) to (start + 0, 20) + = (c2 - c3) +- Code(Counter(3)) at (prev + 2, 11) to (start + 0, 46) +- Code(Expression(4, Sub)) at (prev + 1, 39) to (start + 0, 41) + = (c3 - c4) +- Code(Counter(4)) at (prev + 1, 14) to (start + 0, 20) +- Code(Expression(4, Sub)) at (prev + 2, 1) to (start + 0, 2) + = (c3 - c4) +Highest counter ID seen: c4 + +Function name: yield::main::{closure#0} +Raw bytes (24): 0x[01, 01, 00, 04, 01, 0a, 08, 00, 09, 01, 01, 09, 00, 10, 05, 01, 09, 00, 15, 05, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/yield.rs +Number of expressions: 0 +Number of file 0 mappings: 4 +- Code(Counter(0)) at (prev + 10, 8) to (start + 0, 9) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 21) +- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: c1 + +Function name: yield::main::{closure#1} +Raw bytes (34): 0x[01, 01, 00, 06, 01, 19, 08, 00, 09, 01, 01, 09, 00, 10, 05, 01, 09, 00, 10, 09, 01, 09, 00, 10, 0d, 01, 09, 00, 15, 0d, 01, 05, 00, 06] +Number of files: 1 +- file 0 => $DIR/yield.rs +Number of expressions: 0 +Number of file 0 mappings: 6 +- Code(Counter(0)) at (prev + 25, 8) to (start + 0, 9) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 16) +- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 16) +- Code(Counter(3)) at (prev + 1, 9) to (start + 0, 21) +- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 6) +Highest counter ID seen: c3 + diff --git a/tests/coverage/yield.coverage b/tests/coverage/iffy/yield.coverage similarity index 93% rename from tests/coverage/yield.coverage rename to tests/coverage/iffy/yield.coverage index 2fea2d94dae4b..47cedc62184b7 100644 --- a/tests/coverage/yield.coverage +++ b/tests/coverage/iffy/yield.coverage @@ -6,7 +6,7 @@ LL| |use std::pin::Pin; LL| | LL| 1|fn main() { - LL| 1| let mut coroutine = #[coroutine] + LL| | let mut coroutine = #[coroutine] LL| 1| || { LL| 1| yield 1; LL| 1| return "foo"; @@ -21,7 +21,7 @@ LL| 0| _ => panic!("unexpected value from resume"), LL| | } LL| | - LL| 1| let mut coroutine = #[coroutine] + LL| | let mut coroutine = #[coroutine] LL| 1| || { LL| 1| yield 1; LL| 1| yield 2; diff --git a/tests/coverage/yield.rs b/tests/coverage/iffy/yield.rs similarity index 100% rename from tests/coverage/yield.rs rename to tests/coverage/iffy/yield.rs diff --git a/tests/coverage/inline.cov-map b/tests/coverage/inline.cov-map deleted file mode 100644 index 55f4b8484c024..0000000000000 --- a/tests/coverage/inline.cov-map +++ /dev/null @@ -1,136 +0,0 @@ -Function name: inline::display:: -Raw bytes (36): 0x[01, 01, 01, 05, 01, 06, 01, 29, 01, 00, 21, 02, 01, 09, 00, 0a, 01, 00, 0e, 00, 10, 02, 00, 11, 02, 06, 01, 03, 05, 00, 0d, 01, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/inline.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(1), rhs = Counter(0) -Number of file 0 mappings: 6 -- Code(Counter(0)) at (prev + 41, 1) to (start + 0, 33) -- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 10) - = (c1 - c0) -- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 16) -- Code(Expression(0, Sub)) at (prev + 0, 17) to (start + 2, 6) - = (c1 - c0) -- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c0 - -Function name: inline::error -Raw bytes (14): 0x[01, 01, 00, 02, 01, 31, 01, 00, 0b, 01, 01, 05, 00, 0b] -Number of files: 1 -- file 0 => $DIR/inline.rs -Number of expressions: 0 -Number of file 0 mappings: 2 -- Code(Counter(0)) at (prev + 49, 1) to (start + 0, 11) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) -Highest counter ID seen: c0 - -Function name: inline::length:: -Raw bytes (24): 0x[01, 01, 00, 04, 01, 1e, 01, 00, 20, 01, 01, 05, 00, 07, 01, 00, 08, 00, 0b, 01, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/inline.rs -Number of expressions: 0 -Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 30, 1) to (start + 0, 32) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 7) -- Code(Counter(0)) at (prev + 0, 8) to (start + 0, 11) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c0 - -Function name: inline::main -Raw bytes (24): 0x[01, 01, 00, 04, 01, 05, 01, 00, 0a, 01, 01, 05, 00, 11, 01, 00, 12, 00, 22, 01, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/inline.rs -Number of expressions: 0 -Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 5, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) -- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 34) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c0 - -Function name: inline::permutate:: -Raw bytes (137): 0x[01, 01, 0e, 01, 05, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 0d, 09, 01, 37, 05, 09, 15, 01, 0f, 01, 00, 38, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 13, 01, 00, 14, 00, 16, 01, 01, 08, 00, 0e, 05, 00, 0f, 02, 06, 02, 02, 0f, 00, 14, 2e, 01, 0d, 00, 0e, 09, 00, 12, 00, 16, 2e, 00, 17, 04, 0a, 2e, 01, 0d, 00, 11, 2e, 00, 12, 00, 14, 2e, 00, 16, 00, 17, 2e, 00, 19, 00, 1a, 2e, 01, 0d, 00, 16, 2e, 00, 17, 00, 19, 2e, 00, 1b, 00, 20, 2e, 01, 0d, 00, 11, 2e, 00, 12, 00, 14, 32, 02, 0c, 02, 06, 01, 03, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/inline.rs -Number of expressions: 14 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(3), rhs = Counter(2) -- expression 2 operands: lhs = Counter(3), rhs = Counter(2) -- expression 3 operands: lhs = Counter(3), rhs = Counter(2) -- expression 4 operands: lhs = Counter(3), rhs = Counter(2) -- expression 5 operands: lhs = Counter(3), rhs = Counter(2) -- expression 6 operands: lhs = Counter(3), rhs = Counter(2) -- expression 7 operands: lhs = Counter(3), rhs = Counter(2) -- expression 8 operands: lhs = Counter(3), rhs = Counter(2) -- expression 9 operands: lhs = Counter(3), rhs = Counter(2) -- expression 10 operands: lhs = Counter(3), rhs = Counter(2) -- expression 11 operands: lhs = Counter(3), rhs = Counter(2) -- expression 12 operands: lhs = Counter(0), rhs = Expression(13, Add) -- expression 13 operands: lhs = Counter(1), rhs = Counter(2) -Number of file 0 mappings: 21 -- Code(Counter(0)) at (prev + 15, 1) to (start + 0, 56) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 19) -- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 22) -- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 14) -- Code(Counter(1)) at (prev + 0, 15) to (start + 2, 6) -- Code(Expression(0, Sub)) at (prev + 2, 15) to (start + 0, 20) - = (c0 - c1) -- Code(Expression(11, Sub)) at (prev + 1, 13) to (start + 0, 14) - = (c3 - c2) -- Code(Counter(2)) at (prev + 0, 18) to (start + 0, 22) -- Code(Expression(11, Sub)) at (prev + 0, 23) to (start + 4, 10) - = (c3 - c2) -- Code(Expression(11, Sub)) at (prev + 1, 13) to (start + 0, 17) - = (c3 - c2) -- Code(Expression(11, Sub)) at (prev + 0, 18) to (start + 0, 20) - = (c3 - c2) -- Code(Expression(11, Sub)) at (prev + 0, 22) to (start + 0, 23) - = (c3 - c2) -- Code(Expression(11, Sub)) at (prev + 0, 25) to (start + 0, 26) - = (c3 - c2) -- Code(Expression(11, Sub)) at (prev + 1, 13) to (start + 0, 22) - = (c3 - c2) -- Code(Expression(11, Sub)) at (prev + 0, 23) to (start + 0, 25) - = (c3 - c2) -- Code(Expression(11, Sub)) at (prev + 0, 27) to (start + 0, 32) - = (c3 - c2) -- Code(Expression(11, Sub)) at (prev + 1, 13) to (start + 0, 17) - = (c3 - c2) -- Code(Expression(11, Sub)) at (prev + 0, 18) to (start + 0, 20) - = (c3 - c2) -- Code(Expression(12, Sub)) at (prev + 2, 12) to (start + 2, 6) - = (c0 - (c1 + c2)) -- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) -Highest counter ID seen: c2 - -Function name: inline::permutations:: -Raw bytes (39): 0x[01, 01, 00, 07, 01, 0a, 01, 00, 2d, 01, 01, 09, 00, 0f, 01, 00, 12, 00, 14, 01, 00, 15, 00, 1d, 01, 01, 05, 00, 0e, 01, 00, 0f, 00, 16, 01, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/inline.rs -Number of expressions: 0 -Number of file 0 mappings: 7 -- Code(Counter(0)) at (prev + 10, 1) to (start + 0, 45) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) -- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 20) -- Code(Counter(0)) at (prev + 0, 21) to (start + 0, 29) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 22) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c0 - -Function name: inline::swap:: -Raw bytes (34): 0x[01, 01, 00, 06, 01, 23, 01, 00, 33, 01, 01, 09, 00, 0a, 01, 00, 0d, 00, 12, 01, 01, 05, 00, 12, 01, 01, 05, 00, 0e, 01, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/inline.rs -Number of expressions: 0 -Number of file 0 mappings: 6 -- Code(Counter(0)) at (prev + 35, 1) to (start + 0, 51) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 14) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c0 - diff --git a/tests/coverage/inner_items.cov-map b/tests/coverage/inner_items.cov-map deleted file mode 100644 index 0e3ed47bbc67c..0000000000000 --- a/tests/coverage/inner_items.cov-map +++ /dev/null @@ -1,69 +0,0 @@ -Function name: ::default_trait_func -Raw bytes (29): 0x[01, 01, 00, 05, 01, 21, 09, 00, 29, 01, 01, 0d, 00, 14, 01, 01, 0d, 00, 11, 01, 00, 12, 00, 1c, 01, 01, 09, 00, 0a] -Number of files: 1 -- file 0 => $DIR/inner_items.rs -Number of expressions: 0 -Number of file 0 mappings: 5 -- Code(Counter(0)) at (prev + 33, 9) to (start + 0, 41) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 20) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 17) -- Code(Counter(0)) at (prev + 0, 18) to (start + 0, 28) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) -Highest counter ID seen: c0 - -Function name: ::trait_func -Raw bytes (29): 0x[01, 01, 00, 05, 01, 28, 09, 00, 2c, 01, 01, 0d, 00, 29, 01, 01, 0d, 00, 14, 01, 00, 15, 00, 29, 01, 01, 09, 00, 0a] -Number of files: 1 -- file 0 => $DIR/inner_items.rs -Number of expressions: 0 -Number of file 0 mappings: 5 -- Code(Counter(0)) at (prev + 40, 9) to (start + 0, 44) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 41) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 20) -- Code(Counter(0)) at (prev + 0, 21) to (start + 0, 41) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) -Highest counter ID seen: c0 - -Function name: inner_items::main -Raw bytes (88): 0x[01, 01, 02, 01, 05, 01, 09, 10, 01, 03, 01, 00, 0a, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 09, 00, 16, 01, 00, 19, 00, 1a, 01, 01, 08, 00, 0f, 05, 00, 10, 02, 06, 02, 02, 05, 00, 06, 01, 24, 08, 00, 0f, 09, 00, 10, 02, 06, 06, 02, 05, 00, 06, 01, 02, 09, 00, 10, 01, 00, 13, 02, 06, 01, 04, 05, 00, 08, 01, 00, 09, 00, 1b, 01, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/inner_items.rs -Number of expressions: 2 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(0), rhs = Counter(2) -Number of file 0 mappings: 16 -- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 26) -- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 15) -- Code(Counter(1)) at (prev + 0, 16) to (start + 2, 6) -- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) - = (c0 - c1) -- Code(Counter(0)) at (prev + 36, 8) to (start + 0, 15) -- Code(Counter(2)) at (prev + 0, 16) to (start + 2, 6) -- Code(Expression(1, Sub)) at (prev + 2, 5) to (start + 0, 6) - = (c0 - c2) -- Code(Counter(0)) at (prev + 2, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 2, 6) -- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 8) -- Code(Counter(0)) at (prev + 0, 9) to (start + 0, 27) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c2 - -Function name: inner_items::main::in_func -Raw bytes (39): 0x[01, 01, 00, 07, 01, 12, 05, 00, 17, 01, 01, 0d, 00, 0e, 01, 00, 11, 00, 12, 01, 01, 0d, 00, 0e, 01, 00, 11, 00, 16, 01, 01, 09, 00, 11, 01, 01, 05, 00, 06] -Number of files: 1 -- file 0 => $DIR/inner_items.rs -Number of expressions: 0 -Number of file 0 mappings: 7 -- Code(Counter(0)) at (prev + 18, 5) to (start + 0, 23) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 22) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 17) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: c0 - diff --git a/tests/coverage/issue-83601.cov-map b/tests/coverage/issue-83601.cov-map deleted file mode 100644 index 6d89397023c6f..0000000000000 --- a/tests/coverage/issue-83601.cov-map +++ /dev/null @@ -1,19 +0,0 @@ -Function name: issue_83601::main -Raw bytes (59): 0x[01, 01, 00, 0b, 01, 06, 01, 00, 0a, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/issue-83601.rs -Number of expressions: 0 -Number of file 0 mappings: 11 -- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c0 - diff --git a/tests/coverage/issue-84561.cov-map b/tests/coverage/issue-84561.cov-map deleted file mode 100644 index ca009260cddc9..0000000000000 --- a/tests/coverage/issue-84561.cov-map +++ /dev/null @@ -1,155 +0,0 @@ -Function name: ::fmt -Raw bytes (37): 0x[01, 01, 01, 01, 05, 06, 01, 8a, 01, 05, 00, 43, 01, 01, 09, 00, 0f, 01, 00, 10, 00, 11, 05, 00, 25, 00, 26, 02, 01, 09, 00, 0f, 01, 01, 05, 00, 06] -Number of files: 1 -- file 0 => $DIR/issue-84561.rs -Number of expressions: 1 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 6 -- Code(Counter(0)) at (prev + 138, 5) to (start + 0, 67) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) -- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 17) -- Code(Counter(1)) at (prev + 0, 37) to (start + 0, 38) -- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) - = (c0 - c1) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: c1 - -Function name: issue_84561::main -Raw bytes (30): 0x[01, 01, 00, 05, 01, b4, 01, 01, 00, 0a, 01, 01, 05, 00, 0a, 01, 01, 05, 00, 0a, 01, 01, 05, 00, 0a, 01, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/issue-84561.rs -Number of expressions: 0 -Number of file 0 mappings: 5 -- Code(Counter(0)) at (prev + 180, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c0 - -Function name: issue_84561::test1 -Raw bytes (45): 0x[01, 01, 00, 08, 01, 9a, 01, 01, 00, 0b, 01, 01, 05, 00, 0b, 01, 01, 05, 00, 0b, 01, 01, 0d, 00, 0e, 01, 01, 05, 00, 0b, 01, 01, 05, 02, 06, 01, 03, 05, 00, 0b, 01, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/issue-84561.rs -Number of expressions: 0 -Number of file 0 mappings: 8 -- Code(Counter(0)) at (prev + 154, 1) to (start + 0, 11) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 14) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) -- Code(Counter(0)) at (prev + 1, 5) to (start + 2, 6) -- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 11) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c0 - -Function name: issue_84561::test2 -Raw bytes (20): 0x[01, 01, 00, 03, 01, b0, 01, 01, 00, 0b, 01, 01, 05, 00, 10, 01, 01, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/issue-84561.rs -Number of expressions: 0 -Number of file 0 mappings: 3 -- Code(Counter(0)) at (prev + 176, 1) to (start + 0, 11) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 16) -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c0 - -Function name: issue_84561::test2::call_print -Raw bytes (20): 0x[01, 01, 00, 03, 01, a7, 01, 09, 00, 1f, 01, 01, 0d, 00, 13, 01, 01, 09, 00, 0a] -Number of files: 1 -- file 0 => $DIR/issue-84561.rs -Number of expressions: 0 -Number of file 0 mappings: 3 -- Code(Counter(0)) at (prev + 167, 9) to (start + 0, 31) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 19) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 10) -Highest counter ID seen: c0 - -Function name: issue_84561::test3 -Raw bytes (340): 0x[01, 01, 08, 01, 05, 01, 09, 01, 0d, 11, 15, 1d, 21, 19, 1d, 19, 1d, 19, 1d, 40, 01, 08, 01, 00, 0b, 01, 01, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0d, 01, 02, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0d, 01, 01, 05, 00, 0d, 01, 02, 05, 00, 0f, 00, 00, 29, 00, 30, 00, 00, 33, 00, 41, 00, 00, 4b, 00, 5a, 01, 01, 05, 00, 0f, 00, 08, 09, 00, 10, 00, 02, 0d, 00, 1b, 00, 02, 0d, 00, 1c, 01, 04, 09, 00, 10, 01, 00, 13, 00, 2e, 01, 02, 05, 00, 0f, 01, 04, 05, 00, 0f, 01, 04, 05, 00, 0f, 01, 04, 09, 00, 0c, 01, 00, 0f, 00, 15, 01, 01, 05, 00, 0f, 01, 04, 08, 00, 0f, 05, 01, 09, 00, 13, 02, 05, 09, 00, 13, 01, 05, 08, 00, 0f, 09, 01, 09, 00, 13, 06, 06, 09, 00, 13, 01, 06, 05, 00, 0f, 01, 01, 0c, 00, 13, 0d, 01, 0d, 00, 13, 0a, 02, 0d, 00, 13, 11, 04, 05, 00, 0f, 11, 02, 0c, 00, 13, 15, 01, 0d, 00, 13, 0e, 02, 0d, 00, 13, 13, 03, 05, 00, 0f, 19, 01, 0c, 00, 13, 1d, 01, 0d, 00, 17, 1d, 04, 0d, 00, 13, 1e, 02, 0d, 00, 17, 1e, 01, 14, 00, 1b, 00, 01, 15, 00, 1b, 1e, 02, 15, 00, 1b, 21, 04, 0d, 00, 13, 25, 05, 05, 00, 0f, 00, 05, 05, 00, 0f, 00, 05, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/issue-84561.rs -Number of expressions: 8 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(0), rhs = Counter(2) -- expression 2 operands: lhs = Counter(0), rhs = Counter(3) -- expression 3 operands: lhs = Counter(4), rhs = Counter(5) -- expression 4 operands: lhs = Counter(7), rhs = Counter(8) -- expression 5 operands: lhs = Counter(6), rhs = Counter(7) -- expression 6 operands: lhs = Counter(6), rhs = Counter(7) -- expression 7 operands: lhs = Counter(6), rhs = Counter(7) -Number of file 0 mappings: 64 -- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 11) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15) -- Code(Zero) at (prev + 0, 41) to (start + 0, 48) -- Code(Zero) at (prev + 0, 51) to (start + 0, 65) -- Code(Zero) at (prev + 0, 75) to (start + 0, 90) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Zero) at (prev + 8, 9) to (start + 0, 16) -- Code(Zero) at (prev + 2, 13) to (start + 0, 27) -- Code(Zero) at (prev + 2, 13) to (start + 0, 28) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 0, 19) to (start + 0, 46) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 4, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 12) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 21) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 4, 8) to (start + 0, 15) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 19) -- Code(Expression(0, Sub)) at (prev + 5, 9) to (start + 0, 19) - = (c0 - c1) -- Code(Counter(0)) at (prev + 5, 8) to (start + 0, 15) -- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 19) -- Code(Expression(1, Sub)) at (prev + 6, 9) to (start + 0, 19) - = (c0 - c2) -- Code(Counter(0)) at (prev + 6, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 12) to (start + 0, 19) -- Code(Counter(3)) at (prev + 1, 13) to (start + 0, 19) -- Code(Expression(2, Sub)) at (prev + 2, 13) to (start + 0, 19) - = (c0 - c3) -- Code(Counter(4)) at (prev + 4, 5) to (start + 0, 15) -- Code(Counter(4)) at (prev + 2, 12) to (start + 0, 19) -- Code(Counter(5)) at (prev + 1, 13) to (start + 0, 19) -- Code(Expression(3, Sub)) at (prev + 2, 13) to (start + 0, 19) - = (c4 - c5) -- Code(Expression(4, Add)) at (prev + 3, 5) to (start + 0, 15) - = (c7 + c8) -- Code(Counter(6)) at (prev + 1, 12) to (start + 0, 19) -- Code(Counter(7)) at (prev + 1, 13) to (start + 0, 23) -- Code(Counter(7)) at (prev + 4, 13) to (start + 0, 19) -- Code(Expression(7, Sub)) at (prev + 2, 13) to (start + 0, 23) - = (c6 - c7) -- Code(Expression(7, Sub)) at (prev + 1, 20) to (start + 0, 27) - = (c6 - c7) -- Code(Zero) at (prev + 1, 21) to (start + 0, 27) -- Code(Expression(7, Sub)) at (prev + 2, 21) to (start + 0, 27) - = (c6 - c7) -- Code(Counter(8)) at (prev + 4, 13) to (start + 0, 19) -- Code(Counter(9)) at (prev + 5, 5) to (start + 0, 15) -- Code(Zero) at (prev + 5, 5) to (start + 0, 15) -- Code(Zero) at (prev + 5, 1) to (start + 0, 2) -Highest counter ID seen: c9 - diff --git a/tests/coverage/let-else.none.cov-map b/tests/coverage/let-else.none.cov-map new file mode 100644 index 0000000000000..e89c179568610 --- /dev/null +++ b/tests/coverage/let-else.none.cov-map @@ -0,0 +1,30 @@ +Function name: let_else::let_else_no_semi +Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 10, 01, 00, 2b, 01, 01, 15, 00, 1c, 05, 01, 09, 00, 0f, 02, 02, 05, 00, 0d, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/let-else.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 5 +- Code(Counter(0)) at (prev + 16, 1) to (start + 0, 43) +- Code(Counter(0)) at (prev + 1, 21) to (start + 0, 28) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15) +- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 13) + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 + +Function name: let_else::let_else_semi +Raw bytes (31): 0x[01, 01, 01, 01, 05, 05, 01, 08, 01, 00, 28, 01, 01, 15, 00, 1c, 05, 01, 09, 00, 0f, 02, 02, 05, 00, 0d, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/let-else.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) +Number of file 0 mappings: 5 +- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 40) +- Code(Counter(0)) at (prev + 1, 21) to (start + 0, 28) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 15) +- Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 13) + = (c0 - c1) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 + diff --git a/tests/coverage/let-else.none.coverage b/tests/coverage/let-else.none.coverage new file mode 100644 index 0000000000000..53c62cf29338e --- /dev/null +++ b/tests/coverage/let-else.none.coverage @@ -0,0 +1,37 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: none some + LL| |//@[some] ignore-coverage-map + LL| | + LL| |// Basic test for let-else statements. + LL| | + LL| 1|fn let_else_semi(opt_msg: Option<&str>) { + LL| 1| let Some(msg) = opt_msg else { + LL| 1| return; + LL| | }; + LL| 0| say(msg); + LL| 1|} + LL| | + LL| |#[rustfmt::skip] + LL| 1|fn let_else_no_semi(opt_msg: Option<&str>) { + LL| 1| let Some(msg) = opt_msg else { + LL| 1| return + LL| | }; + LL| 0| say(msg); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let opt_msg = cfg_select!( + LL| | some => Some("hello"), + LL| | none => None, + LL| | ); + LL| | let_else_semi(opt_msg); + LL| | let_else_no_semi(opt_msg); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/let-else.rs b/tests/coverage/let-else.rs new file mode 100644 index 0000000000000..0ebef52d649c7 --- /dev/null +++ b/tests/coverage/let-else.rs @@ -0,0 +1,36 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 +//@ revisions: none some +//@[some] ignore-coverage-map + +// Basic test for let-else statements. + +fn let_else_semi(opt_msg: Option<&str>) { + let Some(msg) = opt_msg else { + return; + }; + say(msg); +} + +#[rustfmt::skip] +fn let_else_no_semi(opt_msg: Option<&str>) { + let Some(msg) = opt_msg else { + return + }; + say(msg); +} + +#[coverage(off)] +fn main() { + let opt_msg = cfg_select!( + some => Some("hello"), + none => None, + ); + let_else_semi(opt_msg); + let_else_no_semi(opt_msg); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); +} diff --git a/tests/coverage/let-else.some.coverage b/tests/coverage/let-else.some.coverage new file mode 100644 index 0000000000000..828731b199f95 --- /dev/null +++ b/tests/coverage/let-else.some.coverage @@ -0,0 +1,37 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| |//@ revisions: none some + LL| |//@[some] ignore-coverage-map + LL| | + LL| |// Basic test for let-else statements. + LL| | + LL| 1|fn let_else_semi(opt_msg: Option<&str>) { + LL| 1| let Some(msg) = opt_msg else { + LL| 0| return; + LL| | }; + LL| 1| say(msg); + LL| 1|} + LL| | + LL| |#[rustfmt::skip] + LL| 1|fn let_else_no_semi(opt_msg: Option<&str>) { + LL| 1| let Some(msg) = opt_msg else { + LL| 0| return + LL| | }; + LL| 1| say(msg); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | let opt_msg = cfg_select!( + LL| | some => Some("hello"), + LL| | none => None, + LL| | ); + LL| | let_else_semi(opt_msg); + LL| | let_else_no_semi(opt_msg); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/let_else_loop.cov-map b/tests/coverage/let_else_loop.cov-map index 169d4a5c0961e..88f53873d7789 100644 --- a/tests/coverage/let_else_loop.cov-map +++ b/tests/coverage/let_else_loop.cov-map @@ -1,13 +1,13 @@ Function name: let_else_loop::_if (unused) -Raw bytes (24): 0x[01, 01, 00, 04, 00, 16, 01, 00, 13, 00, 01, 08, 00, 0c, 00, 00, 0f, 00, 16, 00, 00, 20, 00, 27] +Raw bytes (24): 0x[01, 01, 00, 04, 00, 16, 01, 00, 13, 00, 01, 08, 00, 0c, 00, 00, 0d, 00, 18, 00, 00, 1e, 00, 29] Number of files: 1 - file 0 => $DIR/let_else_loop.rs Number of expressions: 0 Number of file 0 mappings: 4 - Code(Zero) at (prev + 22, 1) to (start + 0, 19) - Code(Zero) at (prev + 1, 8) to (start + 0, 12) -- Code(Zero) at (prev + 0, 15) to (start + 0, 22) -- Code(Zero) at (prev + 0, 32) to (start + 0, 39) +- Code(Zero) at (prev + 0, 13) to (start + 0, 24) +- Code(Zero) at (prev + 0, 30) to (start + 0, 41) Highest counter ID seen: (none) Function name: let_else_loop::_loop_either_way (unused) @@ -23,14 +23,16 @@ Number of file 0 mappings: 4 Highest counter ID seen: (none) Function name: let_else_loop::loopy -Raw bytes (24): 0x[01, 01, 00, 04, 01, 09, 01, 00, 15, 01, 01, 10, 00, 14, 09, 00, 1c, 00, 23, 05, 01, 01, 00, 02] +Raw bytes (26): 0x[01, 01, 01, 01, 05, 04, 01, 09, 01, 00, 15, 01, 01, 10, 00, 14, 05, 00, 1c, 00, 23, 02, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/let_else_loop.rs -Number of expressions: 0 +Number of expressions: 1 +- expression 0 operands: lhs = Counter(0), rhs = Counter(1) Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 9, 1) to (start + 0, 21) - Code(Counter(0)) at (prev + 1, 16) to (start + 0, 20) -- Code(Counter(2)) at (prev + 0, 28) to (start + 0, 35) -- Code(Counter(1)) at (prev + 1, 1) to (start + 0, 2) -Highest counter ID seen: c2 +- Code(Counter(1)) at (prev + 0, 28) to (start + 0, 35) +- Code(Expression(0, Sub)) at (prev + 1, 1) to (start + 0, 2) + = (c0 - c1) +Highest counter ID seen: c1 diff --git a/tests/coverage/long_and_wide.cov-map b/tests/coverage/long_and_wide.cov-map index 93466a98eaf35..bd186a72f5532 100644 --- a/tests/coverage/long_and_wide.cov-map +++ b/tests/coverage/long_and_wide.cov-map @@ -19,15 +19,15 @@ Number of file 0 mappings: 2 Highest counter ID seen: c0 Function name: long_and_wide::main -Raw bytes (29): 0x[01, 01, 00, 05, 01, 07, 01, 00, 0a, 01, 01, 05, 00, 12, 01, 01, 05, 00, 12, 01, 01, 05, 00, 11, 01, 01, 01, 00, 02] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 07, 01, 00, 0a, 01, 01, 05, 00, 14, 01, 01, 05, 00, 14, 01, 01, 05, 00, 13, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/long_and_wide.rs Number of expressions: 0 Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 7, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 17) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 20) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 20) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 19) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/loop-break.cov-map b/tests/coverage/loop-break.cov-map index 3981623550dda..cb77e8c786839 100644 --- a/tests/coverage/loop-break.cov-map +++ b/tests/coverage/loop-break.cov-map @@ -1,14 +1,14 @@ Function name: loop_break::main -Raw bytes (31): 0x[01, 01, 01, 05, 01, 05, 01, 03, 01, 00, 0a, 05, 02, 0c, 00, 21, 01, 01, 0d, 00, 12, 02, 01, 09, 00, 0a, 01, 02, 01, 00, 02] +Raw bytes (31): 0x[01, 01, 01, 05, 01, 05, 01, 03, 01, 00, 0a, 05, 02, 0c, 00, 27, 01, 00, 28, 02, 0a, 02, 02, 09, 00, 0a, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/loop-break.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(1), rhs = Counter(0) Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 3, 1) to (start + 0, 10) -- Code(Counter(1)) at (prev + 2, 12) to (start + 0, 33) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 18) -- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 10) +- Code(Counter(1)) at (prev + 2, 12) to (start + 0, 39) +- Code(Counter(0)) at (prev + 0, 40) to (start + 2, 10) +- Code(Expression(0, Sub)) at (prev + 2, 9) to (start + 0, 10) = (c1 - c0) - Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) Highest counter ID seen: c1 diff --git a/tests/coverage/loop-break.coverage b/tests/coverage/loop-break.coverage index 1b7c64fb68d5b..2f19c5c6ac965 100644 --- a/tests/coverage/loop-break.coverage +++ b/tests/coverage/loop-break.coverage @@ -4,7 +4,8 @@ LL| | loop { LL| 1| if core::hint::black_box(true) { LL| 1| break; - LL| 0| } + LL| 1| } + ^0 LL| | } LL| 1|} LL| | diff --git a/tests/coverage/loop_break_value.cov-map b/tests/coverage/loop_break_value.cov-map index cf355eceb2c17..c9a5cfaa9150a 100644 --- a/tests/coverage/loop_break_value.cov-map +++ b/tests/coverage/loop_break_value.cov-map @@ -1,12 +1,11 @@ Function name: loop_break_value::main -Raw bytes (24): 0x[01, 01, 00, 04, 01, 04, 01, 00, 0a, 01, 01, 09, 00, 0f, 01, 02, 0d, 05, 0a, 01, 07, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 04, 01, 00, 0a, 01, 03, 0d, 05, 0a, 01, 07, 01, 00, 02] Number of files: 1 - file 0 => $DIR/loop_break_value.rs Number of expressions: 0 -Number of file 0 mappings: 4 +Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 15) -- Code(Counter(0)) at (prev + 2, 13) to (start + 5, 10) +- Code(Counter(0)) at (prev + 3, 13) to (start + 5, 10) - Code(Counter(0)) at (prev + 7, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/loop_break_value.coverage b/tests/coverage/loop_break_value.coverage index 5e80168b958b1..b6aa433417196 100644 --- a/tests/coverage/loop_break_value.coverage +++ b/tests/coverage/loop_break_value.coverage @@ -2,7 +2,7 @@ LL| | LL| |#[rustfmt::skip] LL| 1|fn main() { - LL| 1| let result + LL| | let result LL| | = LL| 1| loop LL| 1| { diff --git a/tests/coverage/macro_in_closure.cov-map b/tests/coverage/macro_in_closure.cov-map index 1a3960196acd6..3529d0c4c321b 100644 --- a/tests/coverage/macro_in_closure.cov-map +++ b/tests/coverage/macro_in_closure.cov-map @@ -1,20 +1,22 @@ Function name: macro_in_closure::NO_BLOCK::{closure#0} -Raw bytes (9): 0x[01, 01, 00, 01, 01, 07, 1c, 00, 24] +Raw bytes (14): 0x[01, 01, 00, 02, 01, 07, 1c, 00, 24, 01, 00, 25, 00, 2c] Number of files: 1 - file 0 => $DIR/macro_in_closure.rs Number of expressions: 0 -Number of file 0 mappings: 1 +Number of file 0 mappings: 2 - Code(Counter(0)) at (prev + 7, 28) to (start + 0, 36) +- Code(Counter(0)) at (prev + 0, 37) to (start + 0, 44) Highest counter ID seen: c0 Function name: macro_in_closure::WITH_BLOCK::{closure#0} -Raw bytes (19): 0x[01, 01, 00, 03, 01, 09, 1e, 00, 1f, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 09, 1e, 00, 1f, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 15, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/macro_in_closure.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 9, 30) to (start + 0, 31) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 21) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/macro_name_span.cov-map b/tests/coverage/macro_name_span.cov-map index c96cb75846b26..2206f286112b7 100644 --- a/tests/coverage/macro_name_span.cov-map +++ b/tests/coverage/macro_name_span.cov-map @@ -9,13 +9,13 @@ Number of file 0 mappings: 2 Highest counter ID seen: c0 Function name: macro_name_span::main -Raw bytes (19): 0x[01, 01, 00, 03, 01, 0b, 01, 00, 0a, 01, 01, 05, 00, 16, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 0b, 01, 00, 0a, 01, 01, 05, 00, 18, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/macro_name_span.rs Number of expressions: 0 Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 11, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 22) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 24) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/macros/call-site-body.cov-map b/tests/coverage/macros/call-site-body.cov-map index 89d1eb3a84108..c21f583eae228 100644 --- a/tests/coverage/macros/call-site-body.cov-map +++ b/tests/coverage/macros/call-site-body.cov-map @@ -1,12 +1,11 @@ Function name: call_site_body::fn_with_call_site_body -Raw bytes (19): 0x[01, 01, 00, 03, 01, 15, 05, 00, 06, 01, 01, 09, 00, 0c, 01, 00, 0d, 00, 14] +Raw bytes (14): 0x[01, 01, 00, 02, 01, 15, 05, 00, 06, 01, 01, 09, 00, 15] Number of files: 1 - file 0 => $DIR/call-site-body.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 2 - Code(Counter(0)) at (prev + 21, 5) to (start + 0, 6) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(0)) at (prev + 0, 13) to (start + 0, 20) +- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 21) Highest counter ID seen: c0 Function name: call_site_body::fn_with_call_site_inner (unused) diff --git a/tests/coverage/macros/pass-through.cov-map b/tests/coverage/macros/pass-through.cov-map index 83937e4fb8b76..cf8223dacd9bd 100644 --- a/tests/coverage/macros/pass-through.cov-map +++ b/tests/coverage/macros/pass-through.cov-map @@ -1,55 +1,49 @@ Function name: pass_through::uses_inner_macro -Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 24, 01, 00, 16, 01, 01, 08, 00, 1d, 05, 01, 09, 00, 0c, 05, 00, 0d, 00, 21, 05, 01, 09, 00, 15, 05, 01, 09, 00, 0c, 05, 00, 0d, 00, 20, 02, 01, 05, 00, 06, 01, 01, 01, 00, 02] +Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 24, 01, 00, 16, 01, 01, 08, 00, 23, 05, 01, 09, 00, 22, 05, 01, 09, 00, 15, 05, 01, 09, 00, 21, 02, 01, 05, 00, 06, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/pass-through.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 9 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 36, 1) to (start + 0, 22) -- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 29) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 33) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 35) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 34) - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 21) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 32) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 33) - Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 6) = (c0 - c1) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c1 Function name: pass_through::uses_middle_macro -Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 2c, 01, 00, 17, 01, 01, 08, 00, 1d, 05, 01, 09, 00, 0c, 05, 00, 0d, 00, 22, 05, 01, 09, 00, 16, 05, 01, 09, 00, 0c, 05, 00, 0d, 00, 21, 02, 01, 05, 00, 06, 01, 01, 01, 00, 02] +Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 2c, 01, 00, 17, 01, 01, 08, 00, 23, 05, 01, 09, 00, 23, 05, 01, 09, 00, 16, 05, 01, 09, 00, 22, 02, 01, 05, 00, 06, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/pass-through.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 9 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 44, 1) to (start + 0, 23) -- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 29) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 34) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 35) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 35) - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 33) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 34) - Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 6) = (c0 - c1) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c1 Function name: pass_through::uses_outer_macro -Raw bytes (51): 0x[01, 01, 01, 01, 05, 09, 01, 34, 01, 00, 16, 01, 01, 08, 00, 1d, 05, 01, 09, 00, 0c, 05, 00, 0d, 00, 21, 05, 01, 09, 00, 15, 05, 01, 09, 00, 0c, 05, 00, 0d, 00, 20, 02, 01, 05, 00, 06, 01, 01, 01, 00, 02] +Raw bytes (41): 0x[01, 01, 01, 01, 05, 07, 01, 34, 01, 00, 16, 01, 01, 08, 00, 23, 05, 01, 09, 00, 22, 05, 01, 09, 00, 15, 05, 01, 09, 00, 21, 02, 01, 05, 00, 06, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/pass-through.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 9 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 52, 1) to (start + 0, 22) -- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 29) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 33) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 35) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 34) - Code(Counter(1)) at (prev + 1, 9) to (start + 0, 21) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(1)) at (prev + 0, 13) to (start + 0, 32) +- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 33) - Code(Expression(0, Sub)) at (prev + 1, 5) to (start + 0, 6) = (c0 - c1) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) diff --git a/tests/coverage/match.cov-map b/tests/coverage/match.cov-map new file mode 100644 index 0000000000000..114e6e9c05847 --- /dev/null +++ b/tests/coverage/match.cov-map @@ -0,0 +1,32 @@ +Function name: match::match_expr +Raw bytes (83): 0x[01, 01, 07, 1d, 07, 0b, 19, 0f, 15, 05, 0d, 0d, 11, 05, 09, 01, 1d, 0d, 01, 06, 01, 00, 2a, 01, 01, 0b, 00, 0c, 02, 01, 14, 00, 1f, 19, 01, 14, 03, 0a, 15, 04, 14, 02, 0a, 0d, 03, 14, 00, 18, 11, 00, 1c, 02, 0a, 12, 03, 14, 00, 20, 05, 01, 18, 00, 22, 09, 00, 26, 02, 0a, 16, 03, 18, 00, 24, 1a, 01, 11, 00, 1c, 01, 02, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/match.rs +Number of expressions: 7 +- expression 0 operands: lhs = Counter(7), rhs = Expression(1, Add) +- expression 1 operands: lhs = Expression(2, Add), rhs = Counter(6) +- expression 2 operands: lhs = Expression(3, Add), rhs = Counter(5) +- expression 3 operands: lhs = Counter(1), rhs = Counter(3) +- expression 4 operands: lhs = Counter(3), rhs = Counter(4) +- expression 5 operands: lhs = Counter(1), rhs = Counter(2) +- expression 6 operands: lhs = Counter(0), rhs = Counter(7) +Number of file 0 mappings: 13 +- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 42) +- Code(Counter(0)) at (prev + 1, 11) to (start + 0, 12) +- Code(Expression(0, Sub)) at (prev + 1, 20) to (start + 0, 31) + = (c7 - (((c1 + c3) + c5) + c6)) +- Code(Counter(6)) at (prev + 1, 20) to (start + 3, 10) +- Code(Counter(5)) at (prev + 4, 20) to (start + 2, 10) +- Code(Counter(3)) at (prev + 3, 20) to (start + 0, 24) +- Code(Counter(4)) at (prev + 0, 28) to (start + 2, 10) +- Code(Expression(4, Sub)) at (prev + 3, 20) to (start + 0, 32) + = (c3 - c4) +- Code(Counter(1)) at (prev + 1, 24) to (start + 0, 34) +- Code(Counter(2)) at (prev + 0, 38) to (start + 2, 10) +- Code(Expression(5, Sub)) at (prev + 3, 24) to (start + 0, 36) + = (c1 - c2) +- Code(Expression(6, Sub)) at (prev + 1, 17) to (start + 0, 28) + = (c0 - c7) +- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) +Highest counter ID seen: c6 + diff --git a/tests/coverage/match.coverage b/tests/coverage/match.coverage new file mode 100644 index 0000000000000..9b268781e9a0a --- /dev/null +++ b/tests/coverage/match.coverage @@ -0,0 +1,42 @@ + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| | + LL| |// Basic test for `match` expressions with various kinds of arms and guards. + LL| | + LL| 16|fn match_expr(x: Option, cond: bool) { + LL| 16| match x { + LL| 0| Some(0) => say("zero"), + LL| 1| Some(1) => { + LL| 1| // (block with a trailing expression) + LL| 1| say("one") + LL| 1| } + LL| 2| Some(2) => { + LL| 2| say("two"); + LL| 2| } + LL| 3| Some(3) if cond => { + LL| 0| say("three-cond"); + LL| 0| } + LL| 3| Some(3) => say("three"), + LL| 9| Some(other) if other == 4 => { + LL| 4| say("four"); + LL| 4| } + LL| 5| Some(other) => say("other"), + LL| 1| None => say("none"), + LL| | } + LL| 16|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | for i in 0..=5 { + LL| | for _ in 0..i { + LL| | match_expr(Some(i), false); + LL| | } + LL| | } + LL| | match_expr(None, true); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} + diff --git a/tests/coverage/match.rs b/tests/coverage/match.rs new file mode 100644 index 0000000000000..c9d4fd75bdc18 --- /dev/null +++ b/tests/coverage/match.rs @@ -0,0 +1,41 @@ +#![feature(coverage_attribute)] +//@ edition: 2024 + +// Basic test for `match` expressions with various kinds of arms and guards. + +fn match_expr(x: Option, cond: bool) { + match x { + Some(0) => say("zero"), + Some(1) => { + // (block with a trailing expression) + say("one") + } + Some(2) => { + say("two"); + } + Some(3) if cond => { + say("three-cond"); + } + Some(3) => say("three"), + Some(other) if other == 4 => { + say("four"); + } + Some(other) => say("other"), + None => say("none"), + } +} + +#[coverage(off)] +fn main() { + for i in 0..=5 { + for _ in 0..i { + match_expr(Some(i), false); + } + } + match_expr(None, true); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); +} diff --git a/tests/coverage/no_spans_if_not.cov-map b/tests/coverage/no_spans_if_not.cov-map index c8aa5c7527d22..7daffb1f220b0 100644 --- a/tests/coverage/no_spans_if_not.cov-map +++ b/tests/coverage/no_spans_if_not.cov-map @@ -1,23 +1,23 @@ Function name: no_spans_if_not::affected_function -Raw bytes (24): 0x[01, 01, 00, 04, 01, 16, 1c, 00, 1d, 01, 01, 0c, 00, 12, 01, 01, 0d, 00, 0f, 00, 02, 0d, 00, 0f] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 16, 1c, 00, 1d, 01, 01, 0c, 00, 12, 01, 00, 13, 02, 0a, 00, 02, 10, 02, 0a] Number of files: 1 - file 0 => $DIR/no_spans_if_not.rs Number of expressions: 0 Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 22, 28) to (start + 0, 29) - Code(Counter(0)) at (prev + 1, 12) to (start + 0, 18) -- Code(Counter(0)) at (prev + 1, 13) to (start + 0, 15) -- Code(Zero) at (prev + 2, 13) to (start + 0, 15) +- Code(Counter(0)) at (prev + 0, 19) to (start + 2, 10) +- Code(Zero) at (prev + 2, 16) to (start + 2, 10) Highest counter ID seen: c0 Function name: no_spans_if_not::main -Raw bytes (19): 0x[01, 01, 00, 03, 01, 0b, 01, 00, 0a, 01, 01, 05, 00, 16, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 0b, 01, 00, 0a, 01, 01, 05, 00, 18, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/no_spans_if_not.rs Number of expressions: 0 Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 11, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 22) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 24) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/no_spans_if_not.coverage b/tests/coverage/no_spans_if_not.coverage index b5606c9043c3f..416780196b03e 100644 --- a/tests/coverage/no_spans_if_not.coverage +++ b/tests/coverage/no_spans_if_not.coverage @@ -22,9 +22,9 @@ LL| 1| fn affected_function() { LL| 1| if !false { LL| 1| () - LL| | } else { + LL| 1| } else { LL| 0| () - LL| | } + LL| 0| } LL| | } LL| |} diff --git a/tests/coverage/partial_eq.cov-map b/tests/coverage/partial_eq.cov-map deleted file mode 100644 index 8def64a3f546d..0000000000000 --- a/tests/coverage/partial_eq.cov-map +++ /dev/null @@ -1,28 +0,0 @@ -Function name: ::new -Raw bytes (24): 0x[01, 01, 00, 04, 01, 0c, 05, 00, 41, 01, 01, 09, 00, 25, 01, 00, 10, 00, 15, 01, 01, 05, 00, 06] -Number of files: 1 -- file 0 => $DIR/partial_eq.rs -Number of expressions: 0 -Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 12, 5) to (start + 0, 65) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 37) -- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 21) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: c0 - -Function name: partial_eq::main -Raw bytes (44): 0x[01, 01, 00, 08, 01, 11, 01, 00, 0a, 01, 01, 09, 00, 16, 01, 00, 19, 00, 25, 01, 01, 09, 00, 16, 01, 00, 19, 00, 25, 01, 02, 05, 00, 0d, 01, 04, 09, 00, 26, 01, 02, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/partial_eq.rs -Number of expressions: 0 -Number of file 0 mappings: 8 -- Code(Counter(0)) at (prev + 17, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 37) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 25) to (start + 0, 37) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 4, 9) to (start + 0, 38) -- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) -Highest counter ID seen: c0 - diff --git a/tests/coverage/rustfmt-skip.cov-map b/tests/coverage/rustfmt-skip.cov-map index 25e4995ea6da2..bb673a411bfdd 100644 --- a/tests/coverage/rustfmt-skip.cov-map +++ b/tests/coverage/rustfmt-skip.cov-map @@ -1,11 +1,12 @@ Function name: rustfmt_skip::main -Raw bytes (19): 0x[01, 01, 00, 03, 01, 0a, 01, 00, 0a, 01, 02, 05, 00, 0d, 01, 05, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 0a, 01, 00, 0a, 01, 02, 05, 00, 0d, 01, 03, 09, 00, 10, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/rustfmt-skip.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 10, 1) to (start + 0, 10) - Code(Counter(0)) at (prev + 2, 5) to (start + 0, 13) -- Code(Counter(0)) at (prev + 5, 1) to (start + 0, 2) +- Code(Counter(0)) at (prev + 3, 9) to (start + 0, 16) +- Code(Counter(0)) at (prev + 2, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/rustfmt-skip.coverage b/tests/coverage/rustfmt-skip.coverage index 08471181f41b3..b7276cf0ee8b8 100644 --- a/tests/coverage/rustfmt-skip.coverage +++ b/tests/coverage/rustfmt-skip.coverage @@ -12,7 +12,7 @@ LL| 1| println!( LL| | // Keep this on a separate line, to distinguish instrumentation of LL| | // `println!` from instrumentation of its arguments. - LL| | "hello" + LL| 1| "hello" LL| | ); LL| 1|} diff --git a/tests/coverage/sort_groups.cov-map b/tests/coverage/sort_groups.cov-map index 29d54d88a87ee..ec7954a7a6072 100644 --- a/tests/coverage/sort_groups.cov-map +++ b/tests/coverage/sort_groups.cov-map @@ -59,26 +59,22 @@ Number of file 0 mappings: 5 Highest counter ID seen: c1 Function name: sort_groups::main -Raw bytes (76): 0x[01, 01, 01, 01, 05, 0e, 01, 06, 01, 00, 0a, 01, 01, 09, 00, 0d, 01, 00, 10, 00, 2a, 01, 01, 05, 00, 15, 01, 00, 16, 00, 1a, 01, 01, 05, 00, 1f, 01, 00, 20, 00, 25, 01, 01, 08, 00, 1c, 05, 00, 24, 02, 06, 02, 02, 05, 00, 06, 01, 01, 05, 00, 16, 01, 00, 17, 00, 1b, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (56): 0x[01, 01, 01, 01, 05, 0a, 01, 06, 01, 00, 0a, 01, 01, 10, 00, 2a, 01, 01, 05, 00, 1b, 01, 01, 05, 00, 26, 01, 01, 08, 00, 23, 05, 00, 24, 02, 06, 02, 02, 05, 00, 06, 01, 01, 05, 00, 1c, 01, 01, 05, 00, 0f, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/sort_groups.rs Number of expressions: 1 - expression 0 operands: lhs = Counter(0), rhs = Counter(1) -Number of file 0 mappings: 14 +Number of file 0 mappings: 10 - Code(Counter(0)) at (prev + 6, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 13) -- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 42) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 21) -- Code(Counter(0)) at (prev + 0, 22) to (start + 0, 26) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 31) -- Code(Counter(0)) at (prev + 0, 32) to (start + 0, 37) -- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 28) +- Code(Counter(0)) at (prev + 1, 16) to (start + 0, 42) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 38) +- Code(Counter(0)) at (prev + 1, 8) to (start + 0, 35) - Code(Counter(1)) at (prev + 0, 36) to (start + 2, 6) - Code(Expression(0, Sub)) at (prev + 2, 5) to (start + 0, 6) = (c0 - c1) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 22) -- Code(Counter(0)) at (prev + 0, 23) to (start + 0, 27) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 28) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c1 diff --git a/tests/coverage/tight_inf_loop.cov-map b/tests/coverage/tight_inf_loop.cov-map index c6bee3bd7ad90..3179546223cc2 100644 --- a/tests/coverage/tight_inf_loop.cov-map +++ b/tests/coverage/tight_inf_loop.cov-map @@ -1,13 +1,13 @@ Function name: tight_inf_loop::main -Raw bytes (29): 0x[01, 01, 00, 05, 01, 01, 01, 00, 0a, 01, 01, 08, 00, 0d, 00, 01, 09, 00, 10, 01, 01, 05, 00, 06, 01, 01, 01, 00, 02] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 01, 01, 00, 0a, 01, 01, 08, 00, 0d, 00, 00, 0e, 02, 06, 01, 02, 05, 00, 06, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/tight_inf_loop.rs Number of expressions: 0 Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 10) - Code(Counter(0)) at (prev + 1, 8) to (start + 0, 13) -- Code(Zero) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 6) +- Code(Zero) at (prev + 0, 14) to (start + 2, 6) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 6) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/try-in-macro.attr.cov-map b/tests/coverage/try-in-macro.attr.cov-map index 1b6c97cf145a2..1606fdb59da28 100644 --- a/tests/coverage/try-in-macro.attr.cov-map +++ b/tests/coverage/try-in-macro.attr.cov-map @@ -1,11 +1,11 @@ Function name: try_in_macro::main -Raw bytes (19): 0x[01, 01, 00, 03, 01, 29, 01, 00, 0a, 01, 01, 05, 00, 1a, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 29, 01, 00, 0a, 01, 01, 05, 00, 1c, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/try-in-macro.rs Number of expressions: 0 Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 41, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 28) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/try-in-macro.bang.cov-map b/tests/coverage/try-in-macro.bang.cov-map index 1b6c97cf145a2..1606fdb59da28 100644 --- a/tests/coverage/try-in-macro.bang.cov-map +++ b/tests/coverage/try-in-macro.bang.cov-map @@ -1,11 +1,11 @@ Function name: try_in_macro::main -Raw bytes (19): 0x[01, 01, 00, 03, 01, 29, 01, 00, 0a, 01, 01, 05, 00, 1a, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 29, 01, 00, 0a, 01, 01, 05, 00, 1c, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/try-in-macro.rs Number of expressions: 0 Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 41, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 28) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/try-in-macro.derive.cov-map b/tests/coverage/try-in-macro.derive.cov-map index 1b6c97cf145a2..1606fdb59da28 100644 --- a/tests/coverage/try-in-macro.derive.cov-map +++ b/tests/coverage/try-in-macro.derive.cov-map @@ -1,11 +1,11 @@ Function name: try_in_macro::main -Raw bytes (19): 0x[01, 01, 00, 03, 01, 29, 01, 00, 0a, 01, 01, 05, 00, 1a, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 29, 01, 00, 0a, 01, 01, 05, 00, 1c, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/try-in-macro.rs Number of expressions: 0 Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 41, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 28) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/unicode.cov-map b/tests/coverage/unicode.cov-map index b118c847e8fff..0a7f3f442966e 100644 --- a/tests/coverage/unicode.cov-map +++ b/tests/coverage/unicode.cov-map @@ -1,23 +1,21 @@ Function name: unicode::main -Raw bytes (58): 0x[01, 01, 02, 05, 01, 01, 0d, 0a, 01, 0e, 01, 00, 0a, 02, 01, 09, 00, 0c, 01, 00, 10, 00, 1b, 02, 00, 1c, 00, 28, 01, 02, 08, 00, 23, 09, 00, 29, 00, 44, 0d, 00, 47, 02, 06, 06, 02, 05, 00, 06, 01, 02, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (53): 0x[01, 01, 02, 05, 01, 01, 0d, 09, 01, 0e, 01, 00, 0a, 01, 01, 10, 00, 1b, 02, 00, 1c, 00, 28, 01, 02, 08, 00, 25, 09, 00, 29, 00, 46, 0d, 00, 47, 02, 06, 06, 02, 05, 00, 06, 01, 02, 05, 00, 0d, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/unicode.rs Number of expressions: 2 - expression 0 operands: lhs = Counter(1), rhs = Counter(0) - expression 1 operands: lhs = Counter(0), rhs = Counter(3) -Number of file 0 mappings: 10 +Number of file 0 mappings: 9 - Code(Counter(0)) at (prev + 14, 1) to (start + 0, 10) -- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 12) - = (c1 - c0) -- Code(Counter(0)) at (prev + 0, 16) to (start + 0, 27) +- Code(Counter(0)) at (prev + 1, 16) to (start + 0, 27) - Code(Expression(0, Sub)) at (prev + 0, 28) to (start + 0, 40) = (c1 - c0) -- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 35) -- Code(Counter(2)) at (prev + 0, 41) to (start + 0, 68) +- Code(Counter(0)) at (prev + 2, 8) to (start + 0, 37) +- Code(Counter(2)) at (prev + 0, 41) to (start + 0, 70) - Code(Counter(3)) at (prev + 0, 71) to (start + 2, 6) - Code(Expression(1, Sub)) at (prev + 2, 5) to (start + 0, 6) = (c0 - c3) -- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 11) +- Code(Counter(0)) at (prev + 2, 5) to (start + 0, 13) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c3 @@ -32,13 +30,13 @@ Number of file 0 mappings: 2 Highest counter ID seen: (none) Function name: unicode::申し訳ございません -Raw bytes (19): 0x[01, 01, 00, 03, 01, 18, 01, 00, 29, 01, 01, 05, 00, 19, 01, 01, 01, 00, 02] +Raw bytes (19): 0x[01, 01, 00, 03, 01, 18, 01, 00, 29, 01, 01, 05, 00, 20, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/unicode.rs Number of expressions: 0 Number of file 0 mappings: 3 - Code(Counter(0)) at (prev + 24, 1) to (start + 0, 41) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 25) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 32) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 diff --git a/tests/coverage/unicode.coverage b/tests/coverage/unicode.coverage index 188848889d30c..0656700a8b7f7 100644 --- a/tests/coverage/unicode.coverage +++ b/tests/coverage/unicode.coverage @@ -15,7 +15,7 @@ LL| 32| for _İ in 'А'..='Я' { /* Я */ } ^1 LL| | - LL| 1| if 申し訳ございません() && 申し訳ございません() { + LL| 1| if 申し訳ございません() && 申し訳ございません() { ^0 LL| 0| println!("true"); LL| 1| } diff --git a/tests/coverage/unreachable.cov-map b/tests/coverage/unreachable.cov-map index c38786ee664c1..399a63f93ddca 100644 --- a/tests/coverage/unreachable.cov-map +++ b/tests/coverage/unreachable.cov-map @@ -1,29 +1,29 @@ Function name: unreachable::UNREACHABLE_CLOSURE::{closure#0} (unused) -Raw bytes (9): 0x[01, 01, 00, 01, 00, 0e, 30, 00, 45] +Raw bytes (9): 0x[01, 01, 00, 01, 00, 0e, 30, 00, 47] Number of files: 1 - file 0 => $DIR/unreachable.rs Number of expressions: 0 Number of file 0 mappings: 1 -- Code(Zero) at (prev + 14, 48) to (start + 0, 69) +- Code(Zero) at (prev + 14, 48) to (start + 0, 71) Highest counter ID seen: (none) Function name: unreachable::unreachable_function (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 10, 01, 00, 1a, 00, 01, 0e, 00, 23] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 10, 01, 00, 1a, 00, 01, 05, 00, 27] Number of files: 1 - file 0 => $DIR/unreachable.rs Number of expressions: 0 Number of file 0 mappings: 2 - Code(Zero) at (prev + 16, 1) to (start + 0, 26) -- Code(Zero) at (prev + 1, 14) to (start + 0, 35) +- Code(Zero) at (prev + 1, 5) to (start + 0, 39) Highest counter ID seen: (none) Function name: unreachable::unreachable_intrinsic (unused) -Raw bytes (14): 0x[01, 01, 00, 02, 00, 15, 01, 00, 1b, 00, 01, 0e, 00, 2a] +Raw bytes (14): 0x[01, 01, 00, 02, 00, 15, 01, 00, 1b, 00, 01, 05, 00, 2e] Number of files: 1 - file 0 => $DIR/unreachable.rs Number of expressions: 0 Number of file 0 mappings: 2 - Code(Zero) at (prev + 21, 1) to (start + 0, 27) -- Code(Zero) at (prev + 1, 14) to (start + 0, 42) +- Code(Zero) at (prev + 1, 5) to (start + 0, 46) Highest counter ID seen: (none) diff --git a/tests/coverage/unused.cov-map b/tests/coverage/unused.cov-map index 3380997b921ee..5574c6dd21d90 100644 --- a/tests/coverage/unused.cov-map +++ b/tests/coverage/unused.cov-map @@ -1,15 +1,14 @@ Function name: unused::foo:: -Raw bytes (50): 0x[01, 01, 03, 05, 01, 05, 0b, 01, 09, 08, 01, 03, 01, 00, 10, 01, 01, 09, 00, 0e, 01, 00, 11, 00, 12, 05, 01, 0b, 00, 11, 02, 01, 09, 00, 0f, 06, 00, 13, 00, 19, 02, 01, 09, 00, 0f, 01, 02, 01, 00, 02] +Raw bytes (45): 0x[01, 01, 03, 05, 01, 05, 0b, 01, 09, 07, 01, 03, 01, 00, 10, 01, 01, 11, 00, 12, 05, 01, 0b, 00, 11, 02, 01, 09, 00, 0f, 06, 00, 13, 00, 19, 02, 01, 09, 00, 0f, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/unused.rs Number of expressions: 3 - expression 0 operands: lhs = Counter(1), rhs = Counter(0) - expression 1 operands: lhs = Counter(1), rhs = Expression(2, Add) - expression 2 operands: lhs = Counter(0), rhs = Counter(2) -Number of file 0 mappings: 8 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 3, 1) to (start + 0, 16) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 18) - Code(Counter(1)) at (prev + 1, 11) to (start + 0, 17) - Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) = (c1 - c0) @@ -21,17 +20,16 @@ Number of file 0 mappings: 8 Highest counter ID seen: c1 Function name: unused::foo:: -Raw bytes (50): 0x[01, 01, 03, 05, 01, 05, 0b, 01, 09, 08, 01, 03, 01, 00, 10, 01, 01, 09, 00, 0e, 01, 00, 11, 00, 12, 05, 01, 0b, 00, 11, 02, 01, 09, 00, 0f, 06, 00, 13, 00, 19, 02, 01, 09, 00, 0f, 01, 02, 01, 00, 02] +Raw bytes (45): 0x[01, 01, 03, 05, 01, 05, 0b, 01, 09, 07, 01, 03, 01, 00, 10, 01, 01, 11, 00, 12, 05, 01, 0b, 00, 11, 02, 01, 09, 00, 0f, 06, 00, 13, 00, 19, 02, 01, 09, 00, 0f, 01, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/unused.rs Number of expressions: 3 - expression 0 operands: lhs = Counter(1), rhs = Counter(0) - expression 1 operands: lhs = Counter(1), rhs = Expression(2, Add) - expression 2 operands: lhs = Counter(0), rhs = Counter(2) -Number of file 0 mappings: 8 +Number of file 0 mappings: 7 - Code(Counter(0)) at (prev + 3, 1) to (start + 0, 16) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 14) -- Code(Counter(0)) at (prev + 0, 17) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 18) - Code(Counter(1)) at (prev + 1, 11) to (start + 0, 17) - Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) = (c1 - c0) @@ -43,14 +41,14 @@ Number of file 0 mappings: 8 Highest counter ID seen: c1 Function name: unused::main -Raw bytes (29): 0x[01, 01, 00, 05, 01, 25, 01, 00, 1c, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0f, 01, 01, 05, 00, 0b, 01, 01, 01, 00, 02] +Raw bytes (29): 0x[01, 01, 00, 05, 01, 25, 01, 00, 1c, 01, 01, 05, 00, 12, 01, 01, 05, 00, 14, 01, 01, 05, 00, 0b, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/unused.rs Number of expressions: 0 Number of file 0 mappings: 5 - Code(Counter(0)) at (prev + 37, 1) to (start + 0, 28) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) -- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 15) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 18) +- Code(Counter(0)) at (prev + 1, 5) to (start + 0, 20) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 11) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 @@ -95,14 +93,13 @@ Number of file 0 mappings: 5 Highest counter ID seen: (none) Function name: unused::unused_template_func::<_> (unused) -Raw bytes (44): 0x[01, 01, 00, 08, 00, 0b, 01, 00, 21, 00, 01, 09, 00, 0e, 00, 00, 11, 00, 12, 00, 01, 0b, 00, 11, 00, 01, 09, 00, 0f, 00, 00, 13, 00, 19, 00, 01, 09, 00, 0f, 00, 02, 01, 00, 02] +Raw bytes (39): 0x[01, 01, 00, 07, 00, 0b, 01, 00, 21, 00, 01, 11, 00, 12, 00, 01, 0b, 00, 11, 00, 01, 09, 00, 0f, 00, 00, 13, 00, 19, 00, 01, 09, 00, 0f, 00, 02, 01, 00, 02] Number of files: 1 - file 0 => $DIR/unused.rs Number of expressions: 0 -Number of file 0 mappings: 8 +Number of file 0 mappings: 7 - Code(Zero) at (prev + 11, 1) to (start + 0, 33) -- Code(Zero) at (prev + 1, 9) to (start + 0, 14) -- Code(Zero) at (prev + 0, 17) to (start + 0, 18) +- Code(Zero) at (prev + 1, 17) to (start + 0, 18) - Code(Zero) at (prev + 1, 11) to (start + 0, 17) - Code(Zero) at (prev + 1, 9) to (start + 0, 15) - Code(Zero) at (prev + 0, 19) to (start + 0, 25) diff --git a/tests/coverage/unused_mod.cov-map b/tests/coverage/unused_mod.cov-map index ab8aad618e511..ea419edbdafe6 100644 --- a/tests/coverage/unused_mod.cov-map +++ b/tests/coverage/unused_mod.cov-map @@ -1,22 +1,24 @@ Function name: unused_mod::main -Raw bytes (19): 0x[01, 01, 00, 03, 01, 04, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 01, 00, 04, 01, 04, 01, 00, 0a, 01, 01, 05, 00, 0d, 01, 00, 0e, 00, 1c, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/unused_mod.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Counter(0)) at (prev + 4, 1) to (start + 0, 10) - Code(Counter(0)) at (prev + 1, 5) to (start + 0, 13) +- Code(Counter(0)) at (prev + 0, 14) to (start + 0, 28) - Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: c0 Function name: unused_mod::unused_module::never_called_function (unused) -Raw bytes (19): 0x[01, 02, 00, 03, 00, 02, 01, 00, 1f, 00, 01, 05, 00, 0d, 00, 01, 01, 00, 02] +Raw bytes (24): 0x[01, 02, 00, 04, 00, 02, 01, 00, 1f, 00, 01, 05, 00, 0d, 00, 00, 0e, 00, 21, 00, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/auxiliary/unused_mod_helper.rs Number of expressions: 0 -Number of file 0 mappings: 3 +Number of file 0 mappings: 4 - Code(Zero) at (prev + 2, 1) to (start + 0, 31) - Code(Zero) at (prev + 1, 5) to (start + 0, 13) +- Code(Zero) at (prev + 0, 14) to (start + 0, 33) - Code(Zero) at (prev + 1, 1) to (start + 0, 2) Highest counter ID seen: (none) diff --git a/tests/coverage/while.cov-map b/tests/coverage/while.cov-map index c4183e18e021d..9e8fe99d1d8b5 100644 --- a/tests/coverage/while.cov-map +++ b/tests/coverage/while.cov-map @@ -1,14 +1,36 @@ -Function name: while::main -Raw bytes (34): 0x[01, 01, 00, 06, 01, 01, 01, 00, 0a, 01, 01, 09, 00, 0c, 01, 00, 0f, 00, 10, 01, 01, 0b, 00, 14, 00, 00, 15, 02, 06, 01, 03, 01, 00, 02] +Function name: while::while_with_tail_expr +Raw bytes (41): 0x[01, 01, 01, 05, 01, 07, 01, 06, 01, 00, 1a, 01, 01, 11, 00, 12, 05, 01, 0b, 00, 10, 02, 00, 11, 03, 06, 02, 01, 09, 00, 0f, 01, 03, 05, 00, 13, 01, 01, 01, 00, 02] Number of files: 1 - file 0 => $DIR/while.rs -Number of expressions: 0 -Number of file 0 mappings: 6 -- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 12) -- Code(Counter(0)) at (prev + 0, 15) to (start + 0, 16) -- Code(Counter(0)) at (prev + 1, 11) to (start + 0, 20) -- Code(Zero) at (prev + 0, 21) to (start + 2, 6) -- Code(Counter(0)) at (prev + 3, 1) to (start + 0, 2) -Highest counter ID seen: c0 +Number of expressions: 1 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +Number of file 0 mappings: 7 +- Code(Counter(0)) at (prev + 6, 1) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 18) +- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 16) +- Code(Expression(0, Sub)) at (prev + 0, 17) to (start + 3, 6) + = (c1 - c0) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) + = (c1 - c0) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 + +Function name: while::while_with_tail_stmt +Raw bytes (41): 0x[01, 01, 01, 05, 01, 07, 01, 0f, 01, 00, 1a, 01, 01, 11, 00, 12, 05, 01, 0b, 00, 10, 02, 00, 11, 03, 06, 02, 01, 09, 00, 0f, 01, 03, 05, 00, 13, 01, 01, 01, 00, 02] +Number of files: 1 +- file 0 => $DIR/while.rs +Number of expressions: 1 +- expression 0 operands: lhs = Counter(1), rhs = Counter(0) +Number of file 0 mappings: 7 +- Code(Counter(0)) at (prev + 15, 1) to (start + 0, 26) +- Code(Counter(0)) at (prev + 1, 17) to (start + 0, 18) +- Code(Counter(1)) at (prev + 1, 11) to (start + 0, 16) +- Code(Expression(0, Sub)) at (prev + 0, 17) to (start + 3, 6) + = (c1 - c0) +- Code(Expression(0, Sub)) at (prev + 1, 9) to (start + 0, 15) + = (c1 - c0) +- Code(Counter(0)) at (prev + 3, 5) to (start + 0, 19) +- Code(Counter(0)) at (prev + 1, 1) to (start + 0, 2) +Highest counter ID seen: c1 diff --git a/tests/coverage/while.coverage b/tests/coverage/while.coverage index 90c16288d668c..bfb57da777ca2 100644 --- a/tests/coverage/while.coverage +++ b/tests/coverage/while.coverage @@ -1,7 +1,34 @@ - LL| 1|fn main() { - LL| 1| let num = 9; - LL| 1| while num >= 10 { - LL| 0| // loop body - LL| 0| } + LL| |#![feature(coverage_attribute)] + LL| |//@ edition: 2024 + LL| | + LL| |// Basic test for `while` expressions. + LL| | + LL| 1|fn while_with_tail_expr() { + LL| 1| let mut x = 5; + LL| 6| while x > 0 { + LL| 5| x -= 1; + LL| 5| say("decreased x") + LL| 5| } + LL| 1| say("goodbye"); LL| 1|} + LL| | + LL| 1|fn while_with_tail_stmt() { + LL| 1| let mut x = 5; + LL| 6| while x > 0 { + LL| 5| x -= 1; + LL| 5| say("decreased x"); + LL| 5| } + LL| 1| say("goodbye"); + LL| 1|} + LL| | + LL| |#[coverage(off)] + LL| |fn main() { + LL| | while_with_tail_expr(); + LL| | while_with_tail_stmt(); + LL| |} + LL| | + LL| |#[coverage(off)] + LL| |fn say(msg: &str) { + LL| | println!("{msg}"); + LL| |} diff --git a/tests/coverage/while.rs b/tests/coverage/while.rs index d60916a979818..77ef50d09a6ac 100644 --- a/tests/coverage/while.rs +++ b/tests/coverage/while.rs @@ -1,6 +1,33 @@ -fn main() { - let num = 9; - while num >= 10 { - // loop body +#![feature(coverage_attribute)] +//@ edition: 2024 + +// Basic test for `while` expressions. + +fn while_with_tail_expr() { + let mut x = 5; + while x > 0 { + x -= 1; + say("decreased x") + } + say("goodbye"); +} + +fn while_with_tail_stmt() { + let mut x = 5; + while x > 0 { + x -= 1; + say("decreased x"); } + say("goodbye"); +} + +#[coverage(off)] +fn main() { + while_with_tail_expr(); + while_with_tail_stmt(); +} + +#[coverage(off)] +fn say(msg: &str) { + println!("{msg}"); } diff --git a/tests/coverage/yield.cov-map b/tests/coverage/yield.cov-map deleted file mode 100644 index 8c1da30c08b6c..0000000000000 --- a/tests/coverage/yield.cov-map +++ /dev/null @@ -1,69 +0,0 @@ -Function name: yield::main -Raw bytes (139): 0x[01, 01, 05, 01, 05, 05, 09, 09, 11, 11, 15, 11, 15, 19, 01, 08, 01, 00, 0a, 01, 01, 09, 00, 16, 01, 06, 0b, 00, 2e, 01, 00, 0b, 00, 13, 01, 00, 14, 00, 22, 05, 01, 27, 00, 29, 02, 01, 0e, 00, 14, 05, 02, 0b, 00, 2e, 05, 00, 0b, 00, 13, 05, 00, 14, 00, 22, 0d, 01, 22, 00, 27, 09, 00, 2c, 00, 2e, 06, 01, 0e, 00, 14, 09, 03, 09, 00, 16, 09, 08, 0b, 00, 2e, 09, 00, 0b, 00, 13, 09, 00, 14, 00, 22, 11, 01, 27, 00, 29, 0a, 01, 0e, 00, 14, 11, 02, 0b, 00, 2e, 11, 00, 0b, 00, 13, 11, 00, 14, 00, 22, 12, 01, 27, 00, 29, 15, 01, 0e, 00, 14, 12, 02, 01, 00, 02] -Number of files: 1 -- file 0 => $DIR/yield.rs -Number of expressions: 5 -- expression 0 operands: lhs = Counter(0), rhs = Counter(1) -- expression 1 operands: lhs = Counter(1), rhs = Counter(2) -- expression 2 operands: lhs = Counter(2), rhs = Counter(4) -- expression 3 operands: lhs = Counter(4), rhs = Counter(5) -- expression 4 operands: lhs = Counter(4), rhs = Counter(5) -Number of file 0 mappings: 25 -- Code(Counter(0)) at (prev + 8, 1) to (start + 0, 10) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 22) -- Code(Counter(0)) at (prev + 6, 11) to (start + 0, 46) -- Code(Counter(0)) at (prev + 0, 11) to (start + 0, 19) -- Code(Counter(0)) at (prev + 0, 20) to (start + 0, 34) -- Code(Counter(1)) at (prev + 1, 39) to (start + 0, 41) -- Code(Expression(0, Sub)) at (prev + 1, 14) to (start + 0, 20) - = (c0 - c1) -- Code(Counter(1)) at (prev + 2, 11) to (start + 0, 46) -- Code(Counter(1)) at (prev + 0, 11) to (start + 0, 19) -- Code(Counter(1)) at (prev + 0, 20) to (start + 0, 34) -- Code(Counter(3)) at (prev + 1, 34) to (start + 0, 39) -- Code(Counter(2)) at (prev + 0, 44) to (start + 0, 46) -- Code(Expression(1, Sub)) at (prev + 1, 14) to (start + 0, 20) - = (c1 - c2) -- Code(Counter(2)) at (prev + 3, 9) to (start + 0, 22) -- Code(Counter(2)) at (prev + 8, 11) to (start + 0, 46) -- Code(Counter(2)) at (prev + 0, 11) to (start + 0, 19) -- Code(Counter(2)) at (prev + 0, 20) to (start + 0, 34) -- Code(Counter(4)) at (prev + 1, 39) to (start + 0, 41) -- Code(Expression(2, Sub)) at (prev + 1, 14) to (start + 0, 20) - = (c2 - c4) -- Code(Counter(4)) at (prev + 2, 11) to (start + 0, 46) -- Code(Counter(4)) at (prev + 0, 11) to (start + 0, 19) -- Code(Counter(4)) at (prev + 0, 20) to (start + 0, 34) -- Code(Expression(4, Sub)) at (prev + 1, 39) to (start + 0, 41) - = (c4 - c5) -- Code(Counter(5)) at (prev + 1, 14) to (start + 0, 20) -- Code(Expression(4, Sub)) at (prev + 2, 1) to (start + 0, 2) - = (c4 - c5) -Highest counter ID seen: c5 - -Function name: yield::main::{closure#0} -Raw bytes (24): 0x[01, 01, 00, 04, 01, 0a, 08, 00, 09, 01, 01, 09, 00, 10, 05, 01, 10, 00, 15, 05, 01, 05, 00, 06] -Number of files: 1 -- file 0 => $DIR/yield.rs -Number of expressions: 0 -Number of file 0 mappings: 4 -- Code(Counter(0)) at (prev + 10, 8) to (start + 0, 9) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(1)) at (prev + 1, 16) to (start + 0, 21) -- Code(Counter(1)) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: c1 - -Function name: yield::main::{closure#1} -Raw bytes (34): 0x[01, 01, 00, 06, 01, 19, 08, 00, 09, 01, 01, 09, 00, 10, 05, 01, 09, 00, 10, 09, 01, 09, 00, 10, 0d, 01, 10, 00, 15, 0d, 01, 05, 00, 06] -Number of files: 1 -- file 0 => $DIR/yield.rs -Number of expressions: 0 -Number of file 0 mappings: 6 -- Code(Counter(0)) at (prev + 25, 8) to (start + 0, 9) -- Code(Counter(0)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(1)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(2)) at (prev + 1, 9) to (start + 0, 16) -- Code(Counter(3)) at (prev + 1, 16) to (start + 0, 21) -- Code(Counter(3)) at (prev + 1, 5) to (start + 0, 6) -Highest counter ID seen: c3 - diff --git a/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff b/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff index fa88211383a04..223856b4541c6 100644 --- a/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff @@ -28,23 +28,19 @@ + coverage Code { bcb: bcb0 } => $DIR/branch_match_arms.rs:14:1: 14:10 (#0); + coverage Code { bcb: bcb0 } => $DIR/branch_match_arms.rs:15:11: 15:21 (#0); -+ coverage Code { bcb: bcb1 } => $DIR/branch_match_arms.rs:16:17: 16:18 (#0); -+ coverage Code { bcb: bcb1 } => $DIR/branch_match_arms.rs:16:23: 16:30 (#0); -+ coverage Code { bcb: bcb1 } => $DIR/branch_match_arms.rs:16:31: 16:32 (#0); -+ coverage Code { bcb: bcb3 } => $DIR/branch_match_arms.rs:17:17: 17:18 (#0); -+ coverage Code { bcb: bcb3 } => $DIR/branch_match_arms.rs:17:23: 17:30 (#0); -+ coverage Code { bcb: bcb3 } => $DIR/branch_match_arms.rs:17:31: 17:32 (#0); -+ coverage Code { bcb: bcb4 } => $DIR/branch_match_arms.rs:18:17: 18:18 (#0); -+ coverage Code { bcb: bcb4 } => $DIR/branch_match_arms.rs:18:23: 18:30 (#0); -+ coverage Code { bcb: bcb4 } => $DIR/branch_match_arms.rs:18:31: 18:32 (#0); -+ coverage Code { bcb: bcb5 } => $DIR/branch_match_arms.rs:19:17: 19:18 (#0); -+ coverage Code { bcb: bcb5 } => $DIR/branch_match_arms.rs:19:23: 19:30 (#0); -+ coverage Code { bcb: bcb5 } => $DIR/branch_match_arms.rs:19:31: 19:32 (#0); ++ coverage Code { bcb: bcb1 } => $DIR/branch_match_arms.rs:16:23: 16:33 (#0); ++ coverage Code { bcb: bcb3 } => $DIR/branch_match_arms.rs:17:23: 17:33 (#0); ++ coverage Code { bcb: bcb4 } => $DIR/branch_match_arms.rs:18:23: 18:33 (#0); ++ coverage Code { bcb: bcb5 } => $DIR/branch_match_arms.rs:19:23: 19:33 (#0); + coverage Code { bcb: bcb2 } => $DIR/branch_match_arms.rs:21:1: 21:2 (#0); + bb0: { + Coverage::VirtualCounter(bcb0); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).48); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).2); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).3); StorageLive(_1); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).7); _1 = Enum::A(const 0_u32); PlaceMention(_1); _2 = discriminant(_1); @@ -75,6 +71,9 @@ + Coverage::VirtualCounter(bcb5); StorageLive(_9); _9 = copy ((_1 as A).0: u32); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).43); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).44); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).46); StorageLive(_10); _10 = copy _9; _0 = consume(move _10) -> [return: bb12, unwind: bb14]; @@ -83,6 +82,9 @@ bb6: { StorageLive(_7); _7 = copy ((_1 as B).0: u32); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).33); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).34); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).36); StorageLive(_8); _8 = copy _7; _0 = consume(move _8) -> [return: bb11, unwind: bb14]; @@ -91,6 +93,9 @@ bb7: { StorageLive(_5); _5 = copy ((_1 as C).0: u32); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).23); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).24); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).26); StorageLive(_6); _6 = copy _5; _0 = consume(move _6) -> [return: bb10, unwind: bb14]; @@ -99,6 +104,9 @@ bb8: { StorageLive(_3); _3 = copy ((_1 as D).0: u32); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).13); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).14); + Coverage::Point(Expr, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).16); StorageLive(_4); _4 = copy _3; _0 = consume(move _4) -> [return: bb9, unwind: bb14]; @@ -131,6 +139,7 @@ bb13: { + Coverage::VirtualCounter(bcb2); StorageDead(_1); + Coverage::Point(FunctionEnd, HirId(DefId(0:16 ~ branch_match_arms[d109]::main).0); return; } diff --git a/tests/mir-opt/coverage/instrument_coverage.bar.InstrumentCoverage.diff b/tests/mir-opt/coverage/instrument_coverage.bar.InstrumentCoverage.diff index 9b6d2b22087b6..01b01a356c00c 100644 --- a/tests/mir-opt/coverage/instrument_coverage.bar.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/instrument_coverage.bar.InstrumentCoverage.diff @@ -10,7 +10,10 @@ + bb0: { + Coverage::VirtualCounter(bcb0); + Coverage::Point(Expr, HirId(DefId(0:4 ~ instrument_coverage[f559]::bar).3); + Coverage::Point(Expr, HirId(DefId(0:4 ~ instrument_coverage[f559]::bar).2); _0 = const true; + Coverage::Point(FunctionEnd, HirId(DefId(0:4 ~ instrument_coverage[f559]::bar).0); return; } } diff --git a/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff b/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff index b2bb2375aee60..f83584dbccb0a 100644 --- a/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/instrument_coverage.main.InstrumentCoverage.diff @@ -8,13 +8,15 @@ let mut _3: !; + coverage Code { bcb: bcb0 } => $DIR/instrument_coverage.rs:13:1: 13:10 (#0); -+ coverage Code { bcb: bcb1 } => $DIR/instrument_coverage.rs:15:12: 15:15 (#0); -+ coverage Code { bcb: bcb2 } => $DIR/instrument_coverage.rs:16:13: 16:18 (#0); ++ coverage Code { bcb: bcb1 } => $DIR/instrument_coverage.rs:15:12: 15:17 (#0); ++ coverage Code { bcb: bcb2 } => $DIR/instrument_coverage.rs:15:18: 17:10 (#0); + coverage Code { bcb: bcb3 } => $DIR/instrument_coverage.rs:17:9: 17:10 (#0); + coverage Code { bcb: bcb2 } => $DIR/instrument_coverage.rs:19:1: 19:2 (#0); + bb0: { + Coverage::VirtualCounter(bcb0); + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage[f559]::main).12); + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage[f559]::main).2); goto -> bb1; } @@ -24,7 +26,10 @@ } bb2: { + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage[f559]::main).4); + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage[f559]::main).5); StorageLive(_2); + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage[f559]::main).6); _2 = bar() -> [return: bb3, unwind: bb6]; } @@ -34,13 +39,17 @@ bb4: { + Coverage::VirtualCounter(bcb2); + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage[f559]::main).11); + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage[f559]::main).9); _0 = const (); StorageDead(_2); + Coverage::Point(FunctionEnd, HirId(DefId(0:3 ~ instrument_coverage[f559]::main).0); return; } bb5: { + Coverage::VirtualCounter(bcb3); + Coverage::Point(ImplicitElse, HirId(DefId(0:3 ~ instrument_coverage[f559]::main).4); _1 = const (); StorageDead(_2); goto -> bb1; diff --git a/tests/mir-opt/coverage/instrument_coverage_cleanup.main.CleanupPostBorrowck.diff b/tests/mir-opt/coverage/instrument_coverage_cleanup.main.CleanupPostBorrowck.diff index 2eb78c08ee800..9c5e603c69aec 100644 --- a/tests/mir-opt/coverage/instrument_coverage_cleanup.main.CleanupPostBorrowck.diff +++ b/tests/mir-opt/coverage/instrument_coverage_cleanup.main.CleanupPostBorrowck.diff @@ -16,9 +16,19 @@ bb0: { Coverage::VirtualCounter(bcb0); -- Coverage::SpanMarker; +- Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).12); +- Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).2); +- Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).3); +- Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).4); ++ nop; ++ nop; ++ nop; + nop; StorageLive(_1); +- Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).5); +- Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).9); ++ nop; ++ nop; _1 = std::hint::black_box::(const true) -> [return: bb1, unwind: bb5]; } @@ -29,6 +39,8 @@ bb2: { Coverage::VirtualCounter(bcb1); - Coverage::BlockMarker(1); +- Coverage::Point(ImplicitElse, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).2); ++ nop; + nop; _0 = const (); goto -> bb4; @@ -37,6 +49,8 @@ bb3: { Coverage::VirtualCounter(bcb3); - Coverage::BlockMarker(0); +- Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).11); ++ nop; + nop; _0 = const (); goto -> bb4; @@ -45,6 +59,8 @@ bb4: { Coverage::VirtualCounter(bcb2); StorageDead(_1); +- Coverage::Point(FunctionEnd, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).0); ++ nop; return; } diff --git a/tests/mir-opt/coverage/instrument_coverage_cleanup.main.InstrumentCoverage.diff b/tests/mir-opt/coverage/instrument_coverage_cleanup.main.InstrumentCoverage.diff index 0c1bc24b6dc19..4365ae794d8ce 100644 --- a/tests/mir-opt/coverage/instrument_coverage_cleanup.main.InstrumentCoverage.diff +++ b/tests/mir-opt/coverage/instrument_coverage_cleanup.main.InstrumentCoverage.diff @@ -16,8 +16,13 @@ + bb0: { + Coverage::VirtualCounter(bcb0); - Coverage::SpanMarker; + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).12); + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).2); + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).3); + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).4); StorageLive(_1); + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).5); + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).9); _1 = std::hint::black_box::(const true) -> [return: bb1, unwind: bb5]; } @@ -28,6 +33,7 @@ bb2: { + Coverage::VirtualCounter(bcb1); Coverage::BlockMarker(1); + Coverage::Point(ImplicitElse, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).2); _0 = const (); goto -> bb4; } @@ -35,6 +41,7 @@ bb3: { + Coverage::VirtualCounter(bcb3); Coverage::BlockMarker(0); + Coverage::Point(Expr, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).11); _0 = const (); goto -> bb4; } @@ -42,6 +49,7 @@ bb4: { + Coverage::VirtualCounter(bcb2); StorageDead(_1); + Coverage::Point(FunctionEnd, HirId(DefId(0:3 ~ instrument_coverage_cleanup[820a]::main).0); return; } diff --git a/tests/mir-opt/coverage/instrument_coverage_cleanup.rs b/tests/mir-opt/coverage/instrument_coverage_cleanup.rs index e8af4d6174f43..d725148e52707 100644 --- a/tests/mir-opt/coverage/instrument_coverage_cleanup.rs +++ b/tests/mir-opt/coverage/instrument_coverage_cleanup.rs @@ -2,7 +2,7 @@ // inserted during MIR building (after InstrumentCoverage is done with them), // but leaves the statements that were added by InstrumentCoverage. // -// Removed statement kinds: BlockMarker, SpanMarker +// Removed statement kinds: Point, BlockMarker // Retained statement kinds: VirtualCounter //@ test-mir-pass: InstrumentCoverage @@ -14,8 +14,8 @@ fn main() { if !core::hint::black_box(true) {} } +// CHECK-NOT: Coverage::Point // CHECK-NOT: Coverage::BlockMarker -// CHECK-NOT: Coverage::SpanMarker // CHECK: Coverage::VirtualCounter +// CHECK-NOT: Coverage::Point // CHECK-NOT: Coverage::BlockMarker -// CHECK-NOT: Coverage::SpanMarker