47 "checks for an stc compiler bug (detected Sep 2011). |
47 "checks for an stc compiler bug (detected Sep 2011). |
48 stc generates bad code for the bitOr expression in nextLittleEndianNumber" |
48 stc generates bad code for the bitOr expression in nextLittleEndianNumber" |
49 |
49 |
50 |val mthd| |
50 |val mthd| |
51 |
51 |
52 self class recompile:#'nextLittleEndianNumber:from:'. |
52 Class withoutUpdatingChangesDo:[ |
|
53 self class recompile:#'nextLittleEndianNumber:from:'. |
|
54 val := self nextLittleEndianNumber:4 from:#[1 2 3 4]. |
|
55 self assert:(val = 16r04030201). |
|
56 val := self nextLittleEndianNumber:8 from:#[1 2 3 4 5 6 7 8]. |
|
57 self assert:(val = 16r0807060504030201). |
53 |
58 |
54 val := self nextLittleEndianNumber:4 from:#[1 2 3 4]. |
59 mthd := (self class compiledMethodAt:#'nextLittleEndianNumber:from:'). |
55 self assert:(val = 16r04030201). |
60 (STCCompilerInterface new) |
56 val := self nextLittleEndianNumber:8 from:#[1 2 3 4 5 6 7 8]. |
61 compileToMachineCode:mthd source |
57 self assert:(val = 16r0807060504030201). |
62 forClass:self class |
|
63 selector:#'nextLittleEndianNumber:from:' |
|
64 inCategory:mthd category |
|
65 notifying:nil |
|
66 install:true |
|
67 skipIfSame:false |
|
68 silent:true. |
58 |
69 |
59 mthd := (self class compiledMethodAt:#'nextLittleEndianNumber:from:'). |
70 val := self nextLittleEndianNumber:4 from:#[1 2 3 4]. |
60 (STCCompilerInterface new) |
71 self assert:(val = 16r04030201). |
61 compileToMachineCode:mthd source |
72 val := self nextLittleEndianNumber:8 from:#[1 2 3 4 5 6 7 8]. |
62 forClass:self class |
73 self assert:(val = 16r0807060504030201). |
63 selector:#'nextLittleEndianNumber:from:' |
74 ]. |
64 inCategory:mthd category |
|
65 notifying:nil |
|
66 install:true |
|
67 skipIfSame:false |
|
68 silent:true. |
|
69 |
|
70 val := self nextLittleEndianNumber:4 from:#[1 2 3 4]. |
|
71 self assert:(val = 16r04030201). |
|
72 val := self nextLittleEndianNumber:8 from:#[1 2 3 4 5 6 7 8]. |
|
73 self assert:(val = 16r0807060504030201). |
|
74 |
75 |
75 " |
76 " |
76 self run:#test01_bitor_bug |
77 self run:#test01_bitor_bug |
77 self new test01_bitor_bug |
78 self new test01_bitor_bug |
78 " |
79 " |