cranelift-filetests: tell when a run test is skipped (fixes #1558);

This commit is contained in:
Benjamin Bouvier
2020-06-18 12:21:19 +02:00
committed by Andrew Brown
parent f84903fa43
commit 4f6a002f70
3 changed files with 17 additions and 8 deletions

View File

@@ -36,6 +36,18 @@ impl SubTest for TestRun {
}
fn run(&self, func: Cow<ir::Function>, context: &Context) -> SubtestResult<()> {
// If this test requests to run on a completely different
// architecture than the host platform then we skip it entirely,
// since we won't be able to natively execute machine code.
let requested_arch = context.isa.unwrap().triple().architecture;
if requested_arch != Architecture::host() {
println!(
"skipped {}: host can't run {:?} programs",
context.file_path, requested_arch
);
return Ok(());
}
let mut compiler = SingleFunctionCompiler::with_host_isa(context.flags.clone());
for comment in context.details.comments.iter() {
if let Some(command) =
@@ -43,14 +55,6 @@ impl SubTest for TestRun {
{
trace!("Parsed run command: {}", command);
// If this test requests to run on a completely different
// architecture than the host platform then we skip it entirely,
// since we won't be able to natively execute machine code.
let requested_arch = context.isa.unwrap().triple().architecture;
if requested_arch != Architecture::host() {
return Ok(());
}
// Note that here we're also explicitly ignoring `context.isa`,
// regardless of what's requested. We want to use the native
// host ISA no matter what here, so the ISA listed in the file