mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Str.startsWith, str.endsWith and friends
This commit is contained in:
parent
8df8c19ae2
commit
eb48f01f63
8 changed files with 98 additions and 54 deletions
|
@ -2436,7 +2436,7 @@ impl<
|
|||
let base_offset = storage_manager.claim_stack_area(&dst, 24);
|
||||
|
||||
ASM::mov_reg64_mem64_offset32(buf, tmp_reg, ptr_reg, 0);
|
||||
ASM::mov_base32_reg64(buf, base_offset + 0, tmp_reg);
|
||||
ASM::mov_base32_reg64(buf, base_offset, tmp_reg);
|
||||
|
||||
ASM::mov_reg64_mem64_offset32(buf, tmp_reg, ptr_reg, 8);
|
||||
ASM::mov_base32_reg64(buf, base_offset + 8, tmp_reg);
|
||||
|
|
|
@ -557,7 +557,6 @@ impl CallConv<X86_64GeneralReg, X86_64FloatReg, X86_64Assembler> for X86_64Syste
|
|||
// This should have been recieved via an arg pointer.
|
||||
// That means the value is already loaded onto the stack area we allocated before the call.
|
||||
// Nothing to do.
|
||||
dbg!(sym);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -791,6 +791,34 @@ trait Backend<'a> {
|
|||
arg_layouts,
|
||||
ret_layout,
|
||||
),
|
||||
LowLevel::StrStartsWith => self.build_fn_call(
|
||||
sym,
|
||||
bitcode::STR_STARTS_WITH.to_string(),
|
||||
args,
|
||||
arg_layouts,
|
||||
ret_layout,
|
||||
),
|
||||
LowLevel::StrStartsWithScalar => self.build_fn_call(
|
||||
sym,
|
||||
bitcode::STR_STARTS_WITH_SCALAR.to_string(),
|
||||
args,
|
||||
arg_layouts,
|
||||
ret_layout,
|
||||
),
|
||||
LowLevel::StrEndsWith => self.build_fn_call(
|
||||
sym,
|
||||
bitcode::STR_ENDS_WITH.to_string(),
|
||||
args,
|
||||
arg_layouts,
|
||||
ret_layout,
|
||||
),
|
||||
LowLevel::StrCountGraphemes => self.build_fn_call(
|
||||
sym,
|
||||
bitcode::STR_COUNT_GRAPEHEME_CLUSTERS.to_string(),
|
||||
args,
|
||||
arg_layouts,
|
||||
ret_layout,
|
||||
),
|
||||
LowLevel::PtrCast => {
|
||||
debug_assert_eq!(
|
||||
1,
|
||||
|
|
|
@ -18,12 +18,16 @@ macro_rules! run_jit_function_raw {
|
|||
|
||||
let result = main();
|
||||
|
||||
assert_eq!(
|
||||
$errors,
|
||||
std::vec::Vec::new(),
|
||||
"Encountered errors: {:?}",
|
||||
$errors
|
||||
);
|
||||
if !$errors.is_empty() {
|
||||
dbg!(&$errors);
|
||||
|
||||
assert_eq!(
|
||||
$errors,
|
||||
std::vec::Vec::new(),
|
||||
"Encountered errors: {:?}",
|
||||
$errors
|
||||
);
|
||||
}
|
||||
|
||||
$transform(result)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue