about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/coverage/mcdc_nested_if.cov-map201
-rw-r--r--tests/coverage/mcdc_nested_if.coverage235
-rw-r--r--tests/coverage/mcdc_nested_if.rs70
-rw-r--r--tests/crashes/123710.rs17
-rw-r--r--tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-abort.diff112
-rw-r--r--tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-unwind.diff112
-rw-r--r--tests/mir-opt/const_prop/offset_of.generic.GVN.panic-abort.diff99
-rw-r--r--tests/mir-opt/const_prop/offset_of.generic.GVN.panic-unwind.diff99
-rw-r--r--tests/mir-opt/dataflow-const-prop/offset_of.concrete.DataflowConstProp.panic-abort.diff64
-rw-r--r--tests/mir-opt/dataflow-const-prop/offset_of.concrete.DataflowConstProp.panic-unwind.diff64
-rw-r--r--tests/mir-opt/dataflow-const-prop/offset_of.generic.DataflowConstProp.panic-abort.diff58
-rw-r--r--tests/mir-opt/dataflow-const-prop/offset_of.generic.DataflowConstProp.panic-unwind.diff58
-rw-r--r--tests/mir-opt/dataflow-const-prop/offset_of.rs16
-rw-r--r--tests/pretty/postfix-match/precedence.pp34
-rw-r--r--tests/pretty/postfix-match/precedence.rs34
-rw-r--r--tests/pretty/postfix-match/simple-matches.rs (renamed from tests/pretty/postfix-match.rs)0
-rw-r--r--tests/ui/attributes/unix_sigpipe/unix_sigpipe-inherit.rs2
-rw-r--r--tests/ui/lint/ice-const-prop-unions-known-panics-lint-123710.rs22
-rw-r--r--tests/ui/lint/ice-const-prop-unions-known-panics-lint-123710.stderr29
-rw-r--r--tests/ui/offset-of/offset-of-dst-field.stderr28
-rw-r--r--tests/ui/offset-of/offset-of-must-use.rs2
-rw-r--r--tests/ui/offset-of/offset-of-must-use.stderr4
-rw-r--r--tests/ui/offset-of/offset-of-temporaries.rs23
23 files changed, 838 insertions, 545 deletions
diff --git a/tests/coverage/mcdc_nested_if.cov-map b/tests/coverage/mcdc_nested_if.cov-map
new file mode 100644
index 00000000000..2f35ffad8a9
--- /dev/null
+++ b/tests/coverage/mcdc_nested_if.cov-map
@@ -0,0 +1,201 @@
+Function name: mcdc_nested_if::doubly_nested_if_in_condition
+Raw bytes (168): 0x[01, 01, 0e, 01, 05, 05, 11, 05, 11, 26, 19, 05, 11, 19, 1d, 19, 1d, 1d, 22, 26, 19, 05, 11, 11, 15, 09, 02, 0d, 37, 09, 02, 14, 01, 0f, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4e, 05, 00, 10, 00, 11, 28, 01, 02, 00, 10, 00, 36, 30, 11, 26, 01, 00, 02, 00, 10, 00, 11, 30, 15, 21, 02, 00, 00, 00, 15, 00, 36, 26, 00, 18, 00, 19, 28, 00, 02, 00, 18, 00, 1e, 30, 19, 22, 01, 02, 00, 00, 18, 00, 19, 19, 00, 1d, 00, 1e, 30, 1a, 1d, 02, 00, 00, 00, 1d, 00, 1e, 1a, 00, 21, 00, 25, 1f, 00, 2f, 00, 34, 2b, 00, 39, 00, 3e, 21, 00, 48, 00, 4c, 0d, 00, 4f, 02, 06, 37, 02, 0c, 02, 06, 33, 03, 01, 00, 02]
+Number of files: 1
+- file 0 => global file 1
+Number of expressions: 14
+- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
+- expression 1 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 2 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 3 operands: lhs = Expression(9, Sub), rhs = Counter(6)
+- expression 4 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 5 operands: lhs = Counter(6), rhs = Counter(7)
+- expression 6 operands: lhs = Counter(6), rhs = Counter(7)
+- expression 7 operands: lhs = Counter(7), rhs = Expression(8, Sub)
+- expression 8 operands: lhs = Expression(9, Sub), rhs = Counter(6)
+- expression 9 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 10 operands: lhs = Counter(4), rhs = Counter(5)
+- expression 11 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+- expression 12 operands: lhs = Counter(3), rhs = Expression(13, Add)
+- expression 13 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+Number of file 0 mappings: 20
+- Code(Counter(0)) at (prev + 15, 1) to (start + 1, 9)
+- MCDCDecision { bitmap_idx: 2, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 78)
+- MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+    true  = c1
+    false = (c0 - c1)
+- MCDCBranch { true: Counter(3), false: Counter(2), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 13) to (start + 0, 78)
+    true  = c3
+    false = c2
+- Code(Counter(1)) at (prev + 0, 16) to (start + 0, 17)
+- MCDCDecision { bitmap_idx: 1, conditions_num: 2 } at (prev + 0, 16) to (start + 0, 54)
+- MCDCBranch { true: Counter(4), false: Expression(9, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 16) to (start + 0, 17)
+    true  = c4
+    false = (c1 - c4)
+- MCDCBranch { true: Counter(5), false: Counter(8), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 21) to (start + 0, 54)
+    true  = c5
+    false = c8
+- Code(Expression(9, Sub)) at (prev + 0, 24) to (start + 0, 25)
+    = (c1 - c4)
+- MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 0, 24) to (start + 0, 30)
+- MCDCBranch { true: Counter(6), false: Expression(8, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 24) to (start + 0, 25)
+    true  = c6
+    false = ((c1 - c4) - c6)
+- Code(Counter(6)) at (prev + 0, 29) to (start + 0, 30)
+- MCDCBranch { true: Expression(6, Sub), false: Counter(7), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 29) to (start + 0, 30)
+    true  = (c6 - c7)
+    false = c7
+- Code(Expression(6, Sub)) at (prev + 0, 33) to (start + 0, 37)
+    = (c6 - c7)
+- Code(Expression(7, Add)) at (prev + 0, 47) to (start + 0, 52)
+    = (c7 + ((c1 - c4) - c6))
+- Code(Expression(10, Add)) at (prev + 0, 57) to (start + 0, 62)
+    = (c4 + c5)
+- Code(Counter(8)) at (prev + 0, 72) to (start + 0, 76)
+- Code(Counter(3)) at (prev + 0, 79) to (start + 2, 6)
+- Code(Expression(13, Add)) at (prev + 2, 12) to (start + 2, 6)
+    = (c2 + (c0 - c1))
+- Code(Expression(12, Add)) at (prev + 3, 1) to (start + 0, 2)
+    = (c3 + (c2 + (c0 - c1)))
+
+Function name: mcdc_nested_if::nested_if_in_condition
+Raw bytes (120): 0x[01, 01, 0b, 01, 05, 05, 11, 05, 11, 1e, 15, 05, 11, 11, 15, 1e, 15, 05, 11, 09, 02, 0d, 2b, 09, 02, 0e, 01, 07, 01, 01, 09, 28, 01, 02, 01, 08, 00, 2e, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 2e, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 1e, 01, 00, 02, 00, 10, 00, 11, 1e, 00, 15, 00, 16, 30, 15, 1a, 02, 00, 00, 00, 15, 00, 16, 17, 00, 19, 00, 1d, 1a, 00, 27, 00, 2c, 0d, 00, 2f, 02, 06, 2b, 02, 0c, 02, 06, 27, 03, 01, 00, 02]
+Number of files: 1
+- file 0 => global file 1
+Number of expressions: 11
+- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
+- expression 1 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 2 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 3 operands: lhs = Expression(7, Sub), rhs = Counter(5)
+- expression 4 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 5 operands: lhs = Counter(4), rhs = Counter(5)
+- expression 6 operands: lhs = Expression(7, Sub), rhs = Counter(5)
+- expression 7 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 8 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+- expression 9 operands: lhs = Counter(3), rhs = Expression(10, Add)
+- expression 10 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+Number of file 0 mappings: 14
+- Code(Counter(0)) at (prev + 7, 1) to (start + 1, 9)
+- MCDCDecision { bitmap_idx: 1, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 46)
+- MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+    true  = c1
+    false = (c0 - c1)
+- MCDCBranch { true: Counter(3), false: Counter(2), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 13) to (start + 0, 46)
+    true  = c3
+    false = c2
+- Code(Counter(1)) at (prev + 0, 16) to (start + 0, 17)
+- MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 0, 16) to (start + 0, 22)
+- MCDCBranch { true: Counter(4), false: Expression(7, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 16) to (start + 0, 17)
+    true  = c4
+    false = (c1 - c4)
+- Code(Expression(7, Sub)) at (prev + 0, 21) to (start + 0, 22)
+    = (c1 - c4)
+- MCDCBranch { true: Counter(5), false: Expression(6, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 21) to (start + 0, 22)
+    true  = c5
+    false = ((c1 - c4) - c5)
+- Code(Expression(5, Add)) at (prev + 0, 25) to (start + 0, 29)
+    = (c4 + c5)
+- Code(Expression(6, Sub)) at (prev + 0, 39) to (start + 0, 44)
+    = ((c1 - c4) - c5)
+- Code(Counter(3)) at (prev + 0, 47) to (start + 2, 6)
+- Code(Expression(10, Add)) at (prev + 2, 12) to (start + 2, 6)
+    = (c2 + (c0 - c1))
+- Code(Expression(9, Add)) at (prev + 3, 1) to (start + 0, 2)
+    = (c3 + (c2 + (c0 - c1)))
+
+Function name: mcdc_nested_if::nested_in_then_block_in_condition
+Raw bytes (176): 0x[01, 01, 12, 01, 05, 05, 11, 05, 11, 3a, 15, 05, 11, 11, 15, 33, 19, 11, 15, 19, 1d, 19, 1d, 1d, 2e, 33, 19, 11, 15, 3a, 15, 05, 11, 09, 02, 0d, 47, 09, 02, 14, 01, 22, 01, 01, 09, 28, 02, 02, 01, 08, 00, 4b, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 4b, 05, 00, 10, 00, 11, 28, 00, 02, 00, 10, 00, 16, 30, 11, 3a, 01, 00, 02, 00, 10, 00, 11, 3a, 00, 15, 00, 16, 30, 15, 36, 02, 00, 00, 00, 15, 00, 16, 33, 00, 1c, 00, 1d, 28, 01, 02, 00, 1c, 00, 22, 30, 19, 2e, 01, 02, 00, 00, 1c, 00, 1d, 19, 00, 21, 00, 22, 30, 26, 1d, 02, 00, 00, 00, 21, 00, 22, 26, 00, 25, 00, 29, 2b, 00, 33, 00, 38, 36, 00, 44, 00, 49, 0d, 00, 4c, 02, 06, 47, 02, 0c, 02, 06, 43, 03, 01, 00, 02]
+Number of files: 1
+- file 0 => global file 1
+Number of expressions: 18
+- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
+- expression 1 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 2 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 3 operands: lhs = Expression(14, Sub), rhs = Counter(5)
+- expression 4 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 5 operands: lhs = Counter(4), rhs = Counter(5)
+- expression 6 operands: lhs = Expression(12, Add), rhs = Counter(6)
+- expression 7 operands: lhs = Counter(4), rhs = Counter(5)
+- expression 8 operands: lhs = Counter(6), rhs = Counter(7)
+- expression 9 operands: lhs = Counter(6), rhs = Counter(7)
+- expression 10 operands: lhs = Counter(7), rhs = Expression(11, Sub)
+- expression 11 operands: lhs = Expression(12, Add), rhs = Counter(6)
+- expression 12 operands: lhs = Counter(4), rhs = Counter(5)
+- expression 13 operands: lhs = Expression(14, Sub), rhs = Counter(5)
+- expression 14 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 15 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+- expression 16 operands: lhs = Counter(3), rhs = Expression(17, Add)
+- expression 17 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+Number of file 0 mappings: 20
+- Code(Counter(0)) at (prev + 34, 1) to (start + 1, 9)
+- MCDCDecision { bitmap_idx: 2, conditions_num: 2 } at (prev + 1, 8) to (start + 0, 75)
+- MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+    true  = c1
+    false = (c0 - c1)
+- MCDCBranch { true: Counter(3), false: Counter(2), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 13) to (start + 0, 75)
+    true  = c3
+    false = c2
+- Code(Counter(1)) at (prev + 0, 16) to (start + 0, 17)
+- MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 0, 16) to (start + 0, 22)
+- MCDCBranch { true: Counter(4), false: Expression(14, Sub), condition_id: 1, true_next_id: 0, false_next_id: 2 } at (prev + 0, 16) to (start + 0, 17)
+    true  = c4
+    false = (c1 - c4)
+- Code(Expression(14, Sub)) at (prev + 0, 21) to (start + 0, 22)
+    = (c1 - c4)
+- MCDCBranch { true: Counter(5), false: Expression(13, Sub), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 21) to (start + 0, 22)
+    true  = c5
+    false = ((c1 - c4) - c5)
+- Code(Expression(12, Add)) at (prev + 0, 28) to (start + 0, 29)
+    = (c4 + c5)
+- MCDCDecision { bitmap_idx: 1, conditions_num: 2 } at (prev + 0, 28) to (start + 0, 34)
+- MCDCBranch { true: Counter(6), false: Expression(11, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 28) to (start + 0, 29)
+    true  = c6
+    false = ((c4 + c5) - c6)
+- Code(Counter(6)) at (prev + 0, 33) to (start + 0, 34)
+- MCDCBranch { true: Expression(9, Sub), false: Counter(7), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 33) to (start + 0, 34)
+    true  = (c6 - c7)
+    false = c7
+- Code(Expression(9, Sub)) at (prev + 0, 37) to (start + 0, 41)
+    = (c6 - c7)
+- Code(Expression(10, Add)) at (prev + 0, 51) to (start + 0, 56)
+    = (c7 + ((c4 + c5) - c6))
+- Code(Expression(13, Sub)) at (prev + 0, 68) to (start + 0, 73)
+    = ((c1 - c4) - c5)
+- Code(Counter(3)) at (prev + 0, 76) to (start + 2, 6)
+- Code(Expression(17, Add)) at (prev + 2, 12) to (start + 2, 6)
+    = (c2 + (c0 - c1))
+- Code(Expression(16, Add)) at (prev + 3, 1) to (start + 0, 2)
+    = (c3 + (c2 + (c0 - c1)))
+
+Function name: mcdc_nested_if::nested_single_condition_decision
+Raw bytes (85): 0x[01, 01, 06, 01, 05, 05, 11, 05, 11, 09, 02, 0d, 17, 09, 02, 0b, 01, 17, 01, 04, 09, 28, 00, 02, 04, 08, 00, 29, 30, 05, 02, 01, 02, 00, 00, 08, 00, 09, 30, 0d, 09, 02, 00, 00, 00, 0d, 00, 29, 05, 00, 10, 00, 11, 20, 11, 0a, 00, 10, 00, 11, 11, 00, 14, 00, 19, 0a, 00, 23, 00, 27, 0d, 00, 2a, 02, 06, 17, 02, 0c, 02, 06, 13, 03, 01, 00, 02]
+Number of files: 1
+- file 0 => global file 1
+Number of expressions: 6
+- expression 0 operands: lhs = Counter(0), rhs = Counter(1)
+- expression 1 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 2 operands: lhs = Counter(1), rhs = Counter(4)
+- expression 3 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+- expression 4 operands: lhs = Counter(3), rhs = Expression(5, Add)
+- expression 5 operands: lhs = Counter(2), rhs = Expression(0, Sub)
+Number of file 0 mappings: 11
+- Code(Counter(0)) at (prev + 23, 1) to (start + 4, 9)
+- MCDCDecision { bitmap_idx: 0, conditions_num: 2 } at (prev + 4, 8) to (start + 0, 41)
+- MCDCBranch { true: Counter(1), false: Expression(0, Sub), condition_id: 1, true_next_id: 2, false_next_id: 0 } at (prev + 0, 8) to (start + 0, 9)
+    true  = c1
+    false = (c0 - c1)
+- MCDCBranch { true: Counter(3), false: Counter(2), condition_id: 2, true_next_id: 0, false_next_id: 0 } at (prev + 0, 13) to (start + 0, 41)
+    true  = c3
+    false = c2
+- Code(Counter(1)) at (prev + 0, 16) to (start + 0, 17)
+- Branch { true: Counter(4), false: Expression(2, Sub) } at (prev + 0, 16) to (start + 0, 17)
+    true  = c4
+    false = (c1 - c4)
+- Code(Counter(4)) at (prev + 0, 20) to (start + 0, 25)
+- Code(Expression(2, Sub)) at (prev + 0, 35) to (start + 0, 39)
+    = (c1 - c4)
+- Code(Counter(3)) at (prev + 0, 42) to (start + 2, 6)
+- Code(Expression(5, Add)) at (prev + 2, 12) to (start + 2, 6)
+    = (c2 + (c0 - c1))
+- Code(Expression(4, Add)) at (prev + 3, 1) to (start + 0, 2)
+    = (c3 + (c2 + (c0 - c1)))
+
diff --git a/tests/coverage/mcdc_nested_if.coverage b/tests/coverage/mcdc_nested_if.coverage
new file mode 100644
index 00000000000..19529cd6aa4
--- /dev/null
+++ b/tests/coverage/mcdc_nested_if.coverage
@@ -0,0 +1,235 @@
+   LL|       |#![feature(coverage_attribute)]
+   LL|       |//@ edition: 2021
+   LL|       |//@ min-llvm-version: 18
+   LL|       |//@ compile-flags: -Zcoverage-options=mcdc
+   LL|       |//@ llvm-cov-flags: --show-mcdc
+   LL|       |
+   LL|      4|fn nested_if_in_condition(a: bool, b: bool, c: bool) {
+   LL|      4|    if a && if b || c { true } else { false } {
+                             ^3   ^2  ^2            ^1
+  ------------------
+  |---> MC/DC Decision Region (LL:8) to (LL:46)
+  |
+  |  Number of Conditions: 2
+  |     Condition C1 --> (LL:8)
+  |     Condition C2 --> (LL:13)
+  |
+  |  Executed MC/DC Test Vectors:
+  |
+  |     C1, C2    Result
+  |  1 { F,  -  = F      }
+  |  2 { T,  F  = F      }
+  |  3 { T,  T  = T      }
+  |
+  |  C1-Pair: covered: (1,3)
+  |  C2-Pair: covered: (2,3)
+  |  MC/DC Coverage for Decision: 100.00%
+  |
+  |---> MC/DC Decision Region (LL:16) to (LL:22)
+  |
+  |  Number of Conditions: 2
+  |     Condition C1 --> (LL:16)
+  |     Condition C2 --> (LL:21)
+  |
+  |  Executed MC/DC Test Vectors:
+  |
+  |     C1, C2    Result
+  |  1 { F,  F  = F      }
+  |  2 { T,  -  = T      }
+  |  3 { F,  T  = T      }
+  |
+  |  C1-Pair: covered: (1,2)
+  |  C2-Pair: covered: (1,3)
+  |  MC/DC Coverage for Decision: 100.00%
+  |
+  ------------------
+   LL|      2|        say("yes");
+   LL|      2|    } else {
+   LL|      2|        say("no");
+   LL|      2|    }
+   LL|      4|}
+   LL|       |
+   LL|      4|fn doubly_nested_if_in_condition(a: bool, b: bool, c: bool, d: bool) {
+   LL|      4|    if a && if b || if c && d { true } else { false } { false } else { true } {
+                             ^3      ^2   ^1  ^1            ^1        ^2             ^1
+  ------------------
+  |---> MC/DC Decision Region (LL:8) to (LL:78)
+  |
+  |  Number of Conditions: 2
+  |     Condition C1 --> (LL:8)
+  |     Condition C2 --> (LL:13)
+  |
+  |  Executed MC/DC Test Vectors:
+  |
+  |     C1, C2    Result
+  |  1 { F,  -  = F      }
+  |  2 { T,  F  = F      }
+  |  3 { T,  T  = T      }
+  |
+  |  C1-Pair: covered: (1,3)
+  |  C2-Pair: covered: (2,3)
+  |  MC/DC Coverage for Decision: 100.00%
+  |
+  |---> MC/DC Decision Region (LL:16) to (LL:54)
+  |
+  |  Number of Conditions: 2
+  |     Condition C1 --> (LL:16)
+  |     Condition C2 --> (LL:21)
+  |
+  |  Executed MC/DC Test Vectors:
+  |
+  |     C1, C2    Result
+  |  1 { F,  F  = F      }
+  |  2 { T,  -  = T      }
+  |  3 { F,  T  = T      }
+  |
+  |  C1-Pair: covered: (1,2)
+  |  C2-Pair: covered: (1,3)
+  |  MC/DC Coverage for Decision: 100.00%
+  |
+  |---> MC/DC Decision Region (LL:24) to (LL:30)
+  |
+  |  Number of Conditions: 2
+  |     Condition C1 --> (LL:24)
+  |     Condition C2 --> (LL:29)
+  |
+  |  Executed MC/DC Test Vectors:
+  |
+  |     C1, C2    Result
+  |  1 { F,  -  = F      }
+  |  2 { T,  T  = T      }
+  |
+  |  C1-Pair: covered: (1,2)
+  |  C2-Pair: not covered
+  |  MC/DC Coverage for Decision: 50.00%
+  |
+  ------------------
+   LL|      1|        say("yes");
+   LL|      3|    } else {
+   LL|      3|        say("no");
+   LL|      3|    }
+   LL|      4|}
+   LL|       |
+   LL|      3|fn nested_single_condition_decision(a: bool, b: bool) {
+   LL|      3|    // Decision with only 1 decision should not be instrumented by MCDC because
+   LL|      3|    // branch-coverage is equivalent to MCDC coverage in this case, and we don't
+   LL|      3|    // want to waste bitmap space for this.
+   LL|      3|    if a && if b { false } else { true } {
+                             ^2  ^1             ^1
+  ------------------
+  |---> MC/DC Decision Region (LL:8) to (LL:41)
+  |
+  |  Number of Conditions: 2
+  |     Condition C1 --> (LL:8)
+  |     Condition C2 --> (LL:13)
+  |
+  |  Executed MC/DC Test Vectors:
+  |
+  |     C1, C2    Result
+  |  1 { F,  -  = F      }
+  |  2 { T,  F  = F      }
+  |  3 { T,  T  = T      }
+  |
+  |  C1-Pair: covered: (1,3)
+  |  C2-Pair: covered: (2,3)
+  |  MC/DC Coverage for Decision: 100.00%
+  |
+  ------------------
+   LL|      1|        say("yes");
+   LL|      2|    } else {
+   LL|      2|        say("no");
+   LL|      2|    }
+   LL|      3|}
+   LL|       |
+   LL|      7|fn nested_in_then_block_in_condition(a: bool, b: bool, c: bool, d: bool, e: bool) {
+   LL|      7|    if a && if b || c { if d && e { true } else { false } } else { false } {
+                             ^6   ^5     ^5   ^2  ^1            ^4               ^1
+  ------------------
+  |---> MC/DC Decision Region (LL:8) to (LL:75)
+  |
+  |  Number of Conditions: 2
+  |     Condition C1 --> (LL:8)
+  |     Condition C2 --> (LL:13)
+  |
+  |  Executed MC/DC Test Vectors:
+  |
+  |     C1, C2    Result
+  |  1 { F,  -  = F      }
+  |  2 { T,  F  = F      }
+  |  3 { T,  T  = T      }
+  |
+  |  C1-Pair: covered: (1,3)
+  |  C2-Pair: covered: (2,3)
+  |  MC/DC Coverage for Decision: 100.00%
+  |
+  |---> MC/DC Decision Region (LL:16) to (LL:22)
+  |
+  |  Number of Conditions: 2
+  |     Condition C1 --> (LL:16)
+  |     Condition C2 --> (LL:21)
+  |
+  |  Executed MC/DC Test Vectors:
+  |
+  |     C1, C2    Result
+  |  1 { F,  F  = F      }
+  |  2 { T,  -  = T      }
+  |  3 { F,  T  = T      }
+  |
+  |  C1-Pair: covered: (1,2)
+  |  C2-Pair: covered: (1,3)
+  |  MC/DC Coverage for Decision: 100.00%
+  |
+  |---> MC/DC Decision Region (LL:28) to (LL:34)
+  |
+  |  Number of Conditions: 2
+  |     Condition C1 --> (LL:28)
+  |     Condition C2 --> (LL:33)
+  |
+  |  Executed MC/DC Test Vectors:
+  |
+  |     C1, C2    Result
+  |  1 { F,  -  = F      }
+  |  2 { T,  F  = F      }
+  |  3 { T,  T  = T      }
+  |
+  |  C1-Pair: covered: (1,3)
+  |  C2-Pair: covered: (2,3)
+  |  MC/DC Coverage for Decision: 100.00%
+  |
+  ------------------
+   LL|      1|        say("yes");
+   LL|      6|    } else {
+   LL|      6|        say("no");
+   LL|      6|    }
+   LL|      7|}
+   LL|       |
+   LL|       |#[coverage(off)]
+   LL|       |fn main() {
+   LL|       |    nested_if_in_condition(true, false, false);
+   LL|       |    nested_if_in_condition(true, true, true);
+   LL|       |    nested_if_in_condition(true, false, true);
+   LL|       |    nested_if_in_condition(false, true, true);
+   LL|       |
+   LL|       |    doubly_nested_if_in_condition(true, false, false, true);
+   LL|       |    doubly_nested_if_in_condition(true, true, true, true);
+   LL|       |    doubly_nested_if_in_condition(true, false, true, true);
+   LL|       |    doubly_nested_if_in_condition(false, true, true, true);
+   LL|       |
+   LL|       |    nested_single_condition_decision(true, true);
+   LL|       |    nested_single_condition_decision(true, false);
+   LL|       |    nested_single_condition_decision(false, false);
+   LL|       |
+   LL|       |    nested_in_then_block_in_condition(false, false, false, false, false);
+   LL|       |    nested_in_then_block_in_condition(true, false, false, false, false);
+   LL|       |    nested_in_then_block_in_condition(true, true, false, false, false);
+   LL|       |    nested_in_then_block_in_condition(true, false, true, false, false);
+   LL|       |    nested_in_then_block_in_condition(true, false, true, true, false);
+   LL|       |    nested_in_then_block_in_condition(true, false, true, false, true);
+   LL|       |    nested_in_then_block_in_condition(true, false, true, true, true);
+   LL|       |}
+   LL|       |
+   LL|       |#[coverage(off)]
+   LL|       |fn say(message: &str) {
+   LL|       |    core::hint::black_box(message);
+   LL|       |}
+
diff --git a/tests/coverage/mcdc_nested_if.rs b/tests/coverage/mcdc_nested_if.rs
new file mode 100644
index 00000000000..3d869771f75
--- /dev/null
+++ b/tests/coverage/mcdc_nested_if.rs
@@ -0,0 +1,70 @@
+#![feature(coverage_attribute)]
+//@ edition: 2021
+//@ min-llvm-version: 18
+//@ compile-flags: -Zcoverage-options=mcdc
+//@ llvm-cov-flags: --show-mcdc
+
+fn nested_if_in_condition(a: bool, b: bool, c: bool) {
+    if a && if b || c { true } else { false } {
+        say("yes");
+    } else {
+        say("no");
+    }
+}
+
+fn doubly_nested_if_in_condition(a: bool, b: bool, c: bool, d: bool) {
+    if a && if b || if c && d { true } else { false } { false } else { true } {
+        say("yes");
+    } else {
+        say("no");
+    }
+}
+
+fn nested_single_condition_decision(a: bool, b: bool) {
+    // Decision with only 1 decision should not be instrumented by MCDC because
+    // branch-coverage is equivalent to MCDC coverage in this case, and we don't
+    // want to waste bitmap space for this.
+    if a && if b { false } else { true } {
+        say("yes");
+    } else {
+        say("no");
+    }
+}
+
+fn nested_in_then_block_in_condition(a: bool, b: bool, c: bool, d: bool, e: bool) {
+    if a && if b || c { if d && e { true } else { false } } else { false } {
+        say("yes");
+    } else {
+        say("no");
+    }
+}
+
+#[coverage(off)]
+fn main() {
+    nested_if_in_condition(true, false, false);
+    nested_if_in_condition(true, true, true);
+    nested_if_in_condition(true, false, true);
+    nested_if_in_condition(false, true, true);
+
+    doubly_nested_if_in_condition(true, false, false, true);
+    doubly_nested_if_in_condition(true, true, true, true);
+    doubly_nested_if_in_condition(true, false, true, true);
+    doubly_nested_if_in_condition(false, true, true, true);
+
+    nested_single_condition_decision(true, true);
+    nested_single_condition_decision(true, false);
+    nested_single_condition_decision(false, false);
+
+    nested_in_then_block_in_condition(false, false, false, false, false);
+    nested_in_then_block_in_condition(true, false, false, false, false);
+    nested_in_then_block_in_condition(true, true, false, false, false);
+    nested_in_then_block_in_condition(true, false, true, false, false);
+    nested_in_then_block_in_condition(true, false, true, true, false);
+    nested_in_then_block_in_condition(true, false, true, false, true);
+    nested_in_then_block_in_condition(true, false, true, true, true);
+}
+
+#[coverage(off)]
+fn say(message: &str) {
+    core::hint::black_box(message);
+}
diff --git a/tests/crashes/123710.rs b/tests/crashes/123710.rs
deleted file mode 100644
index f171fa7cebb..00000000000
--- a/tests/crashes/123710.rs
+++ /dev/null
@@ -1,17 +0,0 @@
-//@ known-bug: #123710
-
-#[repr(packed)]
-#[repr(u32)]
-enum E {
-    A,
-    B,
-    C,
-}
-
-fn main() {
-    union InvalidTag {
-        int: u32,
-        e: E,
-    }
-    let _invalid_tag = InvalidTag { int: 4 };
-}
diff --git a/tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-abort.diff b/tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-abort.diff
index 5d94797905d..77a2c5bcccc 100644
--- a/tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-abort.diff
+++ b/tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-abort.diff
@@ -4,33 +4,26 @@
   fn concrete() -> () {
       let mut _0: ();
       let _1: usize;
-      let mut _2: usize;
-      let mut _4: usize;
-      let mut _6: usize;
-      let mut _8: usize;
-      let mut _10: usize;
-      let mut _12: usize;
-      let mut _14: usize;
       scope 1 {
           debug x => _1;
-          let _3: usize;
+          let _2: usize;
           scope 2 {
-              debug y => _3;
-              let _5: usize;
+              debug y => _2;
+              let _3: usize;
               scope 3 {
-                  debug z0 => _5;
-                  let _7: usize;
+                  debug z0 => _3;
+                  let _4: usize;
                   scope 4 {
-                      debug z1 => _7;
-                      let _9: usize;
+                      debug z1 => _4;
+                      let _5: usize;
                       scope 5 {
-                          debug eA0 => _9;
-                          let _11: usize;
+                          debug eA0 => _5;
+                          let _6: usize;
                           scope 6 {
-                              debug eA1 => _11;
-                              let _13: usize;
+                              debug eA1 => _6;
+                              let _7: usize;
                               scope 7 {
-                                  debug eC => _13;
+                                  debug eC => _7;
                               }
                           }
                       }
@@ -41,82 +34,33 @@
   
       bb0: {
           StorageLive(_1);
+-         _1 = OffsetOf(Alpha, [(0, 0)]);
++         _1 = const 4_usize;
           StorageLive(_2);
--         _2 = OffsetOf(Alpha, [(0, 0)]);
--         _1 = must_use::<usize>(move _2) -> [return: bb1, unwind unreachable];
-+         _2 = const 4_usize;
-+         _1 = must_use::<usize>(const 4_usize) -> [return: bb1, unwind unreachable];
-      }
-  
-      bb1: {
-          StorageDead(_2);
+-         _2 = OffsetOf(Alpha, [(0, 1)]);
++         _2 = const 0_usize;
           StorageLive(_3);
+-         _3 = OffsetOf(Alpha, [(0, 2), (0, 0)]);
++         _3 = const 2_usize;
           StorageLive(_4);
--         _4 = OffsetOf(Alpha, [(0, 1)]);
--         _3 = must_use::<usize>(move _4) -> [return: bb2, unwind unreachable];
-+         _4 = const 0_usize;
-+         _3 = must_use::<usize>(const 0_usize) -> [return: bb2, unwind unreachable];
-      }
-  
-      bb2: {
-          StorageDead(_4);
+-         _4 = OffsetOf(Alpha, [(0, 2), (0, 1)]);
++         _4 = const 3_usize;
           StorageLive(_5);
+-         _5 = OffsetOf(Epsilon, [(0, 0)]);
++         _5 = const 1_usize;
           StorageLive(_6);
--         _6 = OffsetOf(Alpha, [(0, 2), (0, 0)]);
--         _5 = must_use::<usize>(move _6) -> [return: bb3, unwind unreachable];
+-         _6 = OffsetOf(Epsilon, [(0, 1)]);
 +         _6 = const 2_usize;
-+         _5 = must_use::<usize>(const 2_usize) -> [return: bb3, unwind unreachable];
-      }
-  
-      bb3: {
-          StorageDead(_6);
           StorageLive(_7);
-          StorageLive(_8);
--         _8 = OffsetOf(Alpha, [(0, 2), (0, 1)]);
--         _7 = must_use::<usize>(move _8) -> [return: bb4, unwind unreachable];
-+         _8 = const 3_usize;
-+         _7 = must_use::<usize>(const 3_usize) -> [return: bb4, unwind unreachable];
-      }
-  
-      bb4: {
-          StorageDead(_8);
-          StorageLive(_9);
-          StorageLive(_10);
--         _10 = OffsetOf(Epsilon, [(0, 0)]);
--         _9 = must_use::<usize>(move _10) -> [return: bb5, unwind unreachable];
-+         _10 = const 1_usize;
-+         _9 = must_use::<usize>(const 1_usize) -> [return: bb5, unwind unreachable];
-      }
-  
-      bb5: {
-          StorageDead(_10);
-          StorageLive(_11);
-          StorageLive(_12);
--         _12 = OffsetOf(Epsilon, [(0, 1)]);
--         _11 = must_use::<usize>(move _12) -> [return: bb6, unwind unreachable];
-+         _12 = const 2_usize;
-+         _11 = must_use::<usize>(const 2_usize) -> [return: bb6, unwind unreachable];
-      }
-  
-      bb6: {
-          StorageDead(_12);
-          StorageLive(_13);
-          StorageLive(_14);
--         _14 = OffsetOf(Epsilon, [(2, 0)]);
--         _13 = must_use::<usize>(move _14) -> [return: bb7, unwind unreachable];
-+         _14 = const 4_usize;
-+         _13 = must_use::<usize>(const 4_usize) -> [return: bb7, unwind unreachable];
-      }
-  
-      bb7: {
-          StorageDead(_14);
+-         _7 = OffsetOf(Epsilon, [(2, 0)]);
++         _7 = const 4_usize;
           _0 = const ();
-          StorageDead(_13);
-          StorageDead(_11);
-          StorageDead(_9);
           StorageDead(_7);
+          StorageDead(_6);
           StorageDead(_5);
+          StorageDead(_4);
           StorageDead(_3);
+          StorageDead(_2);
           StorageDead(_1);
           return;
       }
diff --git a/tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-unwind.diff
index 4d890742ee9..77a2c5bcccc 100644
--- a/tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-unwind.diff
+++ b/tests/mir-opt/const_prop/offset_of.concrete.GVN.panic-unwind.diff
@@ -4,33 +4,26 @@
   fn concrete() -> () {
       let mut _0: ();
       let _1: usize;
-      let mut _2: usize;
-      let mut _4: usize;
-      let mut _6: usize;
-      let mut _8: usize;
-      let mut _10: usize;
-      let mut _12: usize;
-      let mut _14: usize;
       scope 1 {
           debug x => _1;
-          let _3: usize;
+          let _2: usize;
           scope 2 {
-              debug y => _3;
-              let _5: usize;
+              debug y => _2;
+              let _3: usize;
               scope 3 {
-                  debug z0 => _5;
-                  let _7: usize;
+                  debug z0 => _3;
+                  let _4: usize;
                   scope 4 {
-                      debug z1 => _7;
-                      let _9: usize;
+                      debug z1 => _4;
+                      let _5: usize;
                       scope 5 {
-                          debug eA0 => _9;
-                          let _11: usize;
+                          debug eA0 => _5;
+                          let _6: usize;
                           scope 6 {
-                              debug eA1 => _11;
-                              let _13: usize;
+                              debug eA1 => _6;
+                              let _7: usize;
                               scope 7 {
-                                  debug eC => _13;
+                                  debug eC => _7;
                               }
                           }
                       }
@@ -41,82 +34,33 @@
   
       bb0: {
           StorageLive(_1);
+-         _1 = OffsetOf(Alpha, [(0, 0)]);
++         _1 = const 4_usize;
           StorageLive(_2);
--         _2 = OffsetOf(Alpha, [(0, 0)]);
--         _1 = must_use::<usize>(move _2) -> [return: bb1, unwind continue];
-+         _2 = const 4_usize;
-+         _1 = must_use::<usize>(const 4_usize) -> [return: bb1, unwind continue];
-      }
-  
-      bb1: {
-          StorageDead(_2);
+-         _2 = OffsetOf(Alpha, [(0, 1)]);
++         _2 = const 0_usize;
           StorageLive(_3);
+-         _3 = OffsetOf(Alpha, [(0, 2), (0, 0)]);
++         _3 = const 2_usize;
           StorageLive(_4);
--         _4 = OffsetOf(Alpha, [(0, 1)]);
--         _3 = must_use::<usize>(move _4) -> [return: bb2, unwind continue];
-+         _4 = const 0_usize;
-+         _3 = must_use::<usize>(const 0_usize) -> [return: bb2, unwind continue];
-      }
-  
-      bb2: {
-          StorageDead(_4);
+-         _4 = OffsetOf(Alpha, [(0, 2), (0, 1)]);
++         _4 = const 3_usize;
           StorageLive(_5);
+-         _5 = OffsetOf(Epsilon, [(0, 0)]);
++         _5 = const 1_usize;
           StorageLive(_6);
--         _6 = OffsetOf(Alpha, [(0, 2), (0, 0)]);
--         _5 = must_use::<usize>(move _6) -> [return: bb3, unwind continue];
+-         _6 = OffsetOf(Epsilon, [(0, 1)]);
 +         _6 = const 2_usize;
-+         _5 = must_use::<usize>(const 2_usize) -> [return: bb3, unwind continue];
-      }
-  
-      bb3: {
-          StorageDead(_6);
           StorageLive(_7);
-          StorageLive(_8);
--         _8 = OffsetOf(Alpha, [(0, 2), (0, 1)]);
--         _7 = must_use::<usize>(move _8) -> [return: bb4, unwind continue];
-+         _8 = const 3_usize;
-+         _7 = must_use::<usize>(const 3_usize) -> [return: bb4, unwind continue];
-      }
-  
-      bb4: {
-          StorageDead(_8);
-          StorageLive(_9);
-          StorageLive(_10);
--         _10 = OffsetOf(Epsilon, [(0, 0)]);
--         _9 = must_use::<usize>(move _10) -> [return: bb5, unwind continue];
-+         _10 = const 1_usize;
-+         _9 = must_use::<usize>(const 1_usize) -> [return: bb5, unwind continue];
-      }
-  
-      bb5: {
-          StorageDead(_10);
-          StorageLive(_11);
-          StorageLive(_12);
--         _12 = OffsetOf(Epsilon, [(0, 1)]);
--         _11 = must_use::<usize>(move _12) -> [return: bb6, unwind continue];
-+         _12 = const 2_usize;
-+         _11 = must_use::<usize>(const 2_usize) -> [return: bb6, unwind continue];
-      }
-  
-      bb6: {
-          StorageDead(_12);
-          StorageLive(_13);
-          StorageLive(_14);
--         _14 = OffsetOf(Epsilon, [(2, 0)]);
--         _13 = must_use::<usize>(move _14) -> [return: bb7, unwind continue];
-+         _14 = const 4_usize;
-+         _13 = must_use::<usize>(const 4_usize) -> [return: bb7, unwind continue];
-      }
-  
-      bb7: {
-          StorageDead(_14);
+-         _7 = OffsetOf(Epsilon, [(2, 0)]);
++         _7 = const 4_usize;
           _0 = const ();
-          StorageDead(_13);
-          StorageDead(_11);
-          StorageDead(_9);
           StorageDead(_7);
+          StorageDead(_6);
           StorageDead(_5);
+          StorageDead(_4);
           StorageDead(_3);
+          StorageDead(_2);
           StorageDead(_1);
           return;
       }
diff --git a/tests/mir-opt/const_prop/offset_of.generic.GVN.panic-abort.diff b/tests/mir-opt/const_prop/offset_of.generic.GVN.panic-abort.diff
index 025241dd1bf..130c31eff8c 100644
--- a/tests/mir-opt/const_prop/offset_of.generic.GVN.panic-abort.diff
+++ b/tests/mir-opt/const_prop/offset_of.generic.GVN.panic-abort.diff
@@ -4,33 +4,26 @@
   fn generic() -> () {
       let mut _0: ();
       let _1: usize;
-      let mut _2: usize;
-      let mut _4: usize;
-      let mut _6: usize;
-      let mut _8: usize;
-      let mut _10: usize;
-      let mut _12: usize;
-      let mut _14: usize;
       scope 1 {
           debug gx => _1;
-          let _3: usize;
+          let _2: usize;
           scope 2 {
-              debug gy => _3;
-              let _5: usize;
+              debug gy => _2;
+              let _3: usize;
               scope 3 {
-                  debug dx => _5;
-                  let _7: usize;
+                  debug dx => _3;
+                  let _4: usize;
                   scope 4 {
-                      debug dy => _7;
-                      let _9: usize;
+                      debug dy => _4;
+                      let _5: usize;
                       scope 5 {
-                          debug zA0 => _9;
-                          let _11: usize;
+                          debug zA0 => _5;
+                          let _6: usize;
                           scope 6 {
-                              debug zA1 => _11;
-                              let _13: usize;
+                              debug zA1 => _6;
+                              let _7: usize;
                               scope 7 {
-                                  debug zB => _13;
+                                  debug zB => _7;
                               }
                           }
                       }
@@ -41,72 +34,28 @@
   
       bb0: {
           StorageLive(_1);
+          _1 = OffsetOf(Gamma<T>, [(0, 0)]);
           StorageLive(_2);
-          _2 = OffsetOf(Gamma<T>, [(0, 0)]);
-          _1 = must_use::<usize>(move _2) -> [return: bb1, unwind unreachable];
-      }
-  
-      bb1: {
-          StorageDead(_2);
+          _2 = OffsetOf(Gamma<T>, [(0, 1)]);
           StorageLive(_3);
+-         _3 = OffsetOf(Delta<T>, [(0, 1)]);
++         _3 = const 0_usize;
           StorageLive(_4);
-          _4 = OffsetOf(Gamma<T>, [(0, 1)]);
-          _3 = must_use::<usize>(move _4) -> [return: bb2, unwind unreachable];
-      }
-  
-      bb2: {
-          StorageDead(_4);
+-         _4 = OffsetOf(Delta<T>, [(0, 2)]);
++         _4 = const 2_usize;
           StorageLive(_5);
+          _5 = OffsetOf(Zeta<T>, [(0, 0)]);
           StorageLive(_6);
--         _6 = OffsetOf(Delta<T>, [(0, 1)]);
--         _5 = must_use::<usize>(move _6) -> [return: bb3, unwind unreachable];
-+         _6 = const 0_usize;
-+         _5 = must_use::<usize>(const 0_usize) -> [return: bb3, unwind unreachable];
-      }
-  
-      bb3: {
-          StorageDead(_6);
+          _6 = OffsetOf(Zeta<T>, [(0, 1)]);
           StorageLive(_7);
-          StorageLive(_8);
--         _8 = OffsetOf(Delta<T>, [(0, 2)]);
--         _7 = must_use::<usize>(move _8) -> [return: bb4, unwind unreachable];
-+         _8 = const 2_usize;
-+         _7 = must_use::<usize>(const 2_usize) -> [return: bb4, unwind unreachable];
-      }
-  
-      bb4: {
-          StorageDead(_8);
-          StorageLive(_9);
-          StorageLive(_10);
-          _10 = OffsetOf(Zeta<T>, [(0, 0)]);
-          _9 = must_use::<usize>(move _10) -> [return: bb5, unwind unreachable];
-      }
-  
-      bb5: {
-          StorageDead(_10);
-          StorageLive(_11);
-          StorageLive(_12);
-          _12 = OffsetOf(Zeta<T>, [(0, 1)]);
-          _11 = must_use::<usize>(move _12) -> [return: bb6, unwind unreachable];
-      }
-  
-      bb6: {
-          StorageDead(_12);
-          StorageLive(_13);
-          StorageLive(_14);
-          _14 = OffsetOf(Zeta<T>, [(1, 0)]);
-          _13 = must_use::<usize>(move _14) -> [return: bb7, unwind unreachable];
-      }
-  
-      bb7: {
-          StorageDead(_14);
+          _7 = OffsetOf(Zeta<T>, [(1, 0)]);
           _0 = const ();
-          StorageDead(_13);
-          StorageDead(_11);
-          StorageDead(_9);
           StorageDead(_7);
+          StorageDead(_6);
           StorageDead(_5);
+          StorageDead(_4);
           StorageDead(_3);
+          StorageDead(_2);
           StorageDead(_1);
           return;
       }
diff --git a/tests/mir-opt/const_prop/offset_of.generic.GVN.panic-unwind.diff b/tests/mir-opt/const_prop/offset_of.generic.GVN.panic-unwind.diff
index 27f2b2f7355..130c31eff8c 100644
--- a/tests/mir-opt/const_prop/offset_of.generic.GVN.panic-unwind.diff
+++ b/tests/mir-opt/const_prop/offset_of.generic.GVN.panic-unwind.diff
@@ -4,33 +4,26 @@
   fn generic() -> () {
       let mut _0: ();
       let _1: usize;
-      let mut _2: usize;
-      let mut _4: usize;
-      let mut _6: usize;
-      let mut _8: usize;
-      let mut _10: usize;
-      let mut _12: usize;
-      let mut _14: usize;
       scope 1 {
           debug gx => _1;
-          let _3: usize;
+          let _2: usize;
           scope 2 {
-              debug gy => _3;
-              let _5: usize;
+              debug gy => _2;
+              let _3: usize;
               scope 3 {
-                  debug dx => _5;
-                  let _7: usize;
+                  debug dx => _3;
+                  let _4: usize;
                   scope 4 {
-                      debug dy => _7;
-                      let _9: usize;
+                      debug dy => _4;
+                      let _5: usize;
                       scope 5 {
-                          debug zA0 => _9;
-                          let _11: usize;
+                          debug zA0 => _5;
+                          let _6: usize;
                           scope 6 {
-                              debug zA1 => _11;
-                              let _13: usize;
+                              debug zA1 => _6;
+                              let _7: usize;
                               scope 7 {
-                                  debug zB => _13;
+                                  debug zB => _7;
                               }
                           }
                       }
@@ -41,72 +34,28 @@
   
       bb0: {
           StorageLive(_1);
+          _1 = OffsetOf(Gamma<T>, [(0, 0)]);
           StorageLive(_2);
-          _2 = OffsetOf(Gamma<T>, [(0, 0)]);
-          _1 = must_use::<usize>(move _2) -> [return: bb1, unwind continue];
-      }
-  
-      bb1: {
-          StorageDead(_2);
+          _2 = OffsetOf(Gamma<T>, [(0, 1)]);
           StorageLive(_3);
+-         _3 = OffsetOf(Delta<T>, [(0, 1)]);
++         _3 = const 0_usize;
           StorageLive(_4);
-          _4 = OffsetOf(Gamma<T>, [(0, 1)]);
-          _3 = must_use::<usize>(move _4) -> [return: bb2, unwind continue];
-      }
-  
-      bb2: {
-          StorageDead(_4);
+-         _4 = OffsetOf(Delta<T>, [(0, 2)]);
++         _4 = const 2_usize;
           StorageLive(_5);
+          _5 = OffsetOf(Zeta<T>, [(0, 0)]);
           StorageLive(_6);
--         _6 = OffsetOf(Delta<T>, [(0, 1)]);
--         _5 = must_use::<usize>(move _6) -> [return: bb3, unwind continue];
-+         _6 = const 0_usize;
-+         _5 = must_use::<usize>(const 0_usize) -> [return: bb3, unwind continue];
-      }
-  
-      bb3: {
-          StorageDead(_6);
+          _6 = OffsetOf(Zeta<T>, [(0, 1)]);
           StorageLive(_7);
-          StorageLive(_8);
--         _8 = OffsetOf(Delta<T>, [(0, 2)]);
--         _7 = must_use::<usize>(move _8) -> [return: bb4, unwind continue];
-+         _8 = const 2_usize;
-+         _7 = must_use::<usize>(const 2_usize) -> [return: bb4, unwind continue];
-      }
-  
-      bb4: {
-          StorageDead(_8);
-          StorageLive(_9);
-          StorageLive(_10);
-          _10 = OffsetOf(Zeta<T>, [(0, 0)]);
-          _9 = must_use::<usize>(move _10) -> [return: bb5, unwind continue];
-      }
-  
-      bb5: {
-          StorageDead(_10);
-          StorageLive(_11);
-          StorageLive(_12);
-          _12 = OffsetOf(Zeta<T>, [(0, 1)]);
-          _11 = must_use::<usize>(move _12) -> [return: bb6, unwind continue];
-      }
-  
-      bb6: {
-          StorageDead(_12);
-          StorageLive(_13);
-          StorageLive(_14);
-          _14 = OffsetOf(Zeta<T>, [(1, 0)]);
-          _13 = must_use::<usize>(move _14) -> [return: bb7, unwind continue];
-      }
-  
-      bb7: {
-          StorageDead(_14);
+          _7 = OffsetOf(Zeta<T>, [(1, 0)]);
           _0 = const ();
-          StorageDead(_13);
-          StorageDead(_11);
-          StorageDead(_9);
           StorageDead(_7);
+          StorageDead(_6);
           StorageDead(_5);
+          StorageDead(_4);
           StorageDead(_3);
+          StorageDead(_2);
           StorageDead(_1);
           return;
       }
diff --git a/tests/mir-opt/dataflow-const-prop/offset_of.concrete.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/offset_of.concrete.DataflowConstProp.panic-abort.diff
index f8f89175033..92691d0f807 100644
--- a/tests/mir-opt/dataflow-const-prop/offset_of.concrete.DataflowConstProp.panic-abort.diff
+++ b/tests/mir-opt/dataflow-const-prop/offset_of.concrete.DataflowConstProp.panic-abort.diff
@@ -4,21 +4,17 @@
   fn concrete() -> () {
       let mut _0: ();
       let _1: usize;
-      let mut _2: usize;
-      let mut _4: usize;
-      let mut _6: usize;
-      let mut _8: usize;
       scope 1 {
           debug x => _1;
-          let _3: usize;
+          let _2: usize;
           scope 2 {
-              debug y => _3;
-              let _5: usize;
+              debug y => _2;
+              let _3: usize;
               scope 3 {
-                  debug z0 => _5;
-                  let _7: usize;
+                  debug z0 => _3;
+                  let _4: usize;
                   scope 4 {
-                      debug z1 => _7;
+                      debug z1 => _4;
                   }
               }
           }
@@ -26,49 +22,21 @@
   
       bb0: {
           StorageLive(_1);
+-         _1 = OffsetOf(Alpha, [(0, 0)]);
++         _1 = const 4_usize;
           StorageLive(_2);
--         _2 = OffsetOf(Alpha, [(0, 0)]);
--         _1 = must_use::<usize>(move _2) -> [return: bb1, unwind unreachable];
-+         _2 = const 4_usize;
-+         _1 = must_use::<usize>(const 4_usize) -> [return: bb1, unwind unreachable];
-      }
-  
-      bb1: {
-          StorageDead(_2);
+-         _2 = OffsetOf(Alpha, [(0, 1)]);
++         _2 = const 0_usize;
           StorageLive(_3);
+-         _3 = OffsetOf(Alpha, [(0, 2), (0, 0)]);
++         _3 = const 2_usize;
           StorageLive(_4);
--         _4 = OffsetOf(Alpha, [(0, 1)]);
--         _3 = must_use::<usize>(move _4) -> [return: bb2, unwind unreachable];
-+         _4 = const 0_usize;
-+         _3 = must_use::<usize>(const 0_usize) -> [return: bb2, unwind unreachable];
-      }
-  
-      bb2: {
-          StorageDead(_4);
-          StorageLive(_5);
-          StorageLive(_6);
--         _6 = OffsetOf(Alpha, [(0, 2), (0, 0)]);
--         _5 = must_use::<usize>(move _6) -> [return: bb3, unwind unreachable];
-+         _6 = const 2_usize;
-+         _5 = must_use::<usize>(const 2_usize) -> [return: bb3, unwind unreachable];
-      }
-  
-      bb3: {
-          StorageDead(_6);
-          StorageLive(_7);
-          StorageLive(_8);
--         _8 = OffsetOf(Alpha, [(0, 2), (0, 1)]);
--         _7 = must_use::<usize>(move _8) -> [return: bb4, unwind unreachable];
-+         _8 = const 3_usize;
-+         _7 = must_use::<usize>(const 3_usize) -> [return: bb4, unwind unreachable];
-      }
-  
-      bb4: {
-          StorageDead(_8);
+-         _4 = OffsetOf(Alpha, [(0, 2), (0, 1)]);
++         _4 = const 3_usize;
           _0 = const ();
-          StorageDead(_7);
-          StorageDead(_5);
+          StorageDead(_4);
           StorageDead(_3);
+          StorageDead(_2);
           StorageDead(_1);
           return;
       }
diff --git a/tests/mir-opt/dataflow-const-prop/offset_of.concrete.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/offset_of.concrete.DataflowConstProp.panic-unwind.diff
index d4f8cb66704..92691d0f807 100644
--- a/tests/mir-opt/dataflow-const-prop/offset_of.concrete.DataflowConstProp.panic-unwind.diff
+++ b/tests/mir-opt/dataflow-const-prop/offset_of.concrete.DataflowConstProp.panic-unwind.diff
@@ -4,21 +4,17 @@
   fn concrete() -> () {
       let mut _0: ();
       let _1: usize;
-      let mut _2: usize;
-      let mut _4: usize;
-      let mut _6: usize;
-      let mut _8: usize;
       scope 1 {
           debug x => _1;
-          let _3: usize;
+          let _2: usize;
           scope 2 {
-              debug y => _3;
-              let _5: usize;
+              debug y => _2;
+              let _3: usize;
               scope 3 {
-                  debug z0 => _5;
-                  let _7: usize;
+                  debug z0 => _3;
+                  let _4: usize;
                   scope 4 {
-                      debug z1 => _7;
+                      debug z1 => _4;
                   }
               }
           }
@@ -26,49 +22,21 @@
   
       bb0: {
           StorageLive(_1);
+-         _1 = OffsetOf(Alpha, [(0, 0)]);
++         _1 = const 4_usize;
           StorageLive(_2);
--         _2 = OffsetOf(Alpha, [(0, 0)]);
--         _1 = must_use::<usize>(move _2) -> [return: bb1, unwind continue];
-+         _2 = const 4_usize;
-+         _1 = must_use::<usize>(const 4_usize) -> [return: bb1, unwind continue];
-      }
-  
-      bb1: {
-          StorageDead(_2);
+-         _2 = OffsetOf(Alpha, [(0, 1)]);
++         _2 = const 0_usize;
           StorageLive(_3);
+-         _3 = OffsetOf(Alpha, [(0, 2), (0, 0)]);
++         _3 = const 2_usize;
           StorageLive(_4);
--         _4 = OffsetOf(Alpha, [(0, 1)]);
--         _3 = must_use::<usize>(move _4) -> [return: bb2, unwind continue];
-+         _4 = const 0_usize;
-+         _3 = must_use::<usize>(const 0_usize) -> [return: bb2, unwind continue];
-      }
-  
-      bb2: {
-          StorageDead(_4);
-          StorageLive(_5);
-          StorageLive(_6);
--         _6 = OffsetOf(Alpha, [(0, 2), (0, 0)]);
--         _5 = must_use::<usize>(move _6) -> [return: bb3, unwind continue];
-+         _6 = const 2_usize;
-+         _5 = must_use::<usize>(const 2_usize) -> [return: bb3, unwind continue];
-      }
-  
-      bb3: {
-          StorageDead(_6);
-          StorageLive(_7);
-          StorageLive(_8);
--         _8 = OffsetOf(Alpha, [(0, 2), (0, 1)]);
--         _7 = must_use::<usize>(move _8) -> [return: bb4, unwind continue];
-+         _8 = const 3_usize;
-+         _7 = must_use::<usize>(const 3_usize) -> [return: bb4, unwind continue];
-      }
-  
-      bb4: {
-          StorageDead(_8);
+-         _4 = OffsetOf(Alpha, [(0, 2), (0, 1)]);
++         _4 = const 3_usize;
           _0 = const ();
-          StorageDead(_7);
-          StorageDead(_5);
+          StorageDead(_4);
           StorageDead(_3);
+          StorageDead(_2);
           StorageDead(_1);
           return;
       }
diff --git a/tests/mir-opt/dataflow-const-prop/offset_of.generic.DataflowConstProp.panic-abort.diff b/tests/mir-opt/dataflow-const-prop/offset_of.generic.DataflowConstProp.panic-abort.diff
index 7f166e4fa35..c6908166def 100644
--- a/tests/mir-opt/dataflow-const-prop/offset_of.generic.DataflowConstProp.panic-abort.diff
+++ b/tests/mir-opt/dataflow-const-prop/offset_of.generic.DataflowConstProp.panic-abort.diff
@@ -4,21 +4,17 @@
   fn generic() -> () {
       let mut _0: ();
       let _1: usize;
-      let mut _2: usize;
-      let mut _4: usize;
-      let mut _6: usize;
-      let mut _8: usize;
       scope 1 {
           debug gx => _1;
-          let _3: usize;
+          let _2: usize;
           scope 2 {
-              debug gy => _3;
-              let _5: usize;
+              debug gy => _2;
+              let _3: usize;
               scope 3 {
-                  debug dx => _5;
-                  let _7: usize;
+                  debug dx => _3;
+                  let _4: usize;
                   scope 4 {
-                      debug dy => _7;
+                      debug dy => _4;
                   }
               }
           }
@@ -26,45 +22,19 @@
   
       bb0: {
           StorageLive(_1);
+          _1 = OffsetOf(Gamma<T>, [(0, 0)]);
           StorageLive(_2);
-          _2 = OffsetOf(Gamma<T>, [(0, 0)]);
-          _1 = must_use::<usize>(move _2) -> [return: bb1, unwind unreachable];
-      }
-  
-      bb1: {
-          StorageDead(_2);
+          _2 = OffsetOf(Gamma<T>, [(0, 1)]);
           StorageLive(_3);
+-         _3 = OffsetOf(Delta<T>, [(0, 1)]);
++         _3 = const 0_usize;
           StorageLive(_4);
-          _4 = OffsetOf(Gamma<T>, [(0, 1)]);
-          _3 = must_use::<usize>(move _4) -> [return: bb2, unwind unreachable];
-      }
-  
-      bb2: {
-          StorageDead(_4);
-          StorageLive(_5);
-          StorageLive(_6);
--         _6 = OffsetOf(Delta<T>, [(0, 1)]);
--         _5 = must_use::<usize>(move _6) -> [return: bb3, unwind unreachable];
-+         _6 = const 0_usize;
-+         _5 = must_use::<usize>(const 0_usize) -> [return: bb3, unwind unreachable];
-      }
-  
-      bb3: {
-          StorageDead(_6);
-          StorageLive(_7);
-          StorageLive(_8);
--         _8 = OffsetOf(Delta<T>, [(0, 2)]);
--         _7 = must_use::<usize>(move _8) -> [return: bb4, unwind unreachable];
-+         _8 = const 2_usize;
-+         _7 = must_use::<usize>(const 2_usize) -> [return: bb4, unwind unreachable];
-      }
-  
-      bb4: {
-          StorageDead(_8);
+-         _4 = OffsetOf(Delta<T>, [(0, 2)]);
++         _4 = const 2_usize;
           _0 = const ();
-          StorageDead(_7);
-          StorageDead(_5);
+          StorageDead(_4);
           StorageDead(_3);
+          StorageDead(_2);
           StorageDead(_1);
           return;
       }
diff --git a/tests/mir-opt/dataflow-const-prop/offset_of.generic.DataflowConstProp.panic-unwind.diff b/tests/mir-opt/dataflow-const-prop/offset_of.generic.DataflowConstProp.panic-unwind.diff
index 38ad6f79801..c6908166def 100644
--- a/tests/mir-opt/dataflow-const-prop/offset_of.generic.DataflowConstProp.panic-unwind.diff
+++ b/tests/mir-opt/dataflow-const-prop/offset_of.generic.DataflowConstProp.panic-unwind.diff
@@ -4,21 +4,17 @@
   fn generic() -> () {
       let mut _0: ();
       let _1: usize;
-      let mut _2: usize;
-      let mut _4: usize;
-      let mut _6: usize;
-      let mut _8: usize;
       scope 1 {
           debug gx => _1;
-          let _3: usize;
+          let _2: usize;
           scope 2 {
-              debug gy => _3;
-              let _5: usize;
+              debug gy => _2;
+              let _3: usize;
               scope 3 {
-                  debug dx => _5;
-                  let _7: usize;
+                  debug dx => _3;
+                  let _4: usize;
                   scope 4 {
-                      debug dy => _7;
+                      debug dy => _4;
                   }
               }
           }
@@ -26,45 +22,19 @@
   
       bb0: {
           StorageLive(_1);
+          _1 = OffsetOf(Gamma<T>, [(0, 0)]);
           StorageLive(_2);
-          _2 = OffsetOf(Gamma<T>, [(0, 0)]);
-          _1 = must_use::<usize>(move _2) -> [return: bb1, unwind continue];
-      }
-  
-      bb1: {
-          StorageDead(_2);
+          _2 = OffsetOf(Gamma<T>, [(0, 1)]);
           StorageLive(_3);
+-         _3 = OffsetOf(Delta<T>, [(0, 1)]);
++         _3 = const 0_usize;
           StorageLive(_4);
-          _4 = OffsetOf(Gamma<T>, [(0, 1)]);
-          _3 = must_use::<usize>(move _4) -> [return: bb2, unwind continue];
-      }
-  
-      bb2: {
-          StorageDead(_4);
-          StorageLive(_5);
-          StorageLive(_6);
--         _6 = OffsetOf(Delta<T>, [(0, 1)]);
--         _5 = must_use::<usize>(move _6) -> [return: bb3, unwind continue];
-+         _6 = const 0_usize;
-+         _5 = must_use::<usize>(const 0_usize) -> [return: bb3, unwind continue];
-      }
-  
-      bb3: {
-          StorageDead(_6);
-          StorageLive(_7);
-          StorageLive(_8);
--         _8 = OffsetOf(Delta<T>, [(0, 2)]);
--         _7 = must_use::<usize>(move _8) -> [return: bb4, unwind continue];
-+         _8 = const 2_usize;
-+         _7 = must_use::<usize>(const 2_usize) -> [return: bb4, unwind continue];
-      }
-  
-      bb4: {
-          StorageDead(_8);
+-         _4 = OffsetOf(Delta<T>, [(0, 2)]);
++         _4 = const 2_usize;
           _0 = const ();
-          StorageDead(_7);
-          StorageDead(_5);
+          StorageDead(_4);
           StorageDead(_3);
+          StorageDead(_2);
           StorageDead(_1);
           return;
       }
diff --git a/tests/mir-opt/dataflow-const-prop/offset_of.rs b/tests/mir-opt/dataflow-const-prop/offset_of.rs
index cd4e1f6990d..12396b31ed0 100644
--- a/tests/mir-opt/dataflow-const-prop/offset_of.rs
+++ b/tests/mir-opt/dataflow-const-prop/offset_of.rs
@@ -36,16 +36,16 @@ fn concrete() {
     // CHECK: debug z0 => [[z0:_.*]];
     // CHECK: debug z1 => [[z1:_.*]];
 
-    // CHECK: [[x]] = must_use::<usize>(const 4_usize) -> {{.*}}
+    // CHECK: [[x]] = const 4_usize
     let x = offset_of!(Alpha, x);
 
-    // CHECK: [[y]] = must_use::<usize>(const 0_usize) -> {{.*}}
+    // CHECK: [[y]] = const 0_usize
     let y = offset_of!(Alpha, y);
 
-    // CHECK: [[z0]] = must_use::<usize>(const 2_usize) -> {{.*}}
+    // CHECK: [[z0]] = const 2_usize
     let z0 = offset_of!(Alpha, z.0);
 
-    // CHECK: [[z1]] = must_use::<usize>(const 3_usize) -> {{.*}}
+    // CHECK: [[z1]] = const 3_usize
     let z1 = offset_of!(Alpha, z.1);
 }
 
@@ -58,16 +58,16 @@ fn generic<T>() {
     // CHECK: debug dx => [[dx:_.*]];
     // CHECK: debug dy => [[dy:_.*]];
 
-    // CHECK: [[gx]] = must_use::<usize>(move {{_.*}}) -> {{.*}}
+    // CHECK: [[gx]] = OffsetOf(Gamma<T>, [(0, 0)]);
     let gx = offset_of!(Gamma<T>, x);
 
-    // CHECK: [[gy]] = must_use::<usize>(move {{_.*}}) -> {{.*}}
+    // CHECK: [[gy]] = OffsetOf(Gamma<T>, [(0, 1)]);
     let gy = offset_of!(Gamma<T>, y);
 
-    // CHECK: [[dx]] = must_use::<usize>(const 0_usize) -> {{.*}}
+    // CHECK: [[dx]] = const 0_usize
     let dx = offset_of!(Delta<T>, x);
 
-    // CHECK: [[dy]] = must_use::<usize>(const 2_usize) -> {{.*}}
+    // CHECK: [[dy]] = const 2_usize
     let dy = offset_of!(Delta<T>, y);
 }
 
diff --git a/tests/pretty/postfix-match/precedence.pp b/tests/pretty/postfix-match/precedence.pp
new file mode 100644
index 00000000000..967aa7bc39e
--- /dev/null
+++ b/tests/pretty/postfix-match/precedence.pp
@@ -0,0 +1,34 @@
+#![feature(prelude_import)]
+#![no_std]
+#![feature(postfix_match)]
+#[prelude_import]
+use ::std::prelude::rust_2015::*;
+#[macro_use]
+extern crate std;
+
+use std::ops::Add;
+
+//@ pretty-mode:expanded
+//@ pp-exact:precedence.pp
+
+macro_rules! repro { ($e:expr) => { $e.match { _ => {} } }; }
+
+struct Struct {}
+
+impl Add<Struct> for usize {
+    type Output = ();
+    fn add(self, _: Struct) -> () { () }
+}
+pub fn main() {
+    let a;
+    (
+        { 1 } + 1).match {
+        _ => {}
+    };
+    (4 as usize).match { _ => {} };
+    (return).match { _ => {} };
+    (a = 42).match { _ => {} };
+    (|| {}).match { _ => {} };
+    (42..101).match { _ => {} };
+    (1 + Struct {}).match { _ => {} };
+}
diff --git a/tests/pretty/postfix-match/precedence.rs b/tests/pretty/postfix-match/precedence.rs
new file mode 100644
index 00000000000..ee947e161dd
--- /dev/null
+++ b/tests/pretty/postfix-match/precedence.rs
@@ -0,0 +1,34 @@
+#![feature(postfix_match)]
+
+use std::ops::Add;
+
+//@ pretty-mode:expanded
+//@ pp-exact:precedence.pp
+
+macro_rules! repro {
+    ($e:expr) => {
+        $e.match {
+            _ => {}
+        }
+    };
+}
+
+struct Struct {}
+
+impl Add<Struct> for usize {
+    type Output = ();
+    fn add(self, _: Struct) -> () {
+        ()
+    }
+}
+pub fn main() {
+    let a;
+
+    repro!({ 1 } + 1);
+    repro!(4 as usize);
+    repro!(return);
+    repro!(a = 42);
+    repro!(|| {});
+    repro!(42..101);
+    repro!(1 + Struct {});
+}
diff --git a/tests/pretty/postfix-match.rs b/tests/pretty/postfix-match/simple-matches.rs
index 5bb54e15275..5bb54e15275 100644
--- a/tests/pretty/postfix-match.rs
+++ b/tests/pretty/postfix-match/simple-matches.rs
diff --git a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-inherit.rs b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-inherit.rs
index 694fa460e9b..3e63349edb7 100644
--- a/tests/ui/attributes/unix_sigpipe/unix_sigpipe-inherit.rs
+++ b/tests/ui/attributes/unix_sigpipe/unix_sigpipe-inherit.rs
@@ -8,7 +8,7 @@
 
 extern crate libc;
 
-// By default the Rust runtime resets SIGPIPE to SIG_DFL before exec:ing child
+// By default the Rust runtime resets SIGPIPE to SIG_DFL before exec'ing child
 // processes so opt-out of that with `#[unix_sigpipe = "sig_dfl"]`. See
 // https://github.com/rust-lang/rust/blob/bf4de3a874753bbee3323081c8b0c133444fed2d/library/std/src/sys/pal/unix/process/process_unix.rs#L359-L384
 #[unix_sigpipe = "sig_dfl"]
diff --git a/tests/ui/lint/ice-const-prop-unions-known-panics-lint-123710.rs b/tests/ui/lint/ice-const-prop-unions-known-panics-lint-123710.rs
new file mode 100644
index 00000000000..2b93d0f8a60
--- /dev/null
+++ b/tests/ui/lint/ice-const-prop-unions-known-panics-lint-123710.rs
@@ -0,0 +1,22 @@
+// Regression test for issue 123710.
+// Tests that the we do not ICE in KnownPanicsLint
+// when a union contains an enum with an repr(packed),
+// which is a repr not supported for enums
+
+#[repr(packed)]
+//~^ ERROR attribute should be applied to a struct or union
+#[repr(u32)]
+enum E {
+    A,
+    B,
+    C,
+}
+
+fn main() {
+    union InvalidTag {
+        int: u32,
+        e: E,
+//~^ ERROR field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
+    }
+    let _invalid_tag = InvalidTag { int: 4 };
+}
diff --git a/tests/ui/lint/ice-const-prop-unions-known-panics-lint-123710.stderr b/tests/ui/lint/ice-const-prop-unions-known-panics-lint-123710.stderr
new file mode 100644
index 00000000000..44dde6120e8
--- /dev/null
+++ b/tests/ui/lint/ice-const-prop-unions-known-panics-lint-123710.stderr
@@ -0,0 +1,29 @@
+error[E0517]: attribute should be applied to a struct or union
+  --> $DIR/ice-const-prop-unions-known-panics-lint-123710.rs:6:8
+   |
+LL |   #[repr(packed)]
+   |          ^^^^^^
+...
+LL | / enum E {
+LL | |     A,
+LL | |     B,
+LL | |     C,
+LL | | }
+   | |_- not a struct or union
+
+error[E0740]: field must implement `Copy` or be wrapped in `ManuallyDrop<...>` to be used in a union
+  --> $DIR/ice-const-prop-unions-known-panics-lint-123710.rs:18:9
+   |
+LL |         e: E,
+   |         ^^^^
+   |
+   = note: union fields must not have drop side-effects, which is currently enforced via either `Copy` or `ManuallyDrop<...>`
+help: wrap the field type in `ManuallyDrop<...>`
+   |
+LL |         e: std::mem::ManuallyDrop<E>,
+   |            +++++++++++++++++++++++ +
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0517, E0740.
+For more information about an error, try `rustc --explain E0517`.
diff --git a/tests/ui/offset-of/offset-of-dst-field.stderr b/tests/ui/offset-of/offset-of-dst-field.stderr
index 753ba809e7d..adfd16c6f2b 100644
--- a/tests/ui/offset-of/offset-of-dst-field.stderr
+++ b/tests/ui/offset-of/offset-of-dst-field.stderr
@@ -34,20 +34,6 @@ LL |     offset_of!((u8, dyn Trait), 1);
    = help: the trait `Sized` is not implemented for `dyn Trait`
    = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
 
-error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
-  --> $DIR/offset-of-dst-field.rs:44:5
-   |
-LL |     offset_of!(Delta<Alpha>, z);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
-   |
-   = help: within `Alpha`, the trait `Sized` is not implemented for `[u8]`, which is required by `Alpha: Sized`
-note: required because it appears within the type `Alpha`
-  --> $DIR/offset-of-dst-field.rs:5:8
-   |
-LL | struct Alpha {
-   |        ^^^^^
-   = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
-
 error[E0277]: the size for values of type `Extern` cannot be known at compilation time
   --> $DIR/offset-of-dst-field.rs:45:5
    |
@@ -66,6 +52,20 @@ LL |     offset_of!(Delta<dyn Trait>, z);
    = help: the trait `Sized` is not implemented for `dyn Trait`
    = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
 
+error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
+  --> $DIR/offset-of-dst-field.rs:44:5
+   |
+LL |     offset_of!(Delta<Alpha>, z);
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
+   |
+   = help: within `Alpha`, the trait `Sized` is not implemented for `[u8]`, which is required by `Alpha: Sized`
+note: required because it appears within the type `Alpha`
+  --> $DIR/offset-of-dst-field.rs:5:8
+   |
+LL | struct Alpha {
+   |        ^^^^^
+   = note: this error originates in the macro `offset_of` (in Nightly builds, run with -Z macro-backtrace for more info)
+
 error[E0277]: the size for values of type `T` cannot be known at compilation time
   --> $DIR/offset-of-dst-field.rs:50:5
    |
diff --git a/tests/ui/offset-of/offset-of-must-use.rs b/tests/ui/offset-of/offset-of-must-use.rs
index f0c242891d8..87918b8ff95 100644
--- a/tests/ui/offset-of/offset-of-must-use.rs
+++ b/tests/ui/offset-of/offset-of-must-use.rs
@@ -4,5 +4,5 @@
 
 fn main() {
     core::mem::offset_of!((String,), 0);
-    //~^ WARN unused return value of `must_use` that must be used
+    //~^ WARN unused `offset_of` call that must be used
 }
diff --git a/tests/ui/offset-of/offset-of-must-use.stderr b/tests/ui/offset-of/offset-of-must-use.stderr
index b6d88e098d0..9f0e37a59f4 100644
--- a/tests/ui/offset-of/offset-of-must-use.stderr
+++ b/tests/ui/offset-of/offset-of-must-use.stderr
@@ -1,8 +1,8 @@
-warning: unused return value of `must_use` that must be used
+warning: unused `offset_of` call that must be used
   --> $DIR/offset-of-must-use.rs:6:5
    |
 LL |     core::mem::offset_of!((String,), 0);
-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the `offset_of` call produces a value
    |
 note: the lint level is defined here
   --> $DIR/offset-of-must-use.rs:3:9
diff --git a/tests/ui/offset-of/offset-of-temporaries.rs b/tests/ui/offset-of/offset-of-temporaries.rs
new file mode 100644
index 00000000000..951a8ee2b50
--- /dev/null
+++ b/tests/ui/offset-of/offset-of-temporaries.rs
@@ -0,0 +1,23 @@
+//@ build-pass
+
+//! Regression test #124478.
+
+use std::mem::offset_of;
+
+struct S {
+    v: u8,
+    w: u16,
+}
+
+impl S {
+    fn return_static_slice() -> &'static [usize] {
+        &[offset_of!(Self, v), offset_of!(Self, w)]
+    }
+    fn use_reference() -> usize {
+        let r = &offset_of!(Self, v);
+        *r * 6
+    }
+}
+
+fn main() {
+}