1
- // skip-filecheck
2
- // Test that `-C instrument-coverage` injects Coverage statements. The Coverage Counter statements
3
- // are later converted into LLVM instrprof.increment intrinsics, during codegen.
1
+ // Test that `-C instrument-coverage` injects Coverage statements.
2
+ // The Coverage::CounterIncrement statements are later converted into LLVM
3
+ // instrprof.increment intrinsics, during codegen.
4
4
5
5
//@ unit-test: InstrumentCoverage
6
- //@ needs-profiler-support
7
- //@ ignore-windows
8
- //@ compile-flags: -C instrument-coverage --remap-path-prefix={{src-base}}=/the/src
6
+ //@ compile-flags: -Cinstrument-coverage -Zno-profiler-runtime
9
7
10
8
// EMIT_MIR instrument_coverage.main.InstrumentCoverage.diff
11
9
// EMIT_MIR instrument_coverage.bar.InstrumentCoverage.diff
@@ -22,17 +20,9 @@ fn bar() -> bool {
22
20
true
23
21
}
24
22
25
- // Note that the MIR with injected coverage intrinsics includes references to source locations,
26
- // including the source file absolute path. Typically, MIR pretty print output with file
27
- // references are safe because the file prefixes are substituted with `$DIR`, but in this case
28
- // the file references are encoded as function arguments, with an `Operand` type representation
29
- // (`Slice` `Allocation` interned byte array) that cannot be normalized by simple substitution.
30
- //
31
- // The first workaround is to use the `SourceMap`-supported `--remap-path-prefix` option; however,
32
- // the implementation of the `--remap-path-prefix` option currently joins the new prefix and the
33
- // remaining source path with an OS-specific path separator (`\` on Windows). This difference still
34
- // shows up in the byte array representation of the path, causing Windows tests to fail to match
35
- // blessed results baselined with a `/` path separator.
36
- //
37
- // Since this `mir-opt` test does not have any significant platform dependencies, other than the
38
- // path separator differences, the final workaround is to disable testing on Windows.
23
+ // CHECK: coverage ExpressionId({{[0-9]+}}) =>
24
+ // CHECK-DAG: coverage Code(Counter({{[0-9]+}})) =>
25
+ // CHECK-DAG: coverage Code(Expression({{[0-9]+}})) =>
26
+ // CHECK: bb0:
27
+ // CHECK-DAG: Coverage::ExpressionUsed({{[0-9]+}})
28
+ // CHECK-DAG: Coverage::CounterIncrement({{[0-9]+}})
0 commit comments