1 IN: compiler.cfg.builder.tests
2 USING: tools.test kernel sequences
3 words sequences.private fry prettyprint alien alien.accessors
4 math.private compiler.tree.builder compiler.tree.optimizer
5 compiler.cfg.builder compiler.cfg.debugger arrays locals byte-arrays
10 ! Just ensure that various CFGs build correctly.
11 : unit-test-cfg ( quot -- ) '[ _ test-cfg drop ] [ ] swap unit-test ;
24 [ 10 fixnum-shift-fast ]
25 [ -10 fixnum-shift-fast ]
26 [ 0 fixnum-shift-fast ]
41 [ fixnum< [ 1 ] [ 2 ] if ]
42 [ float+ [ 2.0 float* ] [ 3.0 float* ] bi float/f ]
43 [ { [ 1 ] [ 2 ] [ 3 ] } dispatch ]
46 [ [ 2 ] [ 3 throw ] if 4 ]
47 [ "int" f "malloc" { "int" } alien-invoke ]
48 [ "int" { "int" } "cdecl" alien-indirect ]
49 [ "int" { "int" } "cdecl" [ ] alien-callback ]
54 : test-1 ( -- ) test-1 ;
55 : test-2 ( -- ) 3 . test-2 ;
56 : test-3 ( a -- b ) dup [ test-3 ] when ;
62 } [ unit-test-cfg ] each
81 { class } word '[ _ declare 10 _ execute ] unit-test-cfg
82 { class fixnum } word '[ _ declare _ execute ] unit-test-cfg
93 { fixnum class } word '[ _ declare 10 _ execute ] unit-test-cfg
94 { fixnum class fixnum } word '[ _ declare _ execute ] unit-test-cfg
97 { float class } \ set-alien-float '[ _ declare 10 _ execute ] unit-test-cfg
98 { float class fixnum } \ set-alien-float '[ _ declare _ execute ] unit-test-cfg
100 { float class } \ set-alien-double '[ _ declare 10 _ execute ] unit-test-cfg
101 { float class fixnum } \ set-alien-double '[ _ declare _ execute ] unit-test-cfg
103 { pinned-c-ptr class } \ set-alien-cell '[ _ declare 10 _ execute ] unit-test-cfg
104 { pinned-c-ptr class fixnum } \ set-alien-cell '[ _ declare _ execute ] unit-test-cfg