diff options
| author | Rich Kadel <richkadel@google.com> | 2020-06-03 21:19:34 -0700 |
|---|---|---|
| committer | Rich Kadel <richkadel@google.com> | 2020-06-15 16:50:10 -0700 |
| commit | 5068ae1ca05b2be0c2a98206a58d894aa620b312 (patch) | |
| tree | 258a6eafab4eeab5d40cf776cc09d9799276787d /src/libcore | |
| parent | 395256a5dd74ccef046083d6e025a6d046379040 (diff) | |
| download | rust-5068ae1ca05b2be0c2a98206a58d894aa620b312.tar.gz rust-5068ae1ca05b2be0c2a98206a58d894aa620b312.zip | |
[WIP] injects llvm intrinsic instrprof.increment for coverage reports
This initial version only injects counters at the top of each function. Rust Coverage will require injecting additional counters at each conditional code branch.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/intrinsics.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index 85076a573b5..abb35e838ea 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -1943,6 +1943,15 @@ extern "rust-intrinsic" { pub fn miri_start_panic(payload: *mut u8) -> !; } +#[cfg(not(bootstrap))] +#[cfg_attr(not(bootstrap), lang = "count_code_region")] +pub fn count_code_region(_index: u32) { + #[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump + unsafe { + abort() + } +} + // Some functions are defined here because they accidentally got made // available in this module on stable. See <https://github.com/rust-lang/rust/issues/15702>. // (`transmute` also falls into this category, but it cannot be wrapped due to the |
