mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 08:11:12 +00:00
Restore some more things to how they were before
This commit is contained in:
parent
0951f8048e
commit
2491b2e43b
2 changed files with 16 additions and 3 deletions
|
@ -1083,7 +1083,7 @@ fn list_set<'a, B: Backend>(
|
||||||
// to avoid misprediction. (In practice this should usually pass,
|
// to avoid misprediction. (In practice this should usually pass,
|
||||||
// and CPUs generally default to predicting that a forward jump
|
// and CPUs generally default to predicting that a forward jump
|
||||||
// shouldn't be taken; that is, they predict "else" won't be taken.)
|
// shouldn't be taken; that is, they predict "else" won't be taken.)
|
||||||
builder.ins().icmp(IntCC::UnsignedLessThan, list_len, elem_index);
|
builder.ins().icmp(IntCC::UnsignedLessThan, elem_index, list_len);
|
||||||
|
|
||||||
builder.ins().brz(comparison, fail_block, &[]);
|
builder.ins().brz(comparison, fail_block, &[]);
|
||||||
|
|
||||||
|
|
|
@ -559,12 +559,12 @@ mod test_gen {
|
||||||
//
|
//
|
||||||
#[test]
|
#[test]
|
||||||
fn empty_list_literal() {
|
fn empty_list_literal() {
|
||||||
assert_llvm_evals_to!("[]", &[], &'static [i64], |x| x);
|
assert_evals_to!("[]", &[], &'static [i64]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn int_list_literal() {
|
fn int_list_literal() {
|
||||||
assert_llvm_evals_to!("[ 12, 9, 6, 3 ]", &[12, 9, 6, 3], &'static [i64], |x| x);
|
assert_evals_to!("[ 12, 9, 6, 3 ]", &[12, 9, 6, 3], &'static [i64]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
@ -1921,6 +1921,19 @@ mod test_gen {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn i64_record_literal() {
|
||||||
|
assert_evals_to!(
|
||||||
|
indoc!(
|
||||||
|
r#"
|
||||||
|
{ x: 3, y: 5 }
|
||||||
|
"#
|
||||||
|
),
|
||||||
|
(3, 5),
|
||||||
|
(i64, i64)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn f64_record() {
|
fn f64_record() {
|
||||||
assert_evals_to!(
|
assert_evals_to!(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue