This commit is contained in:
Richard Feldman 2024-10-18 22:32:41 -04:00
parent e947cd78b9
commit 98535bfbce
No known key found for this signature in database
GPG key ID: 5DE4EE30BB738EDF
28 changed files with 6508 additions and 337 deletions

View file

@ -537,6 +537,7 @@ pub fn try_run_lib_function<T>(
}
// only used in tests
#[allow(dead_code)]
pub(crate) fn llvm_evals_to<T, U, F>(
src: &str,
expected: U,
@ -585,6 +586,7 @@ pub(crate) fn llvm_evals_to<T, U, F>(
}
}
#[allow(unused_macros)]
macro_rules! assert_llvm_evals_to {
($src:expr, $expected:expr, $ty:ty, $transform:expr, $ignore_problems:expr) => {
crate::helpers::llvm::llvm_evals_to::<$ty, _, _>(
@ -649,6 +651,7 @@ macro_rules! assert_evals_to {
}};
}
#[allow(unused_macros)]
macro_rules! assert_evals_to_erased {
($src:expr, $expected:expr, $ty:ty) => {{
crate::helpers::llvm::llvm_evals_to::<$ty, _, _>(
@ -661,12 +664,16 @@ macro_rules! assert_evals_to_erased {
}};
}
#[allow(dead_code)]
pub fn identity<T>(value: T) -> T {
value
}
#[allow(unused_imports)]
pub(crate) use assert_evals_to;
#[allow(unused_imports)]
pub(crate) use assert_evals_to_erased;
#[allow(unused_imports)]
pub(crate) use assert_llvm_evals_to;
#[cfg(feature = "gen-llvm-wasm")]
pub(crate) use assert_wasm_evals_to;