summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/instrument_coverage.main.InstrumentCoverage.diff
blob: 14b4833a515b69c56475f91d3a15b6d63d6004a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
- // MIR for `main` before InstrumentCoverage
+ // MIR for `main` after InstrumentCoverage
  
  fn main() -> () {
      let mut _0: ();
      let mut _1: ();
      let mut _2: bool;
      let mut _3: !;
  
+     coverage ExpressionId(0) => Expression { lhs: Counter(0), op: Add, rhs: Counter(1) };
+     coverage ExpressionId(1) => Expression { lhs: Expression(0), op: Subtract, rhs: Counter(1) };
+     coverage Counter(0) => /the/src/instrument_coverage.rs:12:1 - 12:11;
+     coverage Expression(0) => /the/src/instrument_coverage.rs:13:5 - 14:17;
+     coverage Expression(1) => /the/src/instrument_coverage.rs:15:13 - 15:18;
+     coverage Expression(1) => /the/src/instrument_coverage.rs:18:1 - 18:2;
+     coverage Counter(1) => /the/src/instrument_coverage.rs:16:10 - 16:11;
+ 
      bb0: {
+         Coverage::CounterIncrement(0);
          goto -> bb1;
      }
  
      bb1: {
+         Coverage::ExpressionUsed(0);
          falseUnwind -> [real: bb2, unwind: bb6];
      }
  
      bb2: {
          StorageLive(_2);
          _2 = bar() -> [return: bb3, unwind: bb6];
      }
  
      bb3: {
          switchInt(move _2) -> [0: bb5, otherwise: bb4];
      }
  
      bb4: {
+         Coverage::ExpressionUsed(1);
          _0 = const ();
          StorageDead(_2);
          return;
      }
  
      bb5: {
+         Coverage::CounterIncrement(1);
          _1 = const ();
          StorageDead(_2);
          goto -> bb1;
      }
  
      bb6 (cleanup): {
          resume;
      }
  }