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

since 1.44 some mir-opt tests assume little-endian #74829

Closed
infinity0 opened this issue Jul 27, 2020 · 4 comments · Fixed by #75238
Closed

since 1.44 some mir-opt tests assume little-endian #74829

infinity0 opened this issue Jul 27, 2020 · 4 comments · Fixed by #75238
Labels
A-mir-opt Area: MIR optimizations A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug.

Comments

@infinity0
Copy link
Contributor

e.g. https://buildd.debian.org/status/fetch.php?pkg=rustc&arch=ppc64&ver=1.44.1%2Bdfsg1-1&stamp=1595858223&raw=0

---- [mir-opt] mir-opt/const-promotion-extern-static.rs stdout ----


executing "/<<PKGBUILDDIR>>/build/powerpc64-unknown-linux-gnu/stage2/bin/rustc" "/<<PKGBUILDDIR>>/src/test/mir-opt/const-promotion-extern-static.rs" "-Zthreads=1" "--target=powerpc64-unknown-linux-gnu" "-Zdump-mir=all" "-Zmir-opt-level=3" "-Zdump-mir-exclude-pass-number" "-Zdump-mir-dir=/<<PKGBUILDDIR>>/build/powerpc64-unknown-linux-gnu/test/mir-opt/const-promotion-extern-static" "-C" "prefer-dynamic" "--out-dir" "/<<PKGBUILDDIR>>/build/powerpc64-unknown-linux-gnu/test/mir-opt/const-promotion-extern-static" "-Crpath" "-O" "-Cdebuginfo=0" "-Zunstable-options" "-Lnative=/<<PKGBUILDDIR>>/build/powerpc64-unknown-linux-gnu/native/rust-test-helpers" "-Clinker=powerpc64-linux-gnu-gcc" "-L" "/<<PKGBUILDDIR>>/build/powerpc64-unknown-linux-gnu/test/mir-opt/const-promotion-extern-static/auxiliary"
------stdout------------------------------

------stderr------------------------------
[ .. some warnings .. ]


------------------------------------------
57	- }
58	- 
59	- alloc0 (static: Y, size: 4, align: 4) {
-	-     2a 00 00 00                                     │ *...
+	-     00 00 00 2a                                     │ ...*
61	  }
62	  
63	

thread '[mir-opt] mir-opt/const-promotion-extern-static.rs' panicked at 'Actual MIR output differs from expected MIR output /<<PKGBUILDDIR>>/src/test/mir-opt/const-promotion-extern-static/rustc.BAR.PromoteTemps.diff', src/tools/compiletest/src/runtest.rs:3165:25
stack backtrace:
   0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   1: core::fmt::write
   2: std::io::Write::write_fmt
   3: std::io::impls::<impl std::io::Write for alloc::boxed::Box<W>>::write_fmt
   4: std::panicking::default_hook::{{closure}}
   5: std::panicking::default_hook
   6: std::panicking::rust_panic_with_hook
   7: rust_begin_unwind
   8: std::panicking::begin_panic_fmt
   9: compiletest::runtest::TestCx::run_revision
  10: compiletest::runtest::run
  11: core::ops::function::FnOnce::call_once{{vtable.shim}}
  12: <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
test [mir-opt] mir-opt/const-promotion-extern-static.rs ... FAILED
test [mir-opt] mir-opt/const_allocation.rs ... FAILED
test [mir-opt] mir-opt/const_allocation2.rs ... FAILED
test [mir-opt] mir-opt/const_allocation3.rs ... FAILED
test [mir-opt] mir-opt/inline/inline-into-box-place.rs ... FAILED
@infinity0 infinity0 added the C-bug Category: This is a bug. label Jul 27, 2020
@infinity0
Copy link
Contributor Author

CC @oli-obk Seems you wrote the tests originally

@oli-obk oli-obk added A-mir-opt Area: MIR optimizations A-testsuite Area: The testsuite used to check the correctness of rustc labels Jul 27, 2020
@oli-obk
Copy link
Contributor

oli-obk commented Jul 27, 2020

The easiest way would be to ignore these tests on big-endian (and we should probably have a big-endian CI if we actually want to keep the test suite working on big-endian).

@infinity0
Copy link
Contributor Author

Looks like src/test/ui/simd/simd-intrinsic-generic-select.rs has an endian test that hardcodes some specific architectures (omitting s390x) however it would be easier maintenance in the long run to add a ignore-big-endian pragma. How would I do that?

@oli-obk
Copy link
Contributor

oli-obk commented Jul 27, 2020

I think you'd do something like

name == util::get_pointer_width(&self.target) || // pointer width
but I don't know how to obtain the endianess. I guess you'd have to create a table/match that hardcodes which architectures are big-endian?

JohnTitor added a commit to JohnTitor/rust that referenced this issue Aug 6, 2020
…matsakis

compiletest: ignore-endian-big, fixes rust-lang#74829, fixes rust-lang#74885

See discussion on rust-lang#74829

I tested it on a Debian s390x machine, works well.
JohnTitor added a commit to JohnTitor/rust that referenced this issue Aug 6, 2020
…matsakis

compiletest: ignore-endian-big, fixes rust-lang#74829, fixes rust-lang#74885

See discussion on rust-lang#74829

I tested it on a Debian s390x machine, works well.
JohnTitor added a commit to JohnTitor/rust that referenced this issue Aug 7, 2020
…matsakis

compiletest: ignore-endian-big, fixes rust-lang#74829, fixes rust-lang#74885

See discussion on rust-lang#74829

I tested it on a Debian s390x machine, works well.
bors added a commit to rust-lang-ci/rust that referenced this issue Aug 7, 2020
Rollup of 12 pull requests

Successful merges:

 - rust-lang#74888 (compiletest: ignore-endian-big, fixes rust-lang#74829, fixes rust-lang#74885)
 - rust-lang#75175 (Make doctests of Ipv4Addr::from(u32) easier to read)
 - rust-lang#75179 (Remove unused FromInner impl for Ipv4Addr)
 - rust-lang#75181 (Fix typo in  `librustc_feature/active.rs`)
 - rust-lang#75183 (Label rustfmt toolstate issues with A-rustfmt)
 - rust-lang#75188 (Handle fieldless tuple structs in diagnostic code)
 - rust-lang#75190 (Clean up E0746 explanation)
 - rust-lang#75210 (Change the type of `AssertModuleSource::available_cgus`.)
 - rust-lang#75211 (Note about endianness of returned value of {integer}::from_be_bytes and friends)
 - rust-lang#75217 (Clean up E0747 explanation)
 - rust-lang#75232 (Fix typo "TraitObligatiom" -> "TraitObligation")
 - rust-lang#75236 (Fix typo "biset" -> "bitset")

Failed merges:

r? @ghost
@bors bors closed this as completed in 7f54cf2 Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-mir-opt Area: MIR optimizations A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug.
Projects
None yet
2 participants