diff --git a/compiler/gen/src/llvm/refcounting.rs b/compiler/gen/src/llvm/refcounting.rs index 35fef2f7df..d7d9113d4e 100644 --- a/compiler/gen/src/llvm/refcounting.rs +++ b/compiler/gen/src/llvm/refcounting.rs @@ -331,7 +331,6 @@ pub fn build_dec_list<'a, 'ctx, 'env>( let call = env .builder .build_call(function, &[original_wrapper.into()], "decrement_union"); - call.set_call_convention(FAST_CALL_CONV); } @@ -414,8 +413,7 @@ fn build_dec_list_help<'a, 'ctx, 'env>( { builder.position_at_end(then_block); if !env.leak { - let free = builder.build_free(refcount_ptr); - builder.insert_instruction(&free, None); + builder.build_free(refcount_ptr); } builder.build_unconditional_branch(cont_block); } diff --git a/compiler/gen/tests/gen_list.rs b/compiler/gen/tests/gen_list.rs index 053b2fa8a7..d532351341 100644 --- a/compiler/gen/tests/gen_list.rs +++ b/compiler/gen/tests/gen_list.rs @@ -592,6 +592,15 @@ mod gen_list { ); } + #[test] + fn list_concat_two_bigger_non_empty_lists() { + assert_evals_to!( + "List.concat [ 1.1, 2.2 ] [ 3.3, 4.4, 5.5 ]", + &[1.1, 2.2, 3.3, 4.4, 5.5], + &'static [f64] + ); + } + fn assert_concat_worked(num_elems1: i64, num_elems2: i64) { let vec1: Vec = (0..num_elems1) .map(|i| 12345 % (i + num_elems1 + num_elems2 + 1)) diff --git a/compiler/mono/tests/test_mono.rs b/compiler/mono/tests/test_mono.rs index de8d34cfbf..8e9b7e41c5 100644 --- a/compiler/mono/tests/test_mono.rs +++ b/compiler/mono/tests/test_mono.rs @@ -1920,36 +1920,4 @@ mod test_mono { ), ) } - - #[test] - fn linked_list_map() { - compiles_to_ir( - indoc!( - r#" - LinkedList a : [ Nil, Cons a (LinkedList a) ] - - three : LinkedList Int - three = Cons 3 (Cons 2 (Cons 1 Nil)) - - sum : LinkedList a -> Int - sum = \list -> - when list is - Nil -> 0 - Cons x rest -> x + sum rest - - map : (a -> b), LinkedList a -> LinkedList b - map = \f, list -> - when list is - Nil -> Nil - Cons x rest -> Cons (f x) (map f rest) - - sum (map (\_ -> 1) three) - "# - ), - indoc!( - r#" - "# - ), - ) - } }