about summary refs log tree commit diff
path: root/src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
diff options
context:
space:
mode:
authorRich Kadel <richkadel@google.com>2020-07-02 11:27:15 -0700
committerRich Kadel <richkadel@google.com>2020-07-17 11:49:35 -0700
commita6f8b8a2116f0ea7e31d572d3120508678ed8079 (patch)
treeea4c018d3684b3990d2d01bc02efa923360c7129 /src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs
parentc2dbebd3d4ad21e80ef4e7535dd1e868aaad7e50 (diff)
downloadrust-a6f8b8a2116f0ea7e31d572d3120508678ed8079.tar.gz
rust-a6f8b8a2116f0ea7e31d572d3120508678ed8079.zip
Generating the coverage map
rustc now generates the coverage map and can support (limited)
coverage report generation, at the function level.

Example:

$ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu
$ $BUILD/stage1/bin/rustc -Zinstrument-coverage \
$HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs
$ LLVM_PROFILE_FILE="main.profraw" ./main
called
$ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata
$ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main
    1|      1|pub fn will_be_called() {
    2|      1|    println!("called");
    3|      1|}
    4|       |
    5|      0|pub fn will_not_be_called() {
    6|      0|    println!("should not have been called");
    7|      0|}
    8|       |
    9|      1|fn main() {
   10|      1|    let less = 1;
   11|      1|    let more = 100;
   12|      1|
   13|      1|    if less < more {
   14|      1|        will_be_called();
   15|      1|    } else {
   16|      1|        will_not_be_called();
   17|      1|    }
   18|      1|}
Diffstat (limited to 'src/test/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions