test for codesizes

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
Cyrill Leutwiler
2024-04-25 17:39:49 +02:00
parent 34c233207e
commit 45d53f2ee4
5 changed files with 66 additions and 1 deletions
@@ -29,6 +29,12 @@ impl TargetMachine {
/// The LLVM target triple.
pub const VM_TARGET_TRIPLE: &'static str = "riscv32-unknown-unknown-elf";
/// LLVM target features.
#[cfg(feature = "riscv-zbb")]
pub const VM_FEATURES: &'static str = "+zbb,+e,+m";
#[cfg(not(feature = "riscv-zbb"))]
pub const VM_FEATURES: &'static str = "+e,+m";
///
/// A shortcut constructor.
///
@@ -40,7 +46,7 @@ impl TargetMachine {
.create_target_machine(
&inkwell::targets::TargetTriple::create(target.triple()),
"generic-rv32",
"+e,+m",
Self::VM_FEATURES,
optimizer_settings.level_back_end,
inkwell::targets::RelocMode::PIC,
inkwell::targets::CodeModel::Default,