USING: tools.test kernel.private kernel arrays sequences
math.private math generic words quotations alien alien.c-types
-strings sbufs sequences.private slots.private combinators
-definitions system layouts vectors math.partial-dispatch
-math.order math.functions accessors hashtables classes assocs
-io.encodings.utf8 io.encodings.ascii io.encodings fry slots
-sorting.private combinators.short-circuit grouping prettyprint
-generalizations
+alien.data strings sbufs sequences.private slots.private
+combinators definitions system layouts vectors
+math.partial-dispatch math.order math.functions accessors
+hashtables classes assocs io.encodings.utf8 io.encodings.ascii
+io.encodings fry slots sorting.private combinators.short-circuit
+grouping prettyprint generalizations
compiler.tree
compiler.tree.combinators
compiler.tree.cleanup
compiler.tree.propagation.info
compiler.tree.checker
compiler.tree.debugger ;
+FROM: math => float ;
+QUALIFIED-WITH: alien.c-types c
IN: compiler.tree.cleanup.tests
[ t ] [ [ [ 1 ] [ 2 ] if ] cleaned-up-tree [ #if? ] contains-node? ] unit-test
] when
[ t ] [
- [ B{ 1 0 } *short 0 number= ]
+ [ B{ 1 0 } c:short deref 0 number= ]
\ number= inlined?
] unit-test
[ t ] [
- [ B{ 1 0 } *short 0 { number number } declare number= ]
+ [ B{ 1 0 } c:short deref 0 { number number } declare number= ]
\ number= inlined?
] unit-test
[ t ] [
- [ B{ 1 0 } *short 0 = ]
+ [ B{ 1 0 } c:short deref 0 = ]
\ number= inlined?
] unit-test
[ t ] [
- [ B{ 1 0 } *short dup number? [ 0 number= ] [ drop f ] if ]
+ [ B{ 1 0 } c:short deref dup number? [ 0 number= ] [ drop f ] if ]
\ number= inlined?
] unit-test
[ t ] [
- [ HEX: ff bitand 0 HEX: ff between? ]
+ [ 0xff bitand 0 0xff between? ]
\ >= inlined?
] unit-test
[ t ] [
- [ HEX: ff swap HEX: ff bitand >= ]
+ [ 0xff swap 0xff bitand >= ]
\ >= inlined?
] unit-test
] unit-test
[ t ] [
- [ { fixnum } declare length [ drop ] each-integer ]
+ [ { fixnum } declare iota [ drop ] each ]
{ < <-integer-fixnum +-integer-fixnum + } inlined?
] unit-test
[ t ] [
- [ { fixnum } declare [ drop ] each ]
- { < <-integer-fixnum +-integer-fixnum + } inlined?
-] unit-test
-
-[ t ] [
- [ { fixnum } declare 0 [ + ] reduce ]
+ [ { fixnum } declare iota 0 [ + ] reduce ]
{ < <-integer-fixnum nth-unsafe } inlined?
] unit-test
[ f ] [
- [ { fixnum } declare 0 [ + ] reduce ]
+ [ { fixnum } declare iota 0 [ + ] reduce ]
\ +-integer-fixnum inlined?
] unit-test
[ f ] [
[
- { integer } declare [ ] map
+ { integer } declare iota [ ] map
] \ >fixnum inlined?
] unit-test
[ t ] [
[
- { integer } declare [ 0 >= ] map
+ { integer } declare iota [ 0 >= ] map
] { >= fixnum>= } inlined?
] unit-test
] unit-test
[ t ] [
- [ { array } declare 2 <groups> [ . . ] assoc-each ]
+ [ { array } declare 2 <sliced-groups> [ . . ] assoc-each ]
\ nth-unsafe inlined?
] unit-test
14 ndrop
] cleaned-up-tree nodes>quot
] unit-test
+
+[ t ] [
+ [ int { } cdecl [ 2 2 + ] alien-callback ]
+ { + } inlined?
+] unit-test
+
+[ t ] [
+ [ double { double double } cdecl [ + ] alien-callback ]
+ \ + inlined?
+] unit-test
+
+[ f ] [
+ [ double { double double } cdecl [ + ] alien-callback ]
+ \ float+ inlined?
+] unit-test
+
+[ f ] [
+ [ char { char char } cdecl [ + ] alien-callback ]
+ \ fixnum+fast inlined?
+] unit-test
+
+[ t ] [
+ [ void { } cdecl [ ] alien-callback void { } cdecl alien-indirect ]
+ \ >c-ptr inlined?
+] unit-test