+// ignore-endian-big
extern "C" {
static X: i32;
}
-
static Y: i32 = 42;
// EMIT_MIR rustc.BAR.PromoteTemps.diff
+// ignore-endian-big
// EMIT_MIR_FOR_EACH_BIT_WIDTH
-
static FOO: &[(Option<i32>, &[&str])] =
&[(None, &[]), (None, &["foo", "bar"]), (Some(42), &["meh", "mop", "möp"])];
+// ignore-endian-big
// EMIT_MIR_FOR_EACH_BIT_WIDTH
-
// EMIT_MIR rustc.main.ConstProp.after.mir
fn main() {
FOO;
+// ignore-endian-big
// EMIT_MIR_FOR_EACH_BIT_WIDTH
-
// EMIT_MIR rustc.main.ConstProp.after.mir
fn main() {
FOO;
+// 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();
#![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.
#![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.
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",
("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
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 }
}