FileCheck issue_66971.

This commit is contained in:
Camille GILLOT 2023-12-02 20:36:48 +00:00
parent 218d8ccf43
commit ce9b1e23a5
3 changed files with 20 additions and 6 deletions

View File

@ -5,17 +5,24 @@
let mut _0: ();
let _1: ();
let mut _2: ((), u8, u8);
let mut _3: ();
bb0: {
StorageLive(_1);
StorageLive(_2);
- _2 = (const (), const 0_u8, const 0_u8);
- _1 = encode(move _2) -> [return: bb1, unwind unreachable];
StorageLive(_3);
_3 = ();
- _2 = (move _3, const 0_u8, const 0_u8);
+ _2 = const ((), 0_u8, 0_u8);
StorageDead(_3);
- _1 = encode(move _2) -> [return: bb1, unwind unreachable];
+ _1 = encode(const ((), 0_u8, 0_u8)) -> [return: bb1, unwind unreachable];
}
bb1: {
StorageDead(_2);
StorageDead(_1);
_0 = const ();
return;
}
+ }

View File

@ -5,17 +5,24 @@
let mut _0: ();
let _1: ();
let mut _2: ((), u8, u8);
let mut _3: ();
bb0: {
StorageLive(_1);
StorageLive(_2);
- _2 = (const (), const 0_u8, const 0_u8);
- _1 = encode(move _2) -> [return: bb1, unwind continue];
StorageLive(_3);
_3 = ();
- _2 = (move _3, const 0_u8, const 0_u8);
+ _2 = const ((), 0_u8, 0_u8);
StorageDead(_3);
- _1 = encode(move _2) -> [return: bb1, unwind continue];
+ _1 = encode(const ((), 0_u8, 0_u8)) -> [return: bb1, unwind continue];
}
bb1: {
StorageDead(_2);
StorageDead(_1);
_0 = const ();
return;
}
+ }

View File

@ -1,7 +1,5 @@
// skip-filecheck
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
// unit-test: ConstProp
// compile-flags: -Z mir-opt-level=3
// Due to a bug in propagating scalar pairs the assertion below used to fail. In the expected
// outputs below, after ConstProp this is how _2 would look like with the bug:
@ -16,5 +14,7 @@ fn encode(this: ((), u8, u8)) {
// EMIT_MIR issue_66971.main.ConstProp.diff
fn main() {
// CHECK-LABEL: fn main(
// CHECK: = encode(const ((), 0_u8, 0_u8))
encode(((), 0, 0));
}