Check for asm support in UI tests that require it
Add `needs-asm-support` compiletest directive, and use it in asm tests that require asm support without relying on any architecture specific features.
This commit is contained in:
parent
58f32da346
commit
da40e69b60
8 changed files with 32 additions and 5 deletions
|
|
@ -44,6 +44,7 @@ impl EarlyProps {
|
|||
let mut props = EarlyProps::default();
|
||||
let rustc_has_profiler_support = env::var_os("RUSTC_PROFILER_SUPPORT").is_some();
|
||||
let rustc_has_sanitizer_support = env::var_os("RUSTC_SANITIZER_SUPPORT").is_some();
|
||||
let has_asm_support = util::has_asm_support(&config.target);
|
||||
let has_asan = util::ASAN_SUPPORTED_TARGETS.contains(&&*config.target);
|
||||
let has_lsan = util::LSAN_SUPPORTED_TARGETS.contains(&&*config.target);
|
||||
let has_msan = util::MSAN_SUPPORTED_TARGETS.contains(&&*config.target);
|
||||
|
|
@ -76,6 +77,10 @@ impl EarlyProps {
|
|||
props.ignore = true;
|
||||
}
|
||||
|
||||
if !has_asm_support && config.parse_name_directive(ln, "needs-asm-support") {
|
||||
props.ignore = true;
|
||||
}
|
||||
|
||||
if !rustc_has_profiler_support && config.parse_needs_profiler_support(ln) {
|
||||
props.ignore = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,6 +223,17 @@ fn sanitizers() {
|
|||
assert!(parse_rs(&config, "// needs-sanitizer-thread").ignore);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn asm_support() {
|
||||
let mut config = config();
|
||||
|
||||
config.target = "avr-unknown-gnu-atmega328".to_owned();
|
||||
assert!(parse_rs(&config, "// needs-asm-support").ignore);
|
||||
|
||||
config.target = "i686-unknown-netbsd".to_owned();
|
||||
assert!(!parse_rs(&config, "// needs-asm-support").ignore);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_extract_version_range() {
|
||||
use super::{extract_llvm_version, extract_version_range};
|
||||
|
|
|
|||
|
|
@ -128,6 +128,15 @@ const BIG_ENDIAN: &[&str] = &[
|
|||
"sparcv9",
|
||||
];
|
||||
|
||||
static ASM_SUPPORTED_ARCHS: &[&str] = &[
|
||||
"x86", "x86_64", "arm", "aarch64", "riscv32", "riscv64", "nvptx64", "hexagon", "mips",
|
||||
"mips64", "spirv", "wasm32",
|
||||
];
|
||||
|
||||
pub fn has_asm_support(triple: &str) -> bool {
|
||||
ASM_SUPPORTED_ARCHS.contains(&get_arch(triple))
|
||||
}
|
||||
|
||||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue