Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/test/codegen/abi-main-signature-16bit-c-int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
// ignore-mips
// ignore-mips64
// ignore-powerpc
// ignore-powerpc64
// ignore-s390x
// ignore-sparc
// ignore-wasm32
Expand Down
2 changes: 2 additions & 0 deletions src/test/codegen/fastcall-inreg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
// ignore-mips
// ignore-mips64
// ignore-msp430
// ignore-powerpc64
// ignore-powerpc64le
// ignore-powerpc
// ignore-r600
// ignore-amdgcn
Expand Down
2 changes: 2 additions & 0 deletions src/test/codegen/global_asm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
// ignore-mips
// ignore-mips64
// ignore-msp430
// ignore-powerpc64
// ignore-powerpc64le
// ignore-powerpc
// ignore-r600
// ignore-amdgcn
Expand Down
2 changes: 2 additions & 0 deletions src/test/codegen/global_asm_include.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
// ignore-mips
// ignore-mips64
// ignore-msp430
// ignore-powerpc64
// ignore-powerpc64le
// ignore-powerpc
// ignore-r600
// ignore-amdgcn
Expand Down
2 changes: 2 additions & 0 deletions src/test/codegen/global_asm_x2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
// ignore-mips
// ignore-mips64
// ignore-msp430
// ignore-powerpc64
// ignore-powerpc64le
// ignore-powerpc
// ignore-r600
// ignore-amdgcn
Expand Down
1 change: 1 addition & 0 deletions src/test/codegen/repr-transparent-aggregates-1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// ignore-mips
// ignore-mips64
// ignore-powerpc
// ignore-powerpc64
// See repr-transparent.rs

#![crate_type="lib"]
Expand Down
33 changes: 26 additions & 7 deletions src/tools/compiletest/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,59 @@ use common::Config;
/// Conversion table from triple OS name to Rust SYSNAME
const OS_TABLE: &'static [(&'static str, &'static str)] = &[
("android", "android"),
("androideabi", "android"),
("bitrig", "bitrig"),
("cloudabi", "cloudabi"),
("darwin", "macos"),
("dragonfly", "dragonfly"),
("emscripten", "emscripten"),
("freebsd", "freebsd"),
("fuchsia", "fuchsia"),
("haiku", "haiku"),
("ios", "ios"),
("l4re", "l4re"),
("linux", "linux"),
("mingw32", "windows"),
("netbsd", "netbsd"),
("openbsd", "openbsd"),
("redox", "redox"),
("solaris", "solaris"),
("win32", "windows"),
("windows", "windows"),
("solaris", "solaris"),
("emscripten", "emscripten"),
];

const ARCH_TABLE: &'static [(&'static str, &'static str)] = &[
("aarch64", "aarch64"),
("amd64", "x86_64"),
("arm", "arm"),
("arm64", "aarch64"),
("armv4t", "arm"),
("armv5te", "arm"),
("armv7", "arm"),
("armv7s", "arm"),
("asmjs", "asmjs"),
("hexagon", "hexagon"),
("i386", "x86"),
("i586", "x86"),
("i686", "x86"),
("mips64", "mips64"),
("mips", "mips"),
("mips64", "mips64"),
("mips64el", "mips64"),
("mipsel", "mips"),
("msp430", "msp430"),
("powerpc", "powerpc"),
("powerpc64", "powerpc64"),
("powerpc64le", "powerpc64"),
("s390x", "s390x"),
("sparc", "sparc"),
("sparc64", "sparc64"),
("sparcv9", "sparc64"),
("thumbv6m", "thumb"),
("thumbv7em", "thumb"),
("thumbv7m", "thumb"),
("wasm32", "wasm32"),
("x86_64", "x86_64"),
("xcore", "xcore"),
("asmjs", "asmjs"),
("wasm32", "wasm32"),
];

pub fn matches_os(triple: &str, name: &str) -> bool {
Expand All @@ -58,16 +75,18 @@ pub fn matches_os(triple: &str, name: &str) -> bool {
if triple == "wasm32-unknown-unknown" {
return name == "emscripten" || name == "wasm32-bare"
}
let triple: Vec<_> = triple.split('-').collect();
for &(triple_os, os) in OS_TABLE {
if triple.contains(triple_os) {
if triple.contains(&triple_os) {
return os == name;
}
}
panic!("Cannot determine OS from triple");
}
pub fn get_arch(triple: &str) -> &'static str {
let triple: Vec<_> = triple.split('-').collect();
for &(triple_arch, arch) in ARCH_TABLE {
if triple.contains(triple_arch) {
if triple.contains(&triple_arch) {
return arch;
}
}
Expand Down