mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
add a test for extracting symbols from a dynhost
This commit is contained in:
parent
c4d25e0180
commit
0238471241
1 changed files with 35 additions and 0 deletions
|
@ -2869,3 +2869,38 @@ fn load_structs_inplace_mut<T>(bytes: &mut [u8], offset: usize, count: usize) ->
|
|||
assert!(tail.is_empty(), "End of data was not aligned");
|
||||
body
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn collect_symbols() {
|
||||
let data: &[u8] = include_bytes!("../dynhost_benchmarks_elf64") as &[_];
|
||||
|
||||
let object = object::File::parse(data).unwrap();
|
||||
|
||||
let symbols = collect_roc_definitions(&object);
|
||||
|
||||
let mut keys = symbols.keys().collect::<Vec<_>>();
|
||||
keys.sort_unstable();
|
||||
|
||||
assert_eq!(
|
||||
[
|
||||
"memcpy",
|
||||
"memset",
|
||||
"roc_alloc",
|
||||
"roc_dealloc",
|
||||
"roc_fx_getInt",
|
||||
"roc_fx_getInt_help",
|
||||
"roc_fx_putInt",
|
||||
"roc_fx_putLine",
|
||||
"roc_memcpy",
|
||||
"roc_memset",
|
||||
"roc_panic",
|
||||
"roc_realloc"
|
||||
],
|
||||
keys.as_slice(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue