]> gitweb.factorcode.org Git - factor.git/blob - extra/llvm/types/types-tests.factor
Added type parser, factor llvm type objects, and recursive type resolution
[factor.git] / extra / llvm / types / types-tests.factor
1 USING: kernel llvm.types sequences tools.test ;
2
3 [ T{ integer f 32 }  ] [ " i32 " parse-type ] unit-test
4 [ float ] [ " float " parse-type ] unit-test
5 [ T{ pointer f f x86_fp80 } ] [ " x86_fp80 * " parse-type ] unit-test
6 [ T{ vector f f 4 T{ integer f 32 } } ] [ " < 4 x i32 > " parse-type ] unit-test
7 [ T{ struct f f { float double } f } ] [ TYPE: { float , double } ; ] unit-test
8 [ T{ array f f 0 float } ] [ TYPE: [ 0 x float ] ; ] unit-test
9
10 [ label void metadata ]
11 [ [ " label " " void " " metadata " ] [ parse-type ] each ] unit-test
12
13 [ T{ function f f float { float float } t } ]
14 [ TYPE: float ( float , float , ... ) ; ] unit-test
15
16 [ T{ struct f f { float TYPE: i32 (i32)* ; } t } ]
17 [ TYPE: < { float, i32 (i32)* } > ; ] unit-test
18
19 [ t ] [ TYPE: i32 ; TYPE: i32 ; [ >tref ] bi@ = ] unit-test
20 [ t ] [ TYPE: i32 * ; TYPE: i32 * ; [ >tref ] bi@ = ] unit-test