diff --git a/basis/compiler/tests/codegen.factor b/basis/compiler/tests/codegen.factor index c93e20294e..f1d17fe4a2 100644 --- a/basis/compiler/tests/codegen.factor +++ b/basis/compiler/tests/codegen.factor @@ -333,4 +333,16 @@ cell 4 = [ ] if ] any? ; inline recursive -[ t ] [ 3 [ return-recursive-bug ] compile-call ] unit-test \ No newline at end of file +[ t ] [ 3 [ return-recursive-bug ] compile-call ] unit-test + +! Coalescing reductions +[ f ] [ V{ } 0 [ [ vector? ] both? ] compile-call ] unit-test +[ f ] [ 0 V{ } [ [ vector? ] both? ] compile-call ] unit-test + +[ f ] [ + f vector [ + [ dup [ \ vector eq? ] [ drop f ] if ] dip + dup [ \ vector eq? ] [ drop f ] if + over rot [ drop ] [ nip ] if + ] compile-call +] unit-test \ No newline at end of file diff --git a/basis/compiler/tests/low-level-ir.factor b/basis/compiler/tests/low-level-ir.factor index 313fd65dac..706a404330 100644 --- a/basis/compiler/tests/low-level-ir.factor +++ b/basis/compiler/tests/low-level-ir.factor @@ -111,6 +111,13 @@ IN: compiler.tests } compile-test-bb ] unit-test +[ 1 ] [ + V{ + T{ ##load-immediate f V int-regs 0 16 } + T{ ##add-imm f V int-regs 0 V int-regs 0 -8 } + } compile-test-bb +] unit-test + ! These are def-is-use-insns USE: multiline