Skip to content

Commit aa458ff

Browse files
authored
Rollup merge of rust-lang#147925 - fneddy:fix_big_endian_GVN_tests, r=saethlin
Fix tests for big-endian The tests fail on s390x and presumably other big-endian systems, due to check of raw alloc values in the MIR output. To fix the tests remove the raw bytes from the MIR output (via: compile-flags: -Zdump-mir-exclude-alloc-bytes) and update the matching diffs.
2 parents c33d51b + cbae956 commit aa458ff

File tree

6 files changed

+11
-20
lines changed

6 files changed

+11
-20
lines changed

tests/mir-opt/const_prop/invalid_constant.main.GVN.diff

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,11 @@
6161
StorageDead(_1);
6262
return;
6363
}
64-
+ }
64+
}
6565
+
66-
+ ALLOC0 (size: 4, align: 4) {
67-
+ 00 00 00 00 │ ....
68-
+ }
66+
+ ALLOC0 (size: 4, align: 4) { .. }
6967
+
70-
+ ALLOC1 (size: 4, align: 4) {
71-
+ 04 00 00 00 │ ....
72-
+ }
68+
+ ALLOC1 (size: 4, align: 4) { .. }
7369
+
74-
+ ALLOC2 (size: 4, align: 4) {
75-
+ 01 00 11 00 │ ....
76-
}
70+
+ ALLOC2 (size: 4, align: 4) { .. }
7771

tests/mir-opt/const_prop/invalid_constant.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// skip-filecheck
22
//@ test-mir-pass: GVN
3-
//@ compile-flags: -Zmir-enable-passes=+RemoveZsts
3+
//@ compile-flags: -Zmir-enable-passes=+RemoveZsts -Zdump-mir-exclude-alloc-bytes
44
// Verify that we can pretty print invalid constants.
55

66
#![feature(adt_const_params, unsized_const_params)]

tests/mir-opt/const_prop/union.main.GVN.diff

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@
3434
StorageDead(_1);
3535
return;
3636
}
37-
+ }
38-
+
39-
+ ALLOC0 (size: 4, align: 4) {
40-
+ 01 00 00 00 │ ....
4137
}
38+
+
39+
+ ALLOC0 (size: 4, align: 4) { .. }
4240

tests/mir-opt/const_prop/union.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Tests that we can propagate into places that are projections into unions
22
//@ test-mir-pass: GVN
3-
//@ compile-flags: -Zinline-mir
3+
//@ compile-flags: -Zinline-mir -Zdump-mir-exclude-alloc-bytes
44

55
fn val() -> u32 {
66
1

tests/mir-opt/gvn_loop.loop_deref_mut.GVN.diff

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@
107107
StorageDead(_11);
108108
goto -> bb4;
109109
}
110-
+ }
111-
+
112-
+ ALLOC0 (size: 8, align: 4) {
113-
+ 01 00 00 00 __ __ __ __ │ ....░░░░
114110
}
111+
+
112+
+ ALLOC0 (size: 8, align: 4) { .. }
115113

tests/mir-opt/gvn_loop.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//@ test-mir-pass: GVN
2+
//@ compile-flags: -Zdump-mir-exclude-alloc-bytes
23

34
#![crate_type = "lib"]
45
#![feature(core_intrinsics, rustc_attrs)]

0 commit comments

Comments
 (0)