(
testfile: &TestFile,
flags: &Flags,
isa: &dyn TargetIsa,
)
| 143 | } |
| 144 | |
| 145 | fn compile_testfile( |
| 146 | testfile: &TestFile, |
| 147 | flags: &Flags, |
| 148 | isa: &dyn TargetIsa, |
| 149 | ) -> anyhow::Result<CompiledTestFile> { |
| 150 | let isa = match isa.triple().architecture { |
| 151 | // Convert `&dyn TargetIsa` to `OwnedTargetIsa` by re-making the ISA and |
| 152 | // applying pulley flags/etc. |
| 153 | Architecture::Pulley32 |
| 154 | | Architecture::Pulley64 |
| 155 | | Architecture::Pulley32be |
| 156 | | Architecture::Pulley64be => { |
| 157 | let mut builder = cranelift_codegen::isa::lookup(isa.triple().clone())?; |
| 158 | for value in isa.isa_flags() { |
| 159 | builder.set(value.name, &value.value_string()).unwrap(); |
| 160 | } |
| 161 | builder.finish(flags.clone())? |
| 162 | } |
| 163 | |
| 164 | // We can't use the requested ISA directly since it does not contain info |
| 165 | // about the operating system / calling convention / etc.. |
| 166 | // |
| 167 | // Copy the requested ISA flags into the host ISA and use that. |
| 168 | _ => build_host_isa(false, flags.clone(), isa.isa_flags()).unwrap(), |
| 169 | }; |
| 170 | |
| 171 | let mut tfc = TestFileCompiler::new(isa); |
| 172 | tfc.add_testfile(testfile)?; |
| 173 | Ok(tfc.compile()?) |
| 174 | } |
| 175 | |
| 176 | fn run_test( |
| 177 | testfile: &CompiledTestFile, |
no test coverage detected