u-ignore-endian
authorDebian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net>
Thu, 6 Aug 2020 20:11:39 +0000 (21:11 +0100)
committerXimin Luo <infinity0@debian.org>
Thu, 6 Aug 2020 20:11:39 +0000 (21:11 +0100)
Gbp-Pq: Name u-ignore-endian.patch

src/test/mir-opt/const-promotion-extern-static.rs
src/test/mir-opt/const_allocation.rs
src/test/mir-opt/const_allocation2.rs
src/test/mir-opt/const_allocation3.rs
src/test/mir-opt/inline/inline-into-box-place.rs
src/test/ui/simd/simd-intrinsic-generic-bitmask.rs
src/test/ui/simd/simd-intrinsic-generic-select.rs
src/tools/compiletest/src/header.rs
src/tools/compiletest/src/util.rs

index c9d350a98fd9c80aca4b4696f2283922bcf3440f..0073635a328057e833a2ee2678ff46147dfeec0f 100644 (file)
@@ -1,7 +1,7 @@
+// ignore-endian-big
 extern "C" {
     static X: i32;
 }
-
 static Y: i32 = 42;
 
 // EMIT_MIR rustc.BAR.PromoteTemps.diff
index aaf996ee8e1a718d0913ad9ceb7df98dad2238a7..4bd485277c4e15252dc1eb23ce07277946db8189 100644 (file)
@@ -1,5 +1,5 @@
+// ignore-endian-big
 // EMIT_MIR_FOR_EACH_BIT_WIDTH
-
 static FOO: &[(Option<i32>, &[&str])] =
     &[(None, &[]), (None, &["foo", "bar"]), (Some(42), &["meh", "mop", "möp"])];
 
index ca61b84c0bcad72dce601cb7e2c657a1d1d0c770..4ffffad07f5e127357676d2939004dfa803ceb09 100644 (file)
@@ -1,5 +1,5 @@
+// ignore-endian-big
 // EMIT_MIR_FOR_EACH_BIT_WIDTH
-
 // EMIT_MIR rustc.main.ConstProp.after.mir
 fn main() {
     FOO;
index 73bb58e1a9892a6a1ff5f6dd4be0c6cc5be107c6..d4a8d2a5d7abf4ebafa7eb6dd2d30e1066380863 100644 (file)
@@ -1,5 +1,5 @@
+// ignore-endian-big
 // EMIT_MIR_FOR_EACH_BIT_WIDTH
-
 // EMIT_MIR rustc.main.ConstProp.after.mir
 fn main() {
     FOO;
index 77834e9661cecbf9376cea862b84921539d07d85..f54c8ffe2336b0ba81ba6aab276d794c5f5c9371 100644 (file)
@@ -1,8 +1,8 @@
+// ignore-endian-big
 // ignore-wasm32-bare compiled with panic=abort by default
 // compile-flags: -Z mir-opt-level=3
 // EMIT_MIR_FOR_EACH_BIT_WIDTH
 #![feature(box_syntax)]
-
 // EMIT_MIR rustc.main.Inline.diff
 fn main() {
     let _x: Box<Vec<u32>> = box Vec::new();
index b28f742a92e94a99159e66a2bea8b5f5899510d7..ae41a9005c64dee052806d92d11b91ad18dd2d34 100644 (file)
@@ -2,6 +2,7 @@
 #![allow(non_camel_case_types)]
 
 // ignore-emscripten
+// ignore-endian-big behavior of simd_bitmask is endian-specific
 
 // Test that the simd_bitmask intrinsic produces correct results.
 
index 22bda4fc9d9194e911c95df19927529f3e3a0808..dc9ec5d2760fe02e2e32d0c6e69556b5f004ec7a 100644 (file)
@@ -2,10 +2,7 @@
 #![allow(non_camel_case_types)]
 
 // ignore-emscripten
-// ignore-mips       behavior of simd_select_bitmask is endian-specific
-// ignore-mips64     behavior of simd_select_bitmask is endian-specific
-// ignore-powerpc    behavior of simd_select_bitmask is endian-specific
-// ignore-powerpc64  behavior of simd_select_bitmask is endian-specific
+// ignore-endian-big behavior of simd_select_bitmask is endian-specific
 
 // Test that the simd_select intrinsics produces correct results.
 
index cb648db8830ef3fbd06bfd5081d161dcca7a05db..14b40c6aca86b18d20deaf7c3040250f53e04f65 100644 (file)
@@ -853,6 +853,7 @@ impl Config {
             name == util::get_pointer_width(&self.target) ||    // pointer width
             name == self.stage_id.split('-').next().unwrap() || // stage
             (self.target != self.host && name == "cross-compile") ||
+            (name == "endian-big" && util::is_big_endian(&self.target)) ||
             match self.compare_mode {
                 Some(CompareMode::Nll) => name == "compare-mode-nll",
                 Some(CompareMode::Polonius) => name == "compare-mode-polonius",
index c61bee0f8d9eacf67b12cfc1a204fd5f7e33c66c..1b96c1e4e93de6da7b0a7519a7f98dcba809c782 100644 (file)
@@ -81,6 +81,20 @@ const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[
     ("xcore", "xcore"),
 ];
 
+const BIG_ENDIAN: &'static [&'static str] = &[
+    "armebv7r",
+    "mips",
+    "mips64",
+    "mipsisa32r6",
+    "mipsisa64r6",
+    "powerpc",
+    "powerpc64",
+    "s390x",
+    "sparc",
+    "sparc64",
+    "sparcv9",
+];
+
 pub fn matches_os(triple: &str, name: &str) -> bool {
     // For the wasm32 bare target we ignore anything also ignored on emscripten
     // and then we also recognize `wasm32-bare` as the os for the target
@@ -107,6 +121,12 @@ pub fn get_arch(triple: &str) -> &'static str {
     panic!("Cannot determine Architecture from triple");
 }
 
+/// Determine the endianness from `triple`
+pub fn is_big_endian(triple: &str) -> bool {
+    let triple_arch = triple.split('-').next().unwrap();
+    BIG_ENDIAN.contains(&triple_arch)
+}
+
 pub fn matches_env(triple: &str, name: &str) -> bool {
     if let Some(env) = triple.split('-').nth(3) { env.starts_with(name) } else { false }
 }