compiletest/runtest/
codegen.rs

1use super::{PassMode, TestCx};
2
3impl TestCx<'_> {
4    pub(super) fn run_codegen_test(&self) {
5        if self.config.llvm_filecheck.is_none() {
6            self.fatal("missing --llvm-filecheck");
7        }
8
9        let (proc_res, output_path) = self.compile_test_and_save_ir();
10        if !proc_res.status.success() {
11            self.fatal_proc_rec("compilation failed!", &proc_res);
12        }
13
14        if let Some(PassMode::Build) = self.pass_mode() {
15            return;
16        }
17        let proc_res = self.verify_with_filecheck(&output_path);
18        if !proc_res.status.success() {
19            self.fatal_proc_rec("verification with 'FileCheck' failed", &proc_res);
20        }
21    }
22}