mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
additional 32-bit string layout tests
This commit is contained in:
parent
05a7d76a5e
commit
60b7f2cf94
1 changed files with 32 additions and 0 deletions
|
@ -1769,3 +1769,35 @@ fn str_walk_scalars() {
|
||||||
RocList<char>
|
RocList<char>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(any(feature = "gen-llvm-wasm"))]
|
||||||
|
fn llvm_wasm_str_layout() {
|
||||||
|
assert_evals_to!(
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
"hello"
|
||||||
|
|> Str.reserve 42
|
||||||
|
"#
|
||||||
|
),
|
||||||
|
[0, 5, 42],
|
||||||
|
[u32; 3],
|
||||||
|
|[_ptr, len, cap]: [u32; 3]| [0, len, cap]
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[cfg(any(feature = "gen-llvm-wasm"))]
|
||||||
|
fn llvm_wasm_str_layout_small() {
|
||||||
|
// exposed an error in using bitcast instead of zextend
|
||||||
|
assert_evals_to!(
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
"𒀀𒀁"
|
||||||
|
|> Str.trim
|
||||||
|
"#
|
||||||
|
),
|
||||||
|
[-2139057424, -2122280208, -2013265920],
|
||||||
|
[i32; 3]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue