Skip to content

Commit

Permalink
fix: features
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed Apr 7, 2024
1 parent 82d98c9 commit ce80614
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
3 changes: 1 addition & 2 deletions crates/revm-jit-context/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ revm-primitives = { workspace = true, default-features = false }

[features]
default = ["std"]
alloc = []
std = ["alloc", "revm-interpreter/std", "revm-primitives/std"]
std = ["revm-interpreter/std", "revm-primitives/std"]
host-ext-any = []
4 changes: 2 additions & 2 deletions crates/revm-jit-context/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
#![cfg_attr(not(feature = "std"), no_std)]

#[cfg(all(feature = "alloc", not(feature = "std")))]
#[cfg(not(feature = "std"))]
extern crate alloc;

use core::{fmt, mem::MaybeUninit, ptr};
Expand All @@ -13,7 +13,7 @@ use revm_interpreter::{
};
use revm_primitives::{Address, Bytes, Env, U256};

#[cfg(all(feature = "alloc", not(feature = "std")))]
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;

#[cfg(feature = "host-ext-any")]
Expand Down
5 changes: 4 additions & 1 deletion crates/revm-jit/src/tests/fibonacci.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use super::*;
use super::{with_evm_context, DEF_SPEC};
use crate::{Backend, JitEvm};
use revm_interpreter::{opcode as op, InstructionResult};
use revm_primitives::U256;

macro_rules! fibonacci_tests {
($($i:expr),* $(,)?) => {paste::paste! {
Expand Down
8 changes: 4 additions & 4 deletions crates/revm-jit/src/tests/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ macro_rules! matrix_tests {
mod llvm {
use super::*;

fn run_llvm(jit: &mut JitEvm<JitEvmLlvmBackend<'_>>) {
set_test_dump(jit, module_path!());
fn run_llvm(jit: &mut JitEvm<crate::llvm::JitEvmLlvmBackend<'_>>) {
crate::tests::set_test_dump(jit, module_path!());
$run(jit);
}

#[test]
fn unopt() {
with_llvm_backend_jit(OptimizationLevel::None, run_llvm);
crate::tests::with_llvm_backend_jit(crate::OptimizationLevel::None, run_llvm);
}

#[test]
fn opt() {
with_llvm_backend_jit(OptimizationLevel::Aggressive, run_llvm);
crate::tests::with_llvm_backend_jit(crate::OptimizationLevel::Aggressive, run_llvm);
}
}
};
Expand Down
5 changes: 4 additions & 1 deletion crates/revm-jit/src/tests/resume.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use super::*;
use super::{with_evm_context, DEF_SPEC};
use crate::{Backend, JitEvm, TEST_SUSPEND};
use revm_interpreter::{opcode as op, InstructionResult};
use revm_primitives::U256;

matrix_tests!(run_resume_tests);

Expand Down

0 comments on commit ce80614

Please sign in to comment.