-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Ignore mir tests on big-endian #77413
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
3b102ac
to
a311e14
Compare
+ // ty::Const | ||
+ // + ty: (u32, u32) | ||
+ // + val: Value(ByRef { alloc: Allocation { bytes: [1, 0, 0, 0, 2, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) | ||
+ // mir::Constant | ||
+ // + span: $DIR/tuple_literal_propagation.rs:5:13: 5:14 | ||
+ // + span: $DIR/tuple_literal_propagation.rs:6:13: 6:14 | ||
+ // + literal: Const { ty: (u32, u32), val: Value(ByRef { alloc: Allocation { bytes: [1, 0, 0, 0, 2, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be a "significant" diff -- i.e., not just line numbers changing. Maybe a bug in how github is showing it or a rebase error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just line numbers changing AFAICT. Diffs of diffs are hard to parse for me also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things like these can be avoided by adding new comment lines in existing empty lines or just adding them at the end of the file. We have no policy on this though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes this is just line numbers changing - the existing file didn't have an empty line to fit a comment into, and I thought putting it at the end of the file would be inconsistent with everything else.
I assume these are failing on big endian platforms? I think the const allocation ones are ignored because the output contains printed allocations (e.g.,
But the tests here, aside from the one comment I left, don't seem to contain such allocations. I am a bit worried that we could accidentally mask some real difference in const prop or whatever on big endian systems. If we expect to just ignore all of the MIR tests then maybe doing that in compiletest makes more sense. cc @oli-obk @ecstatic-morse (not sure who all to cc on const prop/MIR, would be good to get a team) |
cc @rust-lang/wg-mir-opt |
@infinity0 It's helpful to reviewers to give some motivation for a PR. I assume you're running on a big-endian system and that these tests are failing due to blessed MIR like:
Do we not have any big-endian systems on CI? Normally I would request that we normalize MIR dumps across different systems, but this is a) kind of hard and b) not the precedent (as you note in the OP). I defer to Oli on this one. r? @oli-obk |
@@ -1,3 +1,4 @@ | |||
// ignore-endian-big |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of ignoring this test we should add tuples and arrays to the "don't verbosely print the constant" list if all tuple fields or the array element type are on the "don't verbosely print constants of this type" list.
@@ -1,5 +1,5 @@ | |||
// compile-flags: -O | |||
|
|||
// ignore-endian-big |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is odd, so I think it's ok to ignore here
So imo only |
Shall I file an issue for this then? I'm not sufficiently involved with MIR to make this change myself. In the meantime do you want to keep the tests failing? |
Oh, this is not related to MIR, just pretty printing. All you have to do is to pull out rust/compiler/rustc_mir/src/util/pretty.rs Lines 432 to 436 in 5ded394
true if the verbose printing should be used and then make it recurse on ty::Tuple and ty::Array elements
The only gotcha is that you need to rerun tests separately for 64bit and 32bit via |
@infinity0 Ping from triage! Any updates on this? |
@infinity0 Pinging again from triage! Any updates on this? |
Sorry, I don't have the time to do the alternative. But the underlying problem exists and should be fixed. |
I'll open an issue and see if someone picks it up. Thanks for bringing up the issue! |
Other mir tests are already ignored on big-endian, e.g. const_allocation*.rs