Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mir-opt tests for big-endian platforms #106046

Merged
merged 1 commit into from
Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/mir-opt/building/custom/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ fn consts<const C: u32>() {
})
}

static S: i32 = 5;
static mut T: i32 = 10;
static S: i32 = 0x05050505;
static mut T: i32 = 0x0a0a0a0a;
// EMIT_MIR consts.statics.built.after.mir
#[custom_mir(dialect = "built")]
fn statics() {
Expand Down
4 changes: 2 additions & 2 deletions tests/mir-opt/building/custom/consts.statics.built.after.mir
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ fn statics() -> () {
}

alloc2 (static: T, size: 4, align: 4) {
0a 00 00 00 │ ....
0a 0a 0a 0a │ ....
}

alloc1 (static: S, size: 4, align: 4) {
05 00 00 00 │ ....
05 05 05 05 │ ....
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
}

alloc1 (static: STATIC, size: 4, align: 4) {
2a 00 00 00*...
42 42 42 42BBBB
}

2 changes: 1 addition & 1 deletion tests/mir-opt/const_prop/mutable_variable_no_prop.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// unit-test
// compile-flags: -O

static mut STATIC: u32 = 42;
static mut STATIC: u32 = 0x42424242;

// EMIT_MIR mutable_variable_no_prop.main.ConstProp.diff
fn main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
_3 = _1; // scope 2 at $DIR/issue_75439.rs:+2:47: +2:52
_2 = transmute::<[u8; 16], [u32; 4]>(move _3) -> bb1; // scope 2 at $DIR/issue_75439.rs:+2:37: +2:53
// mir::Constant
// + span: $DIR/issue_75439.rs:7:37: 7:46
// + span: $DIR/issue_75439.rs:8:37: 8:46
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn([u8; 16]) -> [u32; 4] {transmute::<[u8; 16], [u32; 4]>}, val: Value(<ZST>) }
}

Expand All @@ -49,7 +49,7 @@
_6 = _4; // scope 4 at $DIR/issue_75439.rs:+5:33: +5:35
_5 = transmute::<u32, [u8; 4]>(move _6) -> bb7; // scope 4 at $DIR/issue_75439.rs:+5:23: +5:36
// mir::Constant
// + span: $DIR/issue_75439.rs:10:23: 10:32
// + span: $DIR/issue_75439.rs:11:23: 11:32
// + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u32) -> [u8; 4] {transmute::<u32, [u8; 4]>}, val: Value(<ZST>) }
}

Expand Down
1 change: 1 addition & 0 deletions tests/mir-opt/issues/issue_75439.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// EMIT_MIR issue_75439.foo.MatchBranchSimplification.diff
// ignore-endian-big

use std::mem::transmute;

Expand Down