about summary refs log tree commit diff
path: root/tests/mir-opt/coverage/branch_match_arms.main.InstrumentCoverage.diff
blob: e60f71f47b1ed0ab32784d50d5df4732098113af (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
- // MIR for `main` before InstrumentCoverage
+ // MIR for `main` after InstrumentCoverage
  
  fn main() -> () {
      let mut _0: ();
      let mut _1: Enum;
      let mut _2: isize;
      let _3: u32;
      let mut _4: u32;
      let _5: u32;
      let mut _6: u32;
      let _7: u32;
      let mut _8: u32;
      let _9: u32;
      let mut _10: u32;
      scope 1 {
          debug d => _3;
      }
      scope 2 {
          debug c => _5;
      }
      scope 3 {
          debug b => _7;
      }
      scope 4 {
          debug a => _9;
      }
  
+     coverage ExpressionId(0) => Expression { lhs: Counter(1), op: Add, rhs: Counter(2) };
+     coverage ExpressionId(1) => Expression { lhs: Expression(0), op: Add, rhs: Counter(3) };
+     coverage ExpressionId(2) => Expression { lhs: Counter(0), op: Subtract, rhs: Expression(1) };
+     coverage ExpressionId(3) => Expression { lhs: Counter(3), op: Add, rhs: Counter(2) };
+     coverage ExpressionId(4) => Expression { lhs: Expression(3), op: Add, rhs: Counter(1) };
+     coverage ExpressionId(5) => Expression { lhs: Expression(4), op: Add, rhs: Expression(2) };
+     coverage Code(Counter(0)) => $DIR/branch_match_arms.rs:14:1 - 15:21;
+     coverage Code(Counter(3)) => $DIR/branch_match_arms.rs:16:17 - 16:33;
+     coverage Code(Counter(2)) => $DIR/branch_match_arms.rs:17:17 - 17:33;
+     coverage Code(Counter(1)) => $DIR/branch_match_arms.rs:18:17 - 18:33;
+     coverage Code(Expression(2)) => $DIR/branch_match_arms.rs:19:17 - 19:33;
+     coverage Code(Expression(5)) => $DIR/branch_match_arms.rs:21:1 - 21:2;
+ 
      bb0: {
+         Coverage::CounterIncrement(0);
          StorageLive(_1);
          _1 = Enum::A(const 0_u32);
          PlaceMention(_1);
          _2 = discriminant(_1);
          switchInt(move _2) -> [0: bb5, 1: bb4, 2: bb3, 3: bb2, otherwise: bb1];
      }
  
      bb1: {
          FakeRead(ForMatchedPlace(None), _1);
          unreachable;
      }
  
      bb2: {
+         Coverage::CounterIncrement(3);
          falseEdge -> [real: bb6, imaginary: bb3];
      }
  
      bb3: {
+         Coverage::CounterIncrement(2);
          falseEdge -> [real: bb8, imaginary: bb4];
      }
  
      bb4: {
+         Coverage::CounterIncrement(1);
          falseEdge -> [real: bb10, imaginary: bb5];
      }
  
      bb5: {
+         Coverage::ExpressionUsed(2);
          StorageLive(_9);
          _9 = ((_1 as A).0: u32);
          StorageLive(_10);
          _10 = _9;
          _0 = consume(move _10) -> [return: bb12, unwind: bb14];
      }
  
      bb6: {
          StorageLive(_3);
          _3 = ((_1 as D).0: u32);
          StorageLive(_4);
          _4 = _3;
          _0 = consume(move _4) -> [return: bb7, unwind: bb14];
      }
  
      bb7: {
          StorageDead(_4);
          StorageDead(_3);
          goto -> bb13;
      }
  
      bb8: {
          StorageLive(_5);
          _5 = ((_1 as C).0: u32);
          StorageLive(_6);
          _6 = _5;
          _0 = consume(move _6) -> [return: bb9, unwind: bb14];
      }
  
      bb9: {
          StorageDead(_6);
          StorageDead(_5);
          goto -> bb13;
      }
  
      bb10: {
          StorageLive(_7);
          _7 = ((_1 as B).0: u32);
          StorageLive(_8);
          _8 = _7;
          _0 = consume(move _8) -> [return: bb11, unwind: bb14];
      }
  
      bb11: {
          StorageDead(_8);
          StorageDead(_7);
          goto -> bb13;
      }
  
      bb12: {
          StorageDead(_10);
          StorageDead(_9);
          goto -> bb13;
      }
  
      bb13: {
+         Coverage::ExpressionUsed(5);
          StorageDead(_1);
          return;
      }
  
      bb14 (cleanup): {
          resume;
      }
  }