Restore some more things to how they were before

This commit is contained in:
Richard Feldman 2020-03-25 02:13:41 -04:00
parent 0951f8048e
commit 2491b2e43b
2 changed files with 16 additions and 3 deletions

View file

@ -1083,7 +1083,7 @@ fn list_set<'a, B: Backend>(
// to avoid misprediction. (In practice this should usually pass,
// and CPUs generally default to predicting that a forward jump
// 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, &[]);

View file

@ -559,12 +559,12 @@ mod test_gen {
//
#[test]
fn empty_list_literal() {
assert_llvm_evals_to!("[]", &[], &'static [i64], |x| x);
assert_evals_to!("[]", &[], &'static [i64]);
}
#[test]
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]
@ -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]
fn f64_record() {
assert_evals_to!(