Skip to content

Commit

Permalink
FileCheck issue_66971.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Dec 2, 2023
1 parent 218d8cc commit ce9b1e2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
+ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
+ }
Expand Down
4 changes: 2 additions & 2 deletions tests/mir-opt/const_prop/issue_66971.rs
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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));
}

0 comments on commit ce9b1e2

Please sign in to comment.