author | Claus Gittinger <cg@exept.de> |
Tue, 26 Mar 2019 18:29:44 +0100 | |
changeset 2185 | 210ba8fc2b76 |
parent 2182 | abba80b6780f |
permissions | -rw-r--r-- |
1447 | 1 |
"{ Package: 'stx:goodies/regression' }" |
784 | 2 |
|
3 |
"{ NameSpace: RegressionTests }" |
|
4 |
||
5 |
TestCase subclass:#CompilerTests2 |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
6 |
instanceVariableNames:'methods enabledJIT savedContext savedContextArgAndVarNames |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
7 |
savedContextArgAndVarValues savedContextArgAndVarValuesUsingEval |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
8 |
savedContextLine' |
784 | 9 |
classVariableNames:'' |
10 |
poolDictionaries:'' |
|
1163 | 11 |
category:'tests-Regression-Compilers' |
784 | 12 |
! |
13 |
||
14 |
||
1928 | 15 |
!CompilerTests2 class methodsFor:'settings'! |
16 |
||
17 |
libraryName |
|
18 |
^ 'librun' |
|
19 |
||
20 |
"Created: / 11-05-2018 / 13:50:32 / stefan" |
|
21 |
! ! |
|
22 |
||
2182 | 23 |
!CompilerTests2 methodsFor:'initialize / release'! |
24 |
||
25 |
setUp |
|
26 |
methods := Set new. |
|
27 |
enabledJIT := ObjectMemory justInTimeCompilation:true. |
|
28 |
savedContext := savedContextArgAndVarNames |
|
29 |
:= savedContextArgAndVarValues := savedContextArgAndVarValuesUsingEval |
|
30 |
:= savedContextLine := '* Not assigned *'. |
|
31 |
||
32 |
"Created: / 25-04-2013 / 15:20:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
33 |
"Modified: / 26-09-2014 / 13:00:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
34 |
! |
|
35 |
||
36 |
tearDown |
|
37 |
savedContext := savedContextArgAndVarNames |
|
38 |
:= savedContextArgAndVarValues := savedContextArgAndVarValuesUsingEval |
|
39 |
:= savedContextLine := nil. |
|
40 |
||
41 |
ObjectMemory justInTimeCompilation: enabledJIT. |
|
42 |
Class withoutUpdatingChangesDo:[ |
|
43 |
| classesToRemove | |
|
44 |
(Smalltalk at: #'stx_goodies_regression_testData_CompilerTests2') notNil ifTrue:[ |
|
45 |
(Smalltalk at: #'stx_goodies_regression_testData_CompilerTests2') classes do:[:e| |
|
46 |
e notNil ifTrue:[ |
|
47 |
Smalltalk removeClass: e |
|
48 |
]. |
|
49 |
]. |
|
50 |
]. |
|
51 |
Smalltalk allClassesDo:[:cls| |
|
52 |
(#( |
|
53 |
'stx:goodies/regression/testData/CompilerTests2' |
|
54 |
"/Add more... |
|
55 |
) includes: cls package) ifTrue:[ |
|
56 |
Smalltalk removeClass: cls |
|
57 |
] |
|
58 |
]. |
|
59 |
||
60 |
methods do:[:m| |
|
61 |
m mclass removeSelector: m selector. |
|
62 |
] |
|
63 |
] |
|
64 |
||
65 |
"Created: / 26-10-2012 / 11:32:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
66 |
"Modified: / 26-09-2014 / 12:59:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
67 |
! ! |
|
68 |
||
899 | 69 |
!CompilerTests2 methodsFor:'private'! |
70 |
||
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
71 |
assertSendersMethodIsIdenticalTo: sendersMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
72 |
"Do not assert here, pass down to have some immediate, possibly lazy contexts |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
73 |
in between" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
74 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
75 |
self assertSendersSendersMethodIsIdenticalTo: sendersMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
76 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
77 |
"Created: / 25-04-2013 / 15:28:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
78 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
79 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
80 |
assertSendersSendersMethodIsIdenticalTo: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
81 |
| ctx m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
82 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
83 |
ctx := thisContext sender sender. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
84 |
"/ Now, DO NOT USE Context>>method as it searches for the method |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
85 |
"/ if it is not set!! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
86 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
87 |
m := ctx instVarAt: (Context instVarIndexFor: #method). |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
88 |
self assert: m == thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
89 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
90 |
"Created: / 25-04-2013 / 15:30:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
91 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
92 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
93 |
compile: source mode: mode |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
94 |
"Compile given source and returns the new method. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
95 |
The from the source is prepended the mode + underscore |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
96 |
(i.e., foo -> stc_foo). |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
97 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
98 |
If mode is: |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
99 |
#stc....then the method is stc-compiled. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
100 |
#jit....then the method is bytecode compiled and left |
1447 | 101 |
to the jitter |
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
102 |
#bc.....them the method is bytecode compiled and marked |
1447 | 103 |
as checked so JIT won't even try. |
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
104 |
" |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
105 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
106 |
| m | |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
107 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
108 |
Class withoutUpdatingChangesDo:[ |
1447 | 109 |
mode == #stc ifTrue:[ |
110 |
ParserFlags withSTCCompilation:#always do:[ |
|
111 |
m := self class compile: (mode, '_', source) classified: 'private - *dynamic*'. |
|
112 |
]. |
|
113 |
] ifFalse:[ |
|
114 |
ParserFlags withSTCCompilation:#never do:[ |
|
115 |
m := self class compile: (mode, '_', source) classified: 'private - *dynamic*'. |
|
116 |
m checked: (mode == #bc) |
|
117 |
]. |
|
118 |
]. |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
119 |
]. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
120 |
methods add: m. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
121 |
^m |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
122 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
123 |
"Created: / 25-04-2013 / 15:18:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
124 |
! |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
125 |
|
899 | 126 |
currentLineNumber |
900
7acbd0cce153
Call fixAllLineNumbers, otherwise linenos are invalid.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
899
diff
changeset
|
127 |
thisContext fixAllLineNumbers. |
7acbd0cce153
Call fixAllLineNumbers, otherwise linenos are invalid.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
899
diff
changeset
|
128 |
^thisContext sender lineNumber. |
899 | 129 |
|
130 |
"Created: / 12-04-2013 / 21:20:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
900
7acbd0cce153
Call fixAllLineNumbers, otherwise linenos are invalid.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
899
diff
changeset
|
131 |
"Modified: / 13-04-2013 / 10:12:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
132 |
! |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
133 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
134 |
saveContext |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
135 |
self saveContext: thisContext sender. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
136 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
137 |
"Created: / 26-09-2014 / 12:49:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
138 |
! |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
139 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
140 |
saveContext: aContext |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
141 |
savedContext := aContext. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
142 |
savedContextArgAndVarNames := savedContext argAndVarNames asArray. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
143 |
savedContextArgAndVarValues := savedContext argsAndVars. |
1447 | 144 |
savedContextArgAndVarValuesUsingEval := savedContextArgAndVarNames |
145 |
collect:[ :each | |
|
146 |
Compiler evaluate:each |
|
147 |
in:savedContext |
|
148 |
receiver:savedContext receiver |
|
149 |
notifying:nil |
|
150 |
logged:false |
|
151 |
ifFail:[ '*Error when evaluating*']. |
|
152 |
]. |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
153 |
savedContextLine := savedContext lineNumber. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
154 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
155 |
self assert: savedContextArgAndVarNames size == savedContextArgAndVarValues size. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
156 |
self assert: savedContextArgAndVarNames size == savedContextArgAndVarValuesUsingEval size. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
157 |
|
1447 | 158 |
1 to: savedContextArgAndVarNames size do:[:i | |
159 |
| v1 v2 | |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
160 |
|
1447 | 161 |
v1 := savedContextArgAndVarValues at: i. |
162 |
v2 := savedContextArgAndVarValuesUsingEval at: i. |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
163 |
|
1447 | 164 |
self assert: v1 == v2. "HAS to be IDENTICAL" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
165 |
]. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
166 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
167 |
"Created: / 26-09-2014 / 12:49:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
168 |
"Modified: / 26-09-2014 / 14:58:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
169 |
! ! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
170 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
171 |
!CompilerTests2 methodsFor:'private-mock methods'! |
899 | 172 |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
173 |
method_argAndVarNames_01 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
174 |
#(1 2 3 4) select:[:each | |
1447 | 175 |
| isEven | |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
176 |
|
1447 | 177 |
isEven := each even. |
178 |
self saveContext. |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
179 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
180 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
181 |
"Created: / 20-08-2013 / 09:04:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
182 |
"Modified: / 26-09-2014 / 13:00:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
183 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
184 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
185 |
method_argAndVarNames_02 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
186 |
#(1 2 3 4) select:[:each | |
1928 | 187 |
| isEven | |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
188 |
|
1928 | 189 |
'1234' select:[:char | |
190 |
| someOtherLocal | |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
191 |
|
1928 | 192 |
someOtherLocal := char == $1. |
193 |
]. |
|
194 |
isEven := each even. |
|
195 |
self saveContext. |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
196 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
197 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
198 |
"Created: / 20-08-2013 / 09:17:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
199 |
"Modified: / 26-09-2014 / 13:00:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
200 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
201 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
202 |
method_argAndVarNames_03 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
203 |
"Reported by Stefan" |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
204 |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
205 |
savedContextArgAndVarNames := 1. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
206 |
(Smalltalk isStandAloneApp | (savedContextArgAndVarNames == 1)) ifTrue:[ |
1447 | 207 |
| ttt | |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
208 |
|
1447 | 209 |
ttt := 123. |
210 |
self saveContext. |
|
1149
e394c5dbf746
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1138
diff
changeset
|
211 |
]. |
e394c5dbf746
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1138
diff
changeset
|
212 |
self halt. |
1447 | 213 |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
214 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
215 |
" |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
216 |
CompilerTests2 basicNew method_argAndVarNames_03 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
217 |
" |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
218 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
219 |
"Created: / 20-08-2013 / 09:22:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
220 |
"Modified: / 26-09-2014 / 13:01:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
221 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
222 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
223 |
method_argAndVarNames_04 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
224 |
#(1 2 3 4) select:[:each | |
1447 | 225 |
| isEven | |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
226 |
|
1447 | 227 |
isEven := each even. |
228 |
isEven ifTrue:[ |
|
229 |
| isOddNot | |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
230 |
|
1447 | 231 |
isOddNot := each odd not. |
232 |
self saveContext. |
|
233 |
] |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
234 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
235 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
236 |
"Created: / 20-08-2013 / 10:11:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
237 |
"Modified: / 26-09-2014 / 13:01:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
238 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
239 |
|
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
240 |
method_argAndVarNames_05 |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
241 |
| b | |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
242 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
243 |
b := [:len | |
1447 | 244 |
1 to: len do:[:i| |
245 |
| local1 local2 | |
|
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
246 |
|
1447 | 247 |
local1 := #local1. |
248 |
local2 := 42. |
|
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
249 |
|
1447 | 250 |
i == 1 ifTrue:[ |
251 |
self saveContext. |
|
252 |
] |
|
253 |
] |
|
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
254 |
]. |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
255 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
256 |
b value: 5 |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
257 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
258 |
" |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
259 |
CompilerTests2 basicNew method_argAndVarNames_05 |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
260 |
" |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
261 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
262 |
"Created: / 22-08-2013 / 15:48:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
263 |
"Modified: / 26-09-2014 / 13:01:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
264 |
! |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
265 |
|
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
266 |
method_argAndVarNames_06 |
1462 | 267 |
(Smalltalk at:#stx_goodies_regression) classNamesAndAttributesDo:[:clsnm :attributes| |
1447 | 268 |
| cls | |
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
269 |
|
1447 | 270 |
cls := Smalltalk at: clsnm. |
271 |
((Array with: self class) includes: cls) ifTrue:[ |
|
272 |
(attributes includes: #autoload) ifTrue:[ |
|
273 |
"/ Care for Object!! |
|
274 |
cls superclass notNil ifTrue:[ |
|
275 |
| superDef superNm | |
|
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
276 |
|
1447 | 277 |
superDef := ProjectDefinition definitionClassForPackage: cls superclass package. |
278 |
superNm := cls superclass name. |
|
279 |
self saveContext. |
|
280 |
^ self |
|
281 |
]. |
|
282 |
]. |
|
283 |
]. |
|
284 |
]. |
|
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
285 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
286 |
" |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
287 |
CompilerTests2 basicNew method_argAndVarNames_06 |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
288 |
" |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
289 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
290 |
"Created: / 20-09-2013 / 11:44:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
291 |
"Modified: / 26-09-2014 / 13:01:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
292 |
! |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
293 |
|
899 | 294 |
method_lineno_002 |
295 |
1 factorial. ^self currentLineNumber |
|
296 |
||
297 |
"Created: / 12-04-2013 / 21:22:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
298 |
! |
|
299 |
||
300 |
method_lineno_300 |
|
301 |
"DO NOT MAKE THIS METHOD SHORTER, DO NOT REMOVE BLANK LINES!!!!!!" |
|
302 |
||
303 |
||
304 |
||
305 |
||
306 |
||
307 |
||
308 |
||
309 |
||
310 |
||
311 |
||
312 |
||
313 |
||
314 |
||
315 |
||
316 |
||
317 |
||
318 |
||
319 |
||
320 |
||
321 |
||
322 |
||
323 |
||
324 |
||
325 |
||
326 |
||
327 |
||
328 |
||
329 |
||
330 |
||
331 |
||
332 |
||
333 |
||
334 |
||
335 |
||
336 |
||
337 |
||
338 |
||
339 |
||
340 |
||
341 |
||
342 |
||
343 |
||
344 |
||
345 |
||
346 |
||
347 |
||
348 |
||
349 |
||
350 |
||
351 |
||
352 |
||
353 |
||
354 |
||
355 |
||
356 |
||
357 |
||
358 |
||
359 |
||
360 |
||
361 |
||
362 |
||
363 |
||
364 |
||
365 |
||
366 |
||
367 |
||
368 |
||
369 |
||
370 |
||
371 |
||
372 |
||
373 |
||
374 |
||
375 |
||
376 |
||
377 |
||
378 |
||
379 |
||
380 |
||
381 |
||
382 |
||
383 |
||
384 |
||
385 |
||
386 |
||
387 |
||
388 |
||
389 |
||
390 |
||
391 |
||
392 |
||
393 |
||
394 |
||
395 |
||
396 |
||
397 |
||
398 |
||
399 |
||
400 |
||
401 |
||
402 |
||
403 |
||
404 |
||
405 |
||
406 |
||
407 |
||
408 |
||
409 |
||
410 |
||
411 |
||
412 |
||
413 |
||
414 |
||
415 |
||
416 |
||
417 |
||
418 |
||
419 |
||
420 |
||
421 |
||
422 |
||
423 |
||
424 |
||
425 |
||
426 |
||
427 |
||
428 |
||
429 |
||
430 |
||
431 |
||
432 |
||
433 |
||
434 |
||
435 |
||
436 |
||
437 |
||
438 |
||
439 |
||
440 |
||
441 |
||
442 |
||
443 |
||
444 |
||
445 |
||
446 |
||
447 |
||
448 |
||
449 |
||
450 |
||
451 |
||
452 |
||
453 |
||
454 |
||
455 |
||
456 |
||
457 |
||
458 |
||
459 |
||
460 |
||
461 |
||
462 |
||
463 |
||
464 |
||
465 |
||
466 |
||
467 |
||
468 |
||
469 |
||
470 |
||
471 |
||
472 |
||
473 |
||
474 |
||
475 |
||
476 |
||
477 |
||
478 |
||
479 |
||
480 |
||
481 |
||
482 |
||
483 |
||
484 |
||
485 |
||
486 |
||
487 |
||
488 |
||
489 |
||
490 |
||
491 |
||
492 |
||
493 |
||
494 |
||
495 |
||
496 |
||
497 |
||
498 |
||
499 |
||
500 |
||
501 |
||
502 |
||
503 |
||
504 |
||
505 |
||
506 |
||
507 |
||
508 |
||
509 |
||
510 |
||
511 |
||
512 |
||
513 |
||
514 |
||
515 |
||
516 |
||
517 |
||
518 |
||
519 |
||
520 |
||
521 |
||
522 |
||
523 |
||
524 |
||
525 |
||
526 |
||
527 |
||
528 |
||
529 |
||
530 |
||
531 |
||
532 |
||
533 |
||
534 |
||
535 |
||
536 |
||
537 |
||
538 |
||
539 |
||
540 |
||
541 |
||
542 |
||
543 |
||
544 |
||
545 |
||
546 |
||
547 |
||
548 |
||
549 |
||
550 |
||
551 |
||
552 |
||
553 |
||
554 |
||
555 |
||
556 |
||
557 |
||
558 |
||
559 |
||
560 |
||
561 |
||
562 |
||
563 |
||
564 |
||
565 |
||
566 |
||
567 |
||
568 |
||
569 |
||
570 |
||
571 |
||
572 |
||
573 |
||
574 |
||
575 |
||
576 |
||
577 |
||
578 |
||
579 |
||
580 |
||
581 |
||
582 |
||
583 |
||
584 |
||
585 |
||
586 |
||
587 |
||
588 |
||
589 |
||
590 |
||
591 |
||
592 |
||
593 |
||
594 |
||
595 |
||
596 |
||
597 |
||
598 |
||
599 |
^self currentLineNumber |
|
600 |
||
601 |
"Created: / 12-04-2013 / 21:23:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
602 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
603 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
604 |
method_literals_array_01a |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
605 |
| literal | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
606 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
607 |
literal := #( |
1447 | 608 |
_XXX:_: |
609 |
YYY |
|
610 |
_XXX:_: |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
611 |
). |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
612 |
^ literal |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
613 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
614 |
"Created: / 20-01-2014 / 13:39:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
615 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
616 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
617 |
method_literals_array_01b |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
618 |
| literal | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
619 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
620 |
literal := #( |
1447 | 621 |
#'_XXX:_:' |
622 |
#'YYY' |
|
623 |
#'_XXX:_:' |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
624 |
). |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
625 |
^ literal |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
626 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
627 |
"Created: / 20-01-2014 / 13:39:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
628 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
629 |
|
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
630 |
method_literals_symbol_01 |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
631 |
| literal | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
632 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
633 |
literal := #_XXX:_:. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
634 |
^ literal. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
635 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
636 |
"Created: / 20-01-2014 / 13:43:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
637 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
638 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
639 |
method_methodslot_01: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
640 |
self assertSendersMethodIsIdenticalTo: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
641 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
642 |
"Created: / 25-04-2013 / 15:28:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
643 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
644 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
645 |
method_methodslot_02: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
646 |
[ self assertSendersMethodIsIdenticalTo: thisMethod ] |
1447 | 647 |
valueWithArguments:#() "/ don't use #value, it gets optimized!! |
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
648 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
649 |
"Created: / 25-04-2013 / 15:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
650 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
651 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
652 |
method_methodslot_03: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
653 |
"Deep block nesting...." |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
654 |
[ |
1447 | 655 |
[ |
656 |
[ |
|
657 |
[ |
|
658 |
self assertSendersMethodIsIdenticalTo: thisMethod |
|
659 |
] valueWithArguments:#() "/ don't use #value, it gets optimized!! |
|
660 |
] valueWithArguments:#() "/ don't use #value, it gets optimized!! |
|
661 |
] valueWithArguments:#() "/ don't use #value, it gets optimized!! |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
662 |
] valueWithArguments:#() "/ don't use #value, it gets optimized!! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
663 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
664 |
"Created: / 25-04-2013 / 15:38:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
665 |
! |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
666 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
667 |
method_negativeZero_01 |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
668 |
| literal | |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
669 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
670 |
literal := -0.0. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
671 |
^ literal. |
899 | 672 |
! ! |
673 |
||
784 | 674 |
!CompilerTests2 methodsFor:'tests'! |
675 |
||
676 |
test_01 |
|
823 | 677 |
"JV@2012-10-26: |
784 | 678 |
|
823 | 679 |
When a package is loaded from source using |
784 | 680 |
|
1447 | 681 |
Smalltalk loadPackage:'...' |
784 | 682 |
|
823 | 683 |
expression __EVALUATED FROM WORKSPACE__ AND a method from loaded class |
684 |
uses a class from the same package that is not yet loaded (i.e., it will |
|
685 |
be loaded later), |
|
784 | 686 |
|
823 | 687 |
then the compiler as of 2012-10-26 generates access to a workspace variable |
784 | 688 |
instead of access to a global |
689 |
||
690 |
This tests checks for this bug |
|
691 |
" |
|
692 |
||
693 |
| ws | |
|
694 |
||
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
695 |
"/ this test only works with a Display... |
871
098316a54e40
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
870
diff
changeset
|
696 |
self skipIf:[Display isNil] description:'Test requires a Display'. |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
697 |
|
784 | 698 |
"/First, make sure that package is not yet loaded... |
823 | 699 |
self |
1462 | 700 |
assert: (Smalltalk at: #'stx_goodies_regression_testData_CompilerTests2') isNil |
1447 | 701 |
description: 'Mock package already loaded'. |
784 | 702 |
|
703 |
ws := WorkspaceApplication new. |
|
948
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
704 |
ws selectedWorkspace |
1447 | 705 |
autoDefineVariables: #workspace; |
706 |
contents: '(Smalltalk loadPackage: #''stx:goodies/regression/testData/CompilerTests2'')'; |
|
707 |
selectAll; |
|
708 |
doIt. |
|
784 | 709 |
|
823 | 710 |
self assert: (Smalltalk at: #'RegressionTests::CompilerTests2Mock1') new foo class |
1447 | 711 |
== (Smalltalk at: #'RegressionTests::CompilerTests2Mock2') |
784 | 712 |
|
713 |
"Created: / 26-10-2012 / 11:59:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
948
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
714 |
"Modified: / 24-06-2013 / 15:30:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
784 | 715 |
! |
716 |
||
717 |
test_02 |
|
823 | 718 |
"JV@2012-10-26: |
784 | 719 |
|
823 | 720 |
When a package is loaded from source using |
784 | 721 |
|
1447 | 722 |
Smalltalk loadPackage:'...' |
784 | 723 |
|
823 | 724 |
expression and a method from loaded class in namespace uses a class from the |
725 |
same package and same namespace, that is not yet loaded (i.e., it will be loaded |
|
726 |
later), |
|
784 | 727 |
|
728 |
then the compiler as of 2012-10-26 generates access to class in no namespace. |
|
729 |
||
730 |
This test checks for this bug |
|
731 |
" |
|
732 |
||
733 |
"/First, make sure that package is not yet loaded... |
|
823 | 734 |
self |
1462 | 735 |
assert: (Smalltalk at: #'stx_goodies_regression_testData_CompilerTests2') isNil |
1447 | 736 |
description: 'Mock package already loaded'. |
784 | 737 |
|
823 | 738 |
self |
1447 | 739 |
assert: (Smalltalk loadPackage: #'stx:goodies/regression/testData/CompilerTests2') |
740 |
description: 'Cannot load mock package!!'. |
|
784 | 741 |
|
742 |
||
823 | 743 |
self assert: (Smalltalk at: #'RegressionTests::CompilerTests2Mock1') new foo class |
1447 | 744 |
== (Smalltalk at: #'RegressionTests::CompilerTests2Mock2') |
784 | 745 |
|
746 |
"Created: / 26-10-2012 / 12:26:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
747 |
"Modified (comment): / 12-02-2013 / 16:24:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
948
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
748 |
! |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
749 |
|
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
750 |
test_03 |
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
751 |
"JV@2013-10-27: |
948
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
752 |
|
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
753 |
As of 2013-10-27 parser crashes on DNU when a message |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
754 |
is constant-folded. |
948
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
755 |
" |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
756 |
|
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
757 |
self compile: 'mock_03 ^ 1 perform: #+ with: 2' mode: #bc. |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
758 |
self assert: self bc_mock_03 == 3 |
948
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
759 |
|
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
760 |
"Created: / 24-06-2013 / 14:06:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
761 |
"Modified: / 27-08-2013 / 02:38:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
762 |
! |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
763 |
|
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
764 |
test_04 |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
765 |
"JV@2013-10-27: |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
766 |
|
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
767 |
As of 2013-10-27 bytecode compiler generates invalid code |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
768 |
for perform:* with constant symbol. That's because |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
769 |
in Parser, rev 1.781 >> keywordExpressionFor:, line 57 the |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
770 |
selector is reser back to the original, overwriting the one |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
771 |
set by constant-folding method. |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
772 |
" |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
773 |
|
993 | 774 |
self compile: 'mock_04:x ^x perform: #+ with: 2' mode: #bc. |
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
775 |
self assert: (self bc_mock_04:2) == 4 |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
776 |
|
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
777 |
"Created: / 27-08-2013 / 02:37:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
993 | 778 |
"Modified: / 27-08-2013 / 10:32:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
779 |
! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
780 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
781 |
test_05a |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
782 |
"JV@2014-05-23: |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
783 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
784 |
As of 2014-05-23, stc generate wrong code for compilation units |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
785 |
which references symbol AND contains argument declarations for |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
786 |
variable named _<value of that symbol> (given that symbol consist |
1447 | 787 |
of [A-Za-z]). |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
788 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
789 |
The problem is that stc creates per-compilation unit static variable |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
790 |
for the symbol and defines a short accessor in form _<symbol value>. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
791 |
If the function has argumemt with the very same name, the CPP expands |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
792 |
argment name in method signature to the access to the static variable |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
793 |
referencing the symbol object and thus cause syntax error. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
794 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
795 |
NOTE, that problem occurs even if the symbol object is used as a selector |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
796 |
in message send ANYWHERE in the same compilation unit. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
797 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
798 |
Bytecode compiler, however, handles this correctly, so this problem |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
799 |
will manifest itself by uncompilable code once checked out and |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
800 |
compled by STC. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
801 |
" |
1447 | 802 |
#(bc stc) do:[:mode | |
803 |
self compile: 'at: _key |
|
804 |
^ #key' mode: mode. |
|
805 |
self assert: (self perform: (mode , '_at:') asSymbol with: 2) == #key. |
|
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
806 |
] |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
807 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
808 |
"Created: / 23-05-2014 / 14:33:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
809 |
"Modified (comment): / 23-05-2014 / 16:11:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
810 |
! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
811 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
812 |
test_05b |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
813 |
"JV@2014-05-23: |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
814 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
815 |
As of 2014-05-23, stc generate wrong code for compilation units |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
816 |
which references symbol AND contains local variable declarations for |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
817 |
variable named _<value of that symbol> (given that symbol consist |
1447 | 818 |
of [A-Za-z]. |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
819 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
820 |
The problem is that local variables in stc code are not a C local variables |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
821 |
but rather accessed indirectly using __context[offset]. As a courtesy to a problammer, |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
822 |
original variable name is a #define expaning to this context-accessing expression. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
823 |
If there's a symbol with conflicitng name, the #define which is used to access it |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
824 |
is overriden by #define for local variable, causing bad return value of the method. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
825 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
826 |
Bytecode compiler, however, handles this correctly, so this problem |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
827 |
will manifest itself when recompiled by STC and run. Even worse, in debugger |
1447 | 828 |
printit you'll get correct answer and well as if you recompile. |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
829 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
830 |
" |
1447 | 831 |
#(bc stc) do:[:mode | |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
832 |
self compile: 'at: arg |
1447 | 833 |
| _key | |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
834 |
|
1447 | 835 |
_key := arg. |
836 |
^ #key' mode: mode. |
|
837 |
self assert: (self perform: (mode , '_at:') asSymbol with: 2) == #key. |
|
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
838 |
] |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
839 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
840 |
"Created: / 23-05-2014 / 14:33:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
841 |
"Modified (comment): / 23-05-2014 / 16:16:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
842 |
! ! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
843 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
844 |
!CompilerTests2 methodsFor:'tests - FFI'! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
845 |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
846 |
test_external_function_call_01a |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
847 |
"Test for stx bug for <cdecl> specs like |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
848 |
|
1928 | 849 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
850 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
851 |
i.e., when custom subclass of ExternalAddress is in namespace." |
1447 | 852 |
|
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
853 |
| malloc free | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
854 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
855 |
malloc := 'malloc: size |
1928 | 856 |
<cdecl: const RegressionTests::CompilerTests2ExternalBytes "malloc" ( int ) module: ''librun.so''> |
857 |
self primitiveFailed'. |
|
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
858 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
859 |
free := 'free: ptr |
1928 | 860 |
<cdecl: const void "free" ( RegressionTests::CompilerTests2ExternalBytes ) module: ''librun.so''> |
861 |
self primitiveFailed'. |
|
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
862 |
|
1447 | 863 |
#( #bc #stc ) do:[:mode | |
1928 | 864 |
| ptr | |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
865 |
|
1928 | 866 |
self compile:malloc mode:mode. |
867 |
self compile:free mode:mode. |
|
868 |
ptr := self perform:(mode , '_malloc:') asSymbol with:1. |
|
869 |
self assert:ptr class == RegressionTests::CompilerTests2ExternalBytes. |
|
870 |
self perform:(mode , '_free:') asSymbol with:ptr. |
|
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
871 |
] |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
872 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
873 |
"Created: / 06-01-2014 / 11:29:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1201
717489c30ebd
Added missing class CompilerTests2ExternalBytes - required by FFI test
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1163
diff
changeset
|
874 |
"Modified: / 20-09-2014 / 21:51:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1928 | 875 |
"Modified: / 11-05-2018 / 13:45:11 / stefan" |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
876 |
! |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
877 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
878 |
test_external_function_call_01b |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
879 |
"Test for stx bug for <cdecl> specs like |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
880 |
|
1928 | 881 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
882 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
883 |
i.e., when custom subclass of ExternalAddress is in namespace." |
1447 | 884 |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
885 |
| malloc free | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
886 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
887 |
malloc := 'malloc: size |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
888 |
<cdecl: const RegressionTests::CompilerTests2ExternalBytes "malloc" ( int ) module: ''librun''> |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
889 |
self primitive failed'. |
1928 | 890 |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
891 |
free := 'free: ptr |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
892 |
<cdecl: const void "free" ( RegressionTests::CompilerTests2ExternalBytes ) module: ''librun''> |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
893 |
self primitive failed'. |
1447 | 894 |
#( #bc #stc ) do:[:mode | |
1928 | 895 |
| ptr | |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
896 |
|
1928 | 897 |
self compile:malloc mode:mode. |
898 |
self compile:free mode:mode. |
|
899 |
ptr := self perform:(mode , '_malloc:') asSymbol with:1. |
|
900 |
self assert:ptr class == RegressionTests::CompilerTests2ExternalBytes. |
|
901 |
self perform:(mode , '_free:') asSymbol with:ptr. |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
902 |
] |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
903 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
904 |
"Created: / 06-01-2014 / 11:29:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
905 |
"Modified: / 20-09-2014 / 21:51:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1928 | 906 |
"Modified: / 11-05-2018 / 13:44:09 / stefan" |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
907 |
! |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
908 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
909 |
test_external_function_call_01c |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
910 |
"Test for stx bug for <cdecl> specs like |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
911 |
|
1928 | 912 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
913 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
914 |
i.e., when custom subclass of ExternalAddress is in namespace." |
1447 | 915 |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
916 |
| malloc free | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
917 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
918 |
malloc := 'malloc: size |
1928 | 919 |
<cdecl: const RegressionTests::CompilerTests2ExternalBytes "malloc" ( int )> |
920 |
self primitiveFailed'. |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
921 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
922 |
free := 'free: ptr |
1928 | 923 |
<cdecl: const void "free" ( RegressionTests::CompilerTests2ExternalBytes)> |
924 |
self primitiveFailed'. |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
925 |
|
1447 | 926 |
#( #bc #stc ) do:[:mode | |
1928 | 927 |
| ptr | |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
928 |
|
1928 | 929 |
self compile:malloc mode:mode. |
930 |
self compile:free mode:mode. |
|
931 |
ptr := self perform:(mode , '_malloc:') asSymbol with:1. |
|
932 |
self assert:ptr class == RegressionTests::CompilerTests2ExternalBytes. |
|
933 |
self perform:(mode , '_free:') asSymbol with:ptr. |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
934 |
] |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
935 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
936 |
"Created: / 06-01-2014 / 11:29:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
937 |
"Modified: / 20-09-2014 / 21:51:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1928 | 938 |
"Modified: / 11-05-2018 / 13:45:47 / stefan" |
784 | 939 |
! ! |
940 |
||
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
941 |
!CompilerTests2 methodsFor:'tests - arg & var names'! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
942 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
943 |
test_argAndVarNames_01 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
944 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
945 |
#(bc jit stc) do:[:mode | |
1447 | 946 |
savedContextArgAndVarNames := nil. |
947 |
self compile: (self class >> #method_argAndVarNames_01) source mode: mode. |
|
948 |
self perform: (mode , '_method_argAndVarNames_01') asSymbol. |
|
949 |
self assert: savedContextArgAndVarNames = #(each isEven). |
|
950 |
self assert: savedContextArgAndVarValues = #(4 true) |
|
951 |
||
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
952 |
] |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
953 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
954 |
"Created: / 20-08-2013 / 09:05:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
955 |
"Modified: / 26-09-2014 / 15:02:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
956 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
957 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
958 |
test_argAndVarNames_02 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
959 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
960 |
#(bc jit stc) do:[:mode | |
1447 | 961 |
savedContextArgAndVarNames := nil. |
962 |
self compile: (self class >> #method_argAndVarNames_02) source mode: mode. |
|
963 |
self perform: (mode , '_method_argAndVarNames_02') asSymbol. |
|
964 |
self assert: savedContextArgAndVarNames = #(each isEven). |
|
965 |
self assert: savedContextArgAndVarValues = #(4 true) |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
966 |
] |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
967 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
968 |
"Created: / 20-08-2013 / 09:17:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
969 |
"Modified: / 26-09-2014 / 15:02:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
970 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
971 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
972 |
test_argAndVarNames_03 |
1247
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
973 |
"/ CG: this test tries to access the context of a block. |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
974 |
"/ however, the block is an inlined ifTrue block, so its block local gets |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
975 |
"/ lifted to its home context. |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
976 |
"/ It is questionable if the test is right. |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
977 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
978 |
#(bc jit stc) do:[:mode | |
1447 | 979 |
savedContextArgAndVarNames := nil. |
980 |
self compile: (self class >> #method_argAndVarNames_03) source mode: mode. |
|
981 |
self perform: (mode , '_method_argAndVarNames_03') asSymbol. |
|
982 |
self assert: savedContextArgAndVarNames = #(ttt). |
|
983 |
self assert: savedContextArgAndVarValues = #(123) |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
984 |
] |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
985 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
986 |
"Created: / 20-08-2013 / 09:23:03 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
987 |
"Modified: / 26-09-2014 / 15:03:27 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
988 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
989 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
990 |
test_argAndVarNames_04 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
991 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
992 |
#(bc jit stc) do:[:mode | |
1447 | 993 |
savedContextArgAndVarNames := nil. |
994 |
self compile: (self class >> #method_argAndVarNames_04) source mode: mode. |
|
995 |
self perform: (mode , '_method_argAndVarNames_04') asSymbol. |
|
996 |
self assert: savedContextArgAndVarNames = #(each isEven isOddNot). |
|
997 |
self assert: savedContextArgAndVarValues = #(4 true true). |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
998 |
] |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
999 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1000 |
"Created: / 20-08-2013 / 10:12:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1001 |
"Modified: / 26-09-2014 / 15:04:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1002 |
! |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1003 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1004 |
test_argAndVarNames_05 |
1247
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1005 |
"/ CG: this test tries to access the context of a block. |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1006 |
"/ however, the block is an inlined to:do: block, so its block local gets |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1007 |
"/ lifted to its home context. |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1008 |
"/ It is questionable if the test is right. |
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1009 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1010 |
#(bc jit stc) do:[:mode | |
1447 | 1011 |
savedContextArgAndVarNames := nil. |
1012 |
self compile: (self class >> #method_argAndVarNames_05) source mode: mode. |
|
1013 |
self perform: (mode , '_method_argAndVarNames_05') asSymbol. |
|
1014 |
self assert: savedContextArgAndVarNames = #(len i local1 local2). |
|
1015 |
self assert: savedContextArgAndVarValues = #(5 1 #local1 42) |
|
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1016 |
] |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1017 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1018 |
"Created: / 22-08-2013 / 15:49:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1019 |
"Modified: / 26-09-2014 / 15:05:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1020 |
! |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1021 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1022 |
test_argAndVarNames_06 |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1023 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1024 |
#(bc jit stc) do:[:mode | |
1447 | 1025 |
savedContextArgAndVarNames := nil. |
1026 |
self compile: (self class >> #method_argAndVarNames_06) source mode: mode. |
|
1027 |
self perform: (mode , '_method_argAndVarNames_06') asSymbol. |
|
1028 |
self assert: savedContextArgAndVarNames = #(clsnm attributes cls superDef superNm). |
|
1029 |
self assert: savedContextArgAndVarValues = { |
|
1030 |
self class name. |
|
1031 |
#(#autoload). |
|
1032 |
self class. |
|
1033 |
Smalltalk at: #stx_goodies_sunit. |
|
1034 |
self class superclass name. |
|
1035 |
} |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1036 |
|
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1037 |
] |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1038 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1039 |
"Created: / 20-09-2013 / 11:44:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1040 |
"Modified: / 26-09-2014 / 15:09:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1041 |
! ! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1042 |
|
899 | 1043 |
!CompilerTests2 methodsFor:'tests - line numbers'! |
1044 |
||
1045 |
test_lineno_01_bci |
|
1046 |
| m002 m300 l | |
|
1047 |
||
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1048 |
m002 := self compile: (self class >> #method_lineno_002) source mode: #bc. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1049 |
m300 := self compile: (self class >> #method_lineno_300) source mode: #bc. |
899 | 1050 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1051 |
self assert: (l := self bc_method_lineno_002) == 2. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1052 |
self assert: (l := self bc_method_lineno_300) == 300. |
899 | 1053 |
|
1054 |
self assert: m002 code isNil. |
|
1055 |
self assert: m300 code isNil. |
|
1056 |
||
1057 |
"Created: / 12-04-2013 / 21:24:59 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1058 |
"Modified: / 25-04-2013 / 15:24:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 | 1059 |
! |
1060 |
||
1061 |
test_lineno_01_jit |
|
1062 |
| m002 m300 l | |
|
1063 |
||
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1064 |
m002 := self compile: (self class >> #method_lineno_002) source mode: #jit. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1065 |
m300 := self compile: (self class >> #method_lineno_300) source mode: #jit. |
899 | 1066 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1067 |
self assert: (l := self jit_method_lineno_002) == 2. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1068 |
self assert: (l := self jit_method_lineno_300) == 300. |
899 | 1069 |
|
929
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1070 |
self assert: m002 code notNil. |
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1071 |
self assert: m300 code notNil. |
899 | 1072 |
|
1073 |
"Created: / 12-04-2013 / 21:41:22 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
929
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1074 |
"Modified: / 10-05-2013 / 18:23:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 | 1075 |
! |
1076 |
||
1077 |
test_lineno_01_stc |
|
1078 |
| m002 m300 l | |
|
1079 |
||
1080 |
m002 := self class >> #method_lineno_002. |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1081 |
m300 := self class >> #method_lineno_300. |
899 | 1082 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1083 |
self compile: m002 source mode: #stc. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1084 |
self compile: m300 source mode: #stc. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1085 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1086 |
self assert: (l := self stc_method_lineno_002) == 2. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1087 |
self assert: (l := self stc_method_lineno_300) == 300. |
899 | 1088 |
|
1089 |
"Created: / 12-04-2013 / 21:50:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1090 |
"Modified: / 25-04-2013 / 15:22:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 | 1091 |
! ! |
1092 |
||
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1093 |
!CompilerTests2 methodsFor:'tests - literals'! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1094 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1095 |
test_literals_array_01a |
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1096 |
| m l_stc l_bc | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1097 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1098 |
m := self class >> #method_literals_array_01a. |
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1099 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1100 |
self compile: m source mode: #stc. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1101 |
self compile: m source mode: #bc. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1102 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1103 |
l_stc := self stc_method_literals_array_01a. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1104 |
l_bc := self bc_method_literals_array_01a. |
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1105 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1106 |
self assert: l_stc = l_bc. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1107 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1108 |
"Created: / 20-01-2014 / 13:46:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1109 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1110 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1111 |
test_literals_array_01a_bc |
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1112 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1113 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1114 |
m := self class >> #method_literals_array_01a. |
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1115 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1116 |
self compile: m source mode: #bc. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1117 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1118 |
l := self bc_method_literals_array_01a. |
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1119 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1120 |
self assert: l size == 3. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1121 |
self assert: l first == #'_XXX:_:'. |
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1122 |
self assert: l second == #'YYY'. |
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1123 |
self assert: l third == #'_XXX:_:'. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1124 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1125 |
"Created: / 20-01-2014 / 13:42:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1126 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1127 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1128 |
test_literals_array_01a_stc |
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1129 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1130 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1131 |
m := self class >> #method_literals_array_01a. |
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1132 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1133 |
self compile: m source mode: #stc. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1134 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1135 |
l := self stc_method_literals_array_01a. |
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1136 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1137 |
self assert: l size == 3. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1138 |
self assert: l first == #'_XXX:_:'. |
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1139 |
self assert: l second == #'YYY'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1140 |
self assert: l third == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1141 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1142 |
"Created: / 20-01-2014 / 13:40:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1143 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1144 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1145 |
test_literals_array_01b |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1146 |
| m l_stc l_bc | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1147 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1148 |
m := self class >> #method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1149 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1150 |
self compile: m source mode: #stc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1151 |
self compile: m source mode: #bc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1152 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1153 |
l_stc := self stc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1154 |
l_bc := self bc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1155 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1156 |
self assert: l_stc = l_bc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1157 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1158 |
"Created: / 20-01-2014 / 13:46:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1159 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1160 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1161 |
test_literals_array_01b_bc |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1162 |
| m l | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1163 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1164 |
m := self class >> #method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1165 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1166 |
self compile: m source mode: #bc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1167 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1168 |
l := self bc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1169 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1170 |
self assert: l size == 3. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1171 |
self assert: l first == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1172 |
self assert: l second == #'YYY'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1173 |
self assert: l third == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1174 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1175 |
"Created: / 20-01-2014 / 13:42:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1176 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1177 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1178 |
test_literals_array_01b_stc |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1179 |
| m l | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1180 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1181 |
m := self class >> #method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1182 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1183 |
self compile: m source mode: #stc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1184 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1185 |
l := self stc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1186 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1187 |
self assert: l size == 3. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1188 |
self assert: l first == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1189 |
self assert: l second == #'YYY'. |
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1190 |
self assert: l third == #'_XXX:_:'. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1191 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1192 |
"Created: / 20-01-2014 / 13:40:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1193 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1194 |
|
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1195 |
test_literals_negativeZero_bc |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1196 |
| m l | |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1197 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1198 |
m := self class >> #method_negativeZero_01. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1199 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1200 |
self compile: m source mode: #bc. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1201 |
|
1273
0afeacccdc89
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1272
diff
changeset
|
1202 |
l := self bc_method_negativeZero_01. |
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1203 |
self assert: l = 0.0. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1204 |
self assert: l isNegativeZero. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1205 |
! |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1206 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1207 |
test_literals_negativeZero_stc |
1272
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1208 |
| m negZero | |
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1209 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1210 |
m := self class >> #method_negativeZero_01. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1211 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1212 |
self compile: m source mode: #stc. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1213 |
|
1272
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1214 |
negZero := self stc_method_negativeZero_01. |
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1215 |
self assert: negZero = 0.0. |
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1216 |
self assert: negZero isNegativeZero. |
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1217 |
! |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1218 |
|
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1219 |
test_literals_symbol_01_bc |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1220 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1221 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1222 |
m := self class >> #method_literals_symbol_01. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1223 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1224 |
self compile: m source mode: #bc. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1225 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1226 |
l := self bc_method_literals_symbol_01. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1227 |
self assert: l == #'_XXX:_:'. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1228 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1229 |
"Created: / 20-01-2014 / 13:44:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1230 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1231 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1232 |
test_literals_symbol_01_stc |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1233 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1234 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1235 |
m := self class >> #method_literals_symbol_01. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1236 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1237 |
self compile: m source mode: #stc. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1238 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1239 |
l := self stc_method_literals_symbol_01. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1240 |
self assert: l == #'_XXX:_:'. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1241 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1242 |
"Created: / 20-01-2014 / 13:44:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1243 |
! ! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1244 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1245 |
!CompilerTests2 methodsFor:'tests - method slot'! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1246 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1247 |
test_methodslot_01_bci |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1248 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1249 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1250 |
m := self compile: (self class >> #method_methodslot_01:) source mode: #bc. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1251 |
self bc_method_methodslot_01: m. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1252 |
self assert: m code isNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1253 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1254 |
"Created: / 25-04-2013 / 15:33:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1255 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1256 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1257 |
test_methodslot_01_jit |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1258 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1259 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1260 |
m := self compile: (self class >> #method_methodslot_01:) source mode: #jit. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1261 |
self jit_method_methodslot_01: m. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1262 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1263 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1264 |
"Created: / 25-04-2013 / 15:34:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1265 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1266 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1267 |
test_methodslot_01_stc |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1268 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1269 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1270 |
m := self compile: (self class >> #method_methodslot_01:) source mode: #stc. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1271 |
self stc_method_methodslot_01: m. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1272 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1273 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1274 |
"Created: / 25-04-2013 / 15:34:41 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1275 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1276 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1277 |
test_methodslot_02_bci |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1278 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1279 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1280 |
m := self compile: (self class >> #method_methodslot_02:) source mode: #bc. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1281 |
self bc_method_methodslot_02: m. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1282 |
self assert: m code isNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1283 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1284 |
"Created: / 25-04-2013 / 15:36:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1285 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1286 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1287 |
test_methodslot_02_jit |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1288 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1289 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1290 |
m := self compile: (self class >> #method_methodslot_02:) source mode: #jit. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1291 |
self jit_method_methodslot_02: m. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1292 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1293 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1294 |
"Created: / 25-04-2013 / 15:37:10 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1295 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1296 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1297 |
test_methodslot_02_stc |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1298 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1299 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1300 |
m := self compile: (self class >> #method_methodslot_02:) source mode: #stc. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1301 |
self stc_method_methodslot_02: m. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1302 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1303 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1304 |
"Created: / 25-04-2013 / 15:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1305 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1306 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1307 |
test_methodslot_03_bci |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1308 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1309 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1310 |
m := self compile: (self class >> #method_methodslot_03:) source mode: #bc. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1311 |
self bc_method_methodslot_03: m. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1312 |
self assert: m code isNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1313 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1314 |
"Created: / 25-04-2013 / 15:39:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1315 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1316 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1317 |
test_methodslot_03_jit |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1318 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1319 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1320 |
m := self compile: (self class >> #method_methodslot_03:) source mode: #jit. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1321 |
self jit_method_methodslot_03: m. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1322 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1323 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1324 |
"Created: / 25-04-2013 / 15:39:32 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1325 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1326 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1327 |
test_methodslot_03_stc |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1328 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1329 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1330 |
m := self compile: (self class >> #method_methodslot_03:) source mode: #stc. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1331 |
self stc_method_methodslot_03: m. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1332 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1333 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1334 |
"Created: / 25-04-2013 / 15:39:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1335 |
! ! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1336 |
|
784 | 1337 |
!CompilerTests2 class methodsFor:'documentation'! |
1338 |
||
1339 |
version |
|
1340 |
^ '$Header$' |
|
1341 |
! |
|
1342 |
||
1343 |
version_CVS |
|
1344 |
^ '$Header$' |
|
1345 |
! |
|
1346 |
||
1347 |
version_SVN |
|
929
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1348 |
^ '$Id$' |
784 | 1349 |
! ! |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
1350 |