From e9ae8452b05cf638a163d67a20eaade4076938df Mon Sep 17 00:00:00 2001 From: Brian Carroll Date: Wed, 22 Dec 2021 08:42:39 +0000 Subject: [PATCH] Equality tests passing for `List I64` --- compiler/mono/src/code_gen_help.rs | 1 + compiler/test_gen/src/gen_compare.rs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/compiler/mono/src/code_gen_help.rs b/compiler/mono/src/code_gen_help.rs index aa7ffb307e..0a0171ea97 100644 --- a/compiler/mono/src/code_gen_help.rs +++ b/compiler/mono/src/code_gen_help.rs @@ -1002,6 +1002,7 @@ impl<'a> CodeGenHelp<'a> { /// Another way to dereference a heap pointer is to use `Expr::UnionAtIndex`. /// To achieve this we use `PtrCast` to cast the element pointer to a "Box" layout. /// Then we can increment the Box pointer in a loop, dereferencing it each time. + /// (An alternative approach would be to create a new lowlevel like ListPeekUnsafe.) fn eq_list(&self, ident_ids: &mut IdentIds, elem_layout: &Layout<'a>) -> Stmt<'a> { use LowLevel::*; let layout_isize = self.layout_isize; diff --git a/compiler/test_gen/src/gen_compare.rs b/compiler/test_gen/src/gen_compare.rs index 02f8364566..c50d65efb3 100644 --- a/compiler/test_gen/src/gen_compare.rs +++ b/compiler/test_gen/src/gen_compare.rs @@ -467,14 +467,14 @@ fn list_eq_empty() { } #[test] -#[cfg(any(feature = "gen-llvm"))] +#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] fn list_eq_by_length() { assert_evals_to!("[1] == []", false, bool); assert_evals_to!("[] == [1]", false, bool); } #[test] -#[cfg(any(feature = "gen-llvm"))] +#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] fn list_eq_compare_pointwise() { assert_evals_to!("[1] == [1]", true, bool); assert_evals_to!("[2] == [1]", false, bool); @@ -488,7 +488,7 @@ fn list_eq_nested() { } #[test] -#[cfg(any(feature = "gen-llvm"))] +#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] fn list_neq_compare_pointwise() { assert_evals_to!("[1] != [1]", false, bool); assert_evals_to!("[2] != [1]", true, bool);