]> gitweb.factorcode.org Git - factor.git/blob - extra/tools/gc-decode/gc-decode-tests.factor
tools.gc-decode: typo..
[factor.git] / extra / tools / gc-decode / gc-decode-tests.factor
1 USING: bit-arrays classes.struct sequences
2 tools.gc-decode tools.test vm ;
3 QUALIFIED: effects
4 QUALIFIED: llvm.types
5 QUALIFIED: unix.process
6 IN: tools.gc-decode.tests
7
8 ! byte-array>bit-array
9 {
10     ?{
11         t t t t f t t t
12         t f f f f f f f
13     }
14 } [
15     B{ 239 1 } byte-array>bit-array
16 ] unit-test
17
18 { ?{ t t t t t t t t } } [ B{ 255 } byte-array>bit-array ] unit-test
19
20 ! scrub-bits
21 { t } [
22     \ effects:<effect> word>gc-info scrub-bits
23     {
24         ?{ t t t f t t t t } ! 64-bit
25         ?{ t t t f f f f f t t t t } ! 32-bit
26     } member?
27 ] unit-test
28
29 {
30     { }
31 } [
32     \ decode-gc-maps word>gc-info scrub-bits
33 ] unit-test
34
35 ! decode-gc-maps
36 { t } [
37     \ effects:<effect> decode-gc-maps
38     {
39         {
40             { 151 { { ?{ } ?{ t t t } ?{ } ?{ } ?{ f t t t t } } { } } }
41         }
42         {
43             { 124 { { ?{ } ?{ t t t } ?{ } ?{ } ?{ f f f f f t t t t } } { } } }
44         }
45     } member?
46 ] unit-test
47
48 { t } [
49     \ unix.process:fork-process decode-gc-maps
50     {
51         {
52             { 82 { { ?{ t f } ?{ t } ?{ f } ?{ f f } ?{ } } { } } }
53             { 244 { { ?{ f f } ?{ f } ?{ f } ?{ t f } ?{ } } { } } }
54             { 445 { { ?{ f f } ?{ f } ?{ t } ?{ t t } ?{ } } { } } }
55             { 522 { { ?{ t t } ?{ f } ?{ f } ?{ t f } ?{ } } { } } }
56         }
57         {
58             { 57 { { ?{ t f } ?{ t } ?{ f } ?{ f f } ?{ f f f f f f f } } { } } }
59             { 90 { { ?{ t f } ?{ t } ?{ f } ?{ f f } ?{ f f f f f f t } } { } } }
60             { 207 { { ?{ f f } ?{ f } ?{ f } ?{ t f } ?{ f f f f f f f } } { } } }
61             { 231 { { ?{ f f } ?{ f } ?{ f } ?{ t f } ?{ f f f f f f f } } { } } }
62             { 437 { { ?{ f f } ?{ f } ?{ t } ?{ t t } ?{ f f f f f f f } } { } } }
63             { 495 { { ?{ t t } ?{ f } ?{ f } ?{ t f } ?{ f f f f f f f } } { } } }
64             { 519 { { ?{ t t } ?{ f } ?{ f } ?{ t f } ?{ f f f f f f f } } { } } }
65         }
66         {
67             { 57 { { ?{ t f } ?{ t } ?{ f } ?{ f f } ?{ } } { } } }
68             { 81 { { ?{ t f } ?{ t } ?{ f } ?{ f f } ?{ } } { } } }
69             { 200 { { ?{ f f } ?{ f } ?{ f } ?{ t f } ?{ } } { } } }
70             { 224 { { ?{ f f } ?{ f } ?{ f } ?{ t f } ?{ } } { } } }
71             { 429 { { ?{ f f } ?{ f } ?{ t } ?{ t t } ?{ } } { } } }
72             { 487 { { ?{ t t } ?{ f } ?{ f } ?{ t f } ?{ } { } } } }
73             { 511 { { ?{ t t } ?{ f } ?{ f } ?{ t f } ?{ } } { } } }
74         }
75     } member?
76 ] unit-test
77
78 ! read-gc-maps
79 { { } } [
80     \ decode-gc-maps decode-gc-maps
81 ] unit-test
82
83 ! base-pointer-groups
84 { t } [
85     \ llvm.types:resolve-types word>gc-info base-pointer-groups
86     {
87         {
88             { -1 -1 -1 -1 -1 -1 -1 }
89             { -1 -1 -1 -1 -1 -1 -1 }
90             { -1 -1 -1 -1 -1 -1 -1 }
91             { -1 -1 -1 -1 -1 -1 5 }
92             { -1 -1 -1 -1 -1 -1 5 }
93             { -1 -1 -1 -1 -1 -1 -1 }
94         }
95         {
96             { -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 }
97             { -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 }
98             { -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 }
99             { -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 9 }
100             { -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 9 }
101             { -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 }
102         }
103     } member?
104 ] unit-test
105
106
107 ! One of the few words that has derived roots.
108 { t } [
109     \ llvm.types:resolve-types word>gc-info
110     {
111         S{ gc-info f 0 2 2 1 6 7 6 } ! 64-bit
112         S{ gc-info f 0 2 2 1 10 11 6 } ! 32-bit
113     } member?
114 ] unit-test