diff --git a/cranelift/filetests/filetests/runtests/bextend.clif b/cranelift/filetests/filetests/runtests/bextend.clif index 9f78fd9d2b..24dc929978 100644 --- a/cranelift/filetests/filetests/runtests/bextend.clif +++ b/cranelift/filetests/filetests/runtests/bextend.clif @@ -1,4 +1,8 @@ test interpret +test run +target aarch64 +target x86_64 +target s390x function %bextend_b1_b8(b1) -> b8 { block0(v0: b1): diff --git a/cranelift/filetests/filetests/runtests/breduce.clif b/cranelift/filetests/filetests/runtests/breduce.clif index e436b3f800..c9de6222ec 100644 --- a/cranelift/filetests/filetests/runtests/breduce.clif +++ b/cranelift/filetests/filetests/runtests/breduce.clif @@ -1,4 +1,8 @@ test interpret +test run +target aarch64 +target x86_64 +target s390x function %breduce_b8_b1(b8) -> b1 { block0(v0: b8): diff --git a/cranelift/filetests/src/function_runner.rs b/cranelift/filetests/src/function_runner.rs index 59b38a9aeb..5400711603 100644 --- a/cranelift/filetests/src/function_runner.rs +++ b/cranelift/filetests/src/function_runner.rs @@ -308,7 +308,14 @@ fn make_trampoline(signature: &ir::Signature, isa: &dyn TargetIsa) -> Function { // that we are using the architecture's canonical boolean representation (presumably // comparison will emit this). if param.value_type.is_bool() { - builder.ins().icmp_imm(IntCC::NotEqual, loaded, 0) + let b = builder.ins().icmp_imm(IntCC::NotEqual, loaded, 0); + + // icmp_imm always produces a `b1`, `bextend` it if we need a larger bool + if param.value_type.bits() > 1 { + builder.ins().bextend(param.value_type, b) + } else { + b + } } else if param.value_type.is_bool_vector() { let zero_constant = builder.func.dfg.constants.insert(vec![0; 16].into()); let zero_vec = builder.ins().vconst(ty, zero_constant);