author | Claus Gittinger <cg@exept.de> |
Thu, 17 May 2018 23:12:11 +0200 | |
changeset 1935 | 0b014f108ad8 |
parent 1928 | a7e400e70e65 |
child 2182 | abba80b6780f |
permissions | -rw-r--r-- |
1928 | 1 |
"{ Encoding: utf8 }" |
2 |
||
1447 | 3 |
"{ Package: 'stx:goodies/regression' }" |
784 | 4 |
|
5 |
"{ NameSpace: RegressionTests }" |
|
6 |
||
7 |
TestCase subclass:#CompilerTests2 |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
8 |
instanceVariableNames:'methods enabledJIT savedContext savedContextArgAndVarNames |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
9 |
savedContextArgAndVarValues savedContextArgAndVarValuesUsingEval |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
10 |
savedContextLine' |
784 | 11 |
classVariableNames:'' |
12 |
poolDictionaries:'' |
|
1163 | 13 |
category:'tests-Regression-Compilers' |
784 | 14 |
! |
15 |
||
16 |
||
1928 | 17 |
!CompilerTests2 class methodsFor:'settings'! |
18 |
||
19 |
libraryName |
|
20 |
^ 'librun' |
|
21 |
||
22 |
"Created: / 11-05-2018 / 13:50:32 / stefan" |
|
23 |
! ! |
|
24 |
||
899 | 25 |
!CompilerTests2 methodsFor:'private'! |
26 |
||
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
27 |
assertSendersMethodIsIdenticalTo: sendersMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
28 |
"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
|
29 |
in between" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
30 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
31 |
self assertSendersSendersMethodIsIdenticalTo: sendersMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
32 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
33 |
"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
|
34 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
35 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
36 |
assertSendersSendersMethodIsIdenticalTo: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
37 |
| ctx m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
38 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
39 |
ctx := thisContext sender sender. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
40 |
"/ 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
|
41 |
"/ if it is not set!! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
42 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
43 |
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
|
44 |
self assert: m == thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
45 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
46 |
"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
|
47 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
48 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
49 |
compile: source mode: mode |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
50 |
"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
|
51 |
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
|
52 |
(i.e., foo -> stc_foo). |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
53 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
54 |
If mode is: |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
55 |
#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
|
56 |
#jit....then the method is bytecode compiled and left |
1447 | 57 |
to the jitter |
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
58 |
#bc.....them the method is bytecode compiled and marked |
1447 | 59 |
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
|
60 |
" |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
61 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
62 |
| m | |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
63 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
64 |
Class withoutUpdatingChangesDo:[ |
1447 | 65 |
mode == #stc ifTrue:[ |
66 |
ParserFlags withSTCCompilation:#always do:[ |
|
67 |
m := self class compile: (mode, '_', source) classified: 'private - *dynamic*'. |
|
68 |
]. |
|
69 |
] ifFalse:[ |
|
70 |
ParserFlags withSTCCompilation:#never do:[ |
|
71 |
m := self class compile: (mode, '_', source) classified: 'private - *dynamic*'. |
|
72 |
m checked: (mode == #bc) |
|
73 |
]. |
|
74 |
]. |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
75 |
]. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
76 |
methods add: m. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
77 |
^m |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
78 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
79 |
"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
|
80 |
! |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
81 |
|
899 | 82 |
currentLineNumber |
900
7acbd0cce153
Call fixAllLineNumbers, otherwise linenos are invalid.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
899
diff
changeset
|
83 |
thisContext fixAllLineNumbers. |
7acbd0cce153
Call fixAllLineNumbers, otherwise linenos are invalid.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
899
diff
changeset
|
84 |
^thisContext sender lineNumber. |
899 | 85 |
|
86 |
"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
|
87 |
"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
|
88 |
! |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
89 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
90 |
saveContext |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
91 |
self saveContext: thisContext sender. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
92 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
93 |
"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
|
94 |
! |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
95 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
96 |
saveContext: aContext |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
97 |
savedContext := aContext. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
98 |
savedContextArgAndVarNames := savedContext argAndVarNames asArray. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
99 |
savedContextArgAndVarValues := savedContext argsAndVars. |
1447 | 100 |
savedContextArgAndVarValuesUsingEval := savedContextArgAndVarNames |
101 |
collect:[ :each | |
|
102 |
Compiler evaluate:each |
|
103 |
in:savedContext |
|
104 |
receiver:savedContext receiver |
|
105 |
notifying:nil |
|
106 |
logged:false |
|
107 |
ifFail:[ '*Error when evaluating*']. |
|
108 |
]. |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
109 |
savedContextLine := savedContext lineNumber. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
110 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
111 |
self assert: savedContextArgAndVarNames size == savedContextArgAndVarValues size. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
112 |
self assert: savedContextArgAndVarNames size == savedContextArgAndVarValuesUsingEval size. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
113 |
|
1447 | 114 |
1 to: savedContextArgAndVarNames size do:[:i | |
115 |
| v1 v2 | |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
116 |
|
1447 | 117 |
v1 := savedContextArgAndVarValues at: i. |
118 |
v2 := savedContextArgAndVarValuesUsingEval at: i. |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
119 |
|
1447 | 120 |
self assert: v1 == v2. "HAS to be IDENTICAL" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
121 |
]. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
122 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
123 |
"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
|
124 |
"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
|
125 |
! ! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
126 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
127 |
!CompilerTests2 methodsFor:'private-mock methods'! |
899 | 128 |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
129 |
method_argAndVarNames_01 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
130 |
#(1 2 3 4) select:[:each | |
1447 | 131 |
| isEven | |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
132 |
|
1447 | 133 |
isEven := each even. |
134 |
self saveContext. |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
135 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
136 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
137 |
"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
|
138 |
"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
|
139 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
140 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
141 |
method_argAndVarNames_02 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
142 |
#(1 2 3 4) select:[:each | |
1928 | 143 |
| isEven | |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
144 |
|
1928 | 145 |
'1234' select:[:char | |
146 |
| someOtherLocal | |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
147 |
|
1928 | 148 |
someOtherLocal := char == $1. |
149 |
]. |
|
150 |
isEven := each even. |
|
151 |
self saveContext. |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
152 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
153 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
154 |
"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
|
155 |
"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
|
156 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
157 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
158 |
method_argAndVarNames_03 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
159 |
"Reported by Stefan" |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
160 |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
161 |
savedContextArgAndVarNames := 1. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
162 |
(Smalltalk isStandAloneApp | (savedContextArgAndVarNames == 1)) ifTrue:[ |
1447 | 163 |
| ttt | |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
164 |
|
1447 | 165 |
ttt := 123. |
166 |
self saveContext. |
|
1149
e394c5dbf746
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1138
diff
changeset
|
167 |
]. |
e394c5dbf746
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1138
diff
changeset
|
168 |
self halt. |
1447 | 169 |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
170 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
171 |
" |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
172 |
CompilerTests2 basicNew method_argAndVarNames_03 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
173 |
" |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
174 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
175 |
"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
|
176 |
"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
|
177 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
178 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
179 |
method_argAndVarNames_04 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
180 |
#(1 2 3 4) select:[:each | |
1447 | 181 |
| isEven | |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
182 |
|
1447 | 183 |
isEven := each even. |
184 |
isEven ifTrue:[ |
|
185 |
| isOddNot | |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
186 |
|
1447 | 187 |
isOddNot := each odd not. |
188 |
self saveContext. |
|
189 |
] |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
190 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
191 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
192 |
"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
|
193 |
"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
|
194 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
195 |
|
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
196 |
method_argAndVarNames_05 |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
197 |
| b | |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
198 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
199 |
b := [:len | |
1447 | 200 |
1 to: len do:[:i| |
201 |
| local1 local2 | |
|
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
202 |
|
1447 | 203 |
local1 := #local1. |
204 |
local2 := 42. |
|
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
205 |
|
1447 | 206 |
i == 1 ifTrue:[ |
207 |
self saveContext. |
|
208 |
] |
|
209 |
] |
|
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
210 |
]. |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
211 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
212 |
b value: 5 |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
213 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
214 |
" |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
215 |
CompilerTests2 basicNew method_argAndVarNames_05 |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
216 |
" |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
217 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
218 |
"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
|
219 |
"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
|
220 |
! |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
221 |
|
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
222 |
method_argAndVarNames_06 |
1462 | 223 |
(Smalltalk at:#stx_goodies_regression) classNamesAndAttributesDo:[:clsnm :attributes| |
1447 | 224 |
| cls | |
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
225 |
|
1447 | 226 |
cls := Smalltalk at: clsnm. |
227 |
((Array with: self class) includes: cls) ifTrue:[ |
|
228 |
(attributes includes: #autoload) ifTrue:[ |
|
229 |
"/ Care for Object!! |
|
230 |
cls superclass notNil ifTrue:[ |
|
231 |
| superDef superNm | |
|
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
232 |
|
1447 | 233 |
superDef := ProjectDefinition definitionClassForPackage: cls superclass package. |
234 |
superNm := cls superclass name. |
|
235 |
self saveContext. |
|
236 |
^ self |
|
237 |
]. |
|
238 |
]. |
|
239 |
]. |
|
240 |
]. |
|
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
241 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
242 |
" |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
243 |
CompilerTests2 basicNew method_argAndVarNames_06 |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
244 |
" |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
245 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
246 |
"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
|
247 |
"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
|
248 |
! |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
249 |
|
899 | 250 |
method_lineno_002 |
251 |
1 factorial. ^self currentLineNumber |
|
252 |
||
253 |
"Created: / 12-04-2013 / 21:22:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
254 |
! |
|
255 |
||
256 |
method_lineno_300 |
|
257 |
"DO NOT MAKE THIS METHOD SHORTER, DO NOT REMOVE BLANK LINES!!!!!!" |
|
258 |
||
259 |
||
260 |
||
261 |
||
262 |
||
263 |
||
264 |
||
265 |
||
266 |
||
267 |
||
268 |
||
269 |
||
270 |
||
271 |
||
272 |
||
273 |
||
274 |
||
275 |
||
276 |
||
277 |
||
278 |
||
279 |
||
280 |
||
281 |
||
282 |
||
283 |
||
284 |
||
285 |
||
286 |
||
287 |
||
288 |
||
289 |
||
290 |
||
291 |
||
292 |
||
293 |
||
294 |
||
295 |
||
296 |
||
297 |
||
298 |
||
299 |
||
300 |
||
301 |
||
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 |
^self currentLineNumber |
|
556 |
||
557 |
"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
|
558 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
559 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
560 |
method_literals_array_01a |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
561 |
| literal | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
562 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
563 |
literal := #( |
1447 | 564 |
_XXX:_: |
565 |
YYY |
|
566 |
_XXX:_: |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
567 |
). |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
568 |
^ literal |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
569 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
570 |
"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
|
571 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
572 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
573 |
method_literals_array_01b |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
574 |
| literal | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
575 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
576 |
literal := #( |
1447 | 577 |
#'_XXX:_:' |
578 |
#'YYY' |
|
579 |
#'_XXX:_:' |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
580 |
). |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
581 |
^ literal |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
582 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
583 |
"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
|
584 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
585 |
|
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
586 |
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
|
587 |
| literal | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
588 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
589 |
literal := #_XXX:_:. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
590 |
^ literal. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
591 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
592 |
"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
|
593 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
594 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
595 |
method_methodslot_01: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
596 |
self assertSendersMethodIsIdenticalTo: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
597 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
598 |
"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
|
599 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
600 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
601 |
method_methodslot_02: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
602 |
[ self assertSendersMethodIsIdenticalTo: thisMethod ] |
1447 | 603 |
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
|
604 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
605 |
"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
|
606 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
607 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
608 |
method_methodslot_03: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
609 |
"Deep block nesting...." |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
610 |
[ |
1447 | 611 |
[ |
612 |
[ |
|
613 |
[ |
|
614 |
self assertSendersMethodIsIdenticalTo: thisMethod |
|
615 |
] valueWithArguments:#() "/ don't use #value, it gets optimized!! |
|
616 |
] valueWithArguments:#() "/ don't use #value, it gets optimized!! |
|
617 |
] 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
|
618 |
] 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
|
619 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
620 |
"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
|
621 |
! |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
622 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
623 |
method_negativeZero_01 |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
624 |
| literal | |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
625 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
626 |
literal := -0.0. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
627 |
^ literal. |
899 | 628 |
! ! |
629 |
||
784 | 630 |
!CompilerTests2 methodsFor:'setup'! |
631 |
||
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
632 |
setUp |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
633 |
methods := Set new. |
930
78e2acffdea6
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
929
diff
changeset
|
634 |
enabledJIT := ObjectMemory justInTimeCompilation:true. |
1447 | 635 |
savedContext := savedContextArgAndVarNames |
636 |
:= savedContextArgAndVarValues := savedContextArgAndVarValuesUsingEval |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
637 |
:= savedContextLine := '* Not assigned *'. |
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
638 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
639 |
"Created: / 25-04-2013 / 15:20:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
640 |
"Modified: / 26-09-2014 / 13:00:31 / 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
|
641 |
! |
784 | 642 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
643 |
tearDown |
1447 | 644 |
savedContext := savedContextArgAndVarNames |
645 |
:= savedContextArgAndVarValues := savedContextArgAndVarValuesUsingEval |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
646 |
:= savedContextLine := nil. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
647 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
648 |
ObjectMemory justInTimeCompilation: enabledJIT. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
649 |
Class withoutUpdatingChangesDo:[ |
1447 | 650 |
| classesToRemove | |
1462 | 651 |
(Smalltalk at: #'stx_goodies_regression_testData_CompilerTests2') notNil ifTrue:[ |
652 |
(Smalltalk at: #'stx_goodies_regression_testData_CompilerTests2') classes do:[:e| |
|
1447 | 653 |
e notNil ifTrue:[ |
654 |
Smalltalk removeClass: e |
|
655 |
]. |
|
656 |
]. |
|
657 |
]. |
|
658 |
Smalltalk allClassesDo:[:cls| |
|
659 |
(#( |
|
660 |
'stx:goodies/regression/testData/CompilerTests2' |
|
661 |
"/Add more... |
|
662 |
) includes: cls package) ifTrue:[ |
|
663 |
Smalltalk removeClass: cls |
|
664 |
] |
|
665 |
]. |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
666 |
|
1447 | 667 |
methods do:[:m| |
668 |
m mclass removeSelector: m selector. |
|
669 |
] |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
670 |
] |
784 | 671 |
|
672 |
"Created: / 26-10-2012 / 11:32:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
673 |
"Modified: / 26-09-2014 / 12:59:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
784 | 674 |
! ! |
675 |
||
676 |
!CompilerTests2 methodsFor:'tests'! |
|
677 |
||
678 |
test_01 |
|
823 | 679 |
"JV@2012-10-26: |
784 | 680 |
|
823 | 681 |
When a package is loaded from source using |
784 | 682 |
|
1447 | 683 |
Smalltalk loadPackage:'...' |
784 | 684 |
|
823 | 685 |
expression __EVALUATED FROM WORKSPACE__ AND a method from loaded class |
686 |
uses a class from the same package that is not yet loaded (i.e., it will |
|
687 |
be loaded later), |
|
784 | 688 |
|
823 | 689 |
then the compiler as of 2012-10-26 generates access to a workspace variable |
784 | 690 |
instead of access to a global |
691 |
||
692 |
This tests checks for this bug |
|
693 |
" |
|
694 |
||
695 |
| ws | |
|
696 |
||
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
697 |
"/ this test only works with a Display... |
871
098316a54e40
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
870
diff
changeset
|
698 |
self skipIf:[Display isNil] description:'Test requires a Display'. |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
699 |
|
784 | 700 |
"/First, make sure that package is not yet loaded... |
823 | 701 |
self |
1462 | 702 |
assert: (Smalltalk at: #'stx_goodies_regression_testData_CompilerTests2') isNil |
1447 | 703 |
description: 'Mock package already loaded'. |
784 | 704 |
|
705 |
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
|
706 |
ws selectedWorkspace |
1447 | 707 |
autoDefineVariables: #workspace; |
708 |
contents: '(Smalltalk loadPackage: #''stx:goodies/regression/testData/CompilerTests2'')'; |
|
709 |
selectAll; |
|
710 |
doIt. |
|
784 | 711 |
|
823 | 712 |
self assert: (Smalltalk at: #'RegressionTests::CompilerTests2Mock1') new foo class |
1447 | 713 |
== (Smalltalk at: #'RegressionTests::CompilerTests2Mock2') |
784 | 714 |
|
715 |
"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
|
716 |
"Modified: / 24-06-2013 / 15:30:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
784 | 717 |
! |
718 |
||
719 |
test_02 |
|
823 | 720 |
"JV@2012-10-26: |
784 | 721 |
|
823 | 722 |
When a package is loaded from source using |
784 | 723 |
|
1447 | 724 |
Smalltalk loadPackage:'...' |
784 | 725 |
|
823 | 726 |
expression and a method from loaded class in namespace uses a class from the |
727 |
same package and same namespace, that is not yet loaded (i.e., it will be loaded |
|
728 |
later), |
|
784 | 729 |
|
730 |
then the compiler as of 2012-10-26 generates access to class in no namespace. |
|
731 |
||
732 |
This test checks for this bug |
|
733 |
" |
|
734 |
||
735 |
"/First, make sure that package is not yet loaded... |
|
823 | 736 |
self |
1462 | 737 |
assert: (Smalltalk at: #'stx_goodies_regression_testData_CompilerTests2') isNil |
1447 | 738 |
description: 'Mock package already loaded'. |
784 | 739 |
|
823 | 740 |
self |
1447 | 741 |
assert: (Smalltalk loadPackage: #'stx:goodies/regression/testData/CompilerTests2') |
742 |
description: 'Cannot load mock package!!'. |
|
784 | 743 |
|
744 |
||
823 | 745 |
self assert: (Smalltalk at: #'RegressionTests::CompilerTests2Mock1') new foo class |
1447 | 746 |
== (Smalltalk at: #'RegressionTests::CompilerTests2Mock2') |
784 | 747 |
|
748 |
"Created: / 26-10-2012 / 12:26:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
749 |
"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
|
750 |
! |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
751 |
|
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 |
test_03 |
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
753 |
"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
|
754 |
|
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
755 |
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
|
756 |
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
|
757 |
" |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
758 |
|
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
759 |
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
|
760 |
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
|
761 |
|
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
762 |
"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
|
763 |
"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
|
764 |
! |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
765 |
|
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
766 |
test_04 |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
767 |
"JV@2013-10-27: |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
768 |
|
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
769 |
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
|
770 |
for perform:* with constant symbol. That's because |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
771 |
in Parser, rev 1.781 >> keywordExpressionFor:, line 57 the |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
772 |
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
|
773 |
set by constant-folding method. |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
774 |
" |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
775 |
|
993 | 776 |
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
|
777 |
self assert: (self bc_mock_04:2) == 4 |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
778 |
|
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
779 |
"Created: / 27-08-2013 / 02:37:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
993 | 780 |
"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
|
781 |
! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
782 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
783 |
test_05a |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
784 |
"JV@2014-05-23: |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
785 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
786 |
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
|
787 |
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
|
788 |
variable named _<value of that symbol> (given that symbol consist |
1447 | 789 |
of [A-Za-z]). |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
790 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
791 |
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
|
792 |
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
|
793 |
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
|
794 |
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
|
795 |
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
|
796 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
797 |
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
|
798 |
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
|
799 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
800 |
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
|
801 |
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
|
802 |
compled by STC. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
803 |
" |
1447 | 804 |
#(bc stc) do:[:mode | |
805 |
self compile: 'at: _key |
|
806 |
^ #key' mode: mode. |
|
807 |
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
|
808 |
] |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
809 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
810 |
"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
|
811 |
"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
|
812 |
! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
813 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
814 |
test_05b |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
815 |
"JV@2014-05-23: |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
816 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
817 |
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
|
818 |
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
|
819 |
variable named _<value of that symbol> (given that symbol consist |
1447 | 820 |
of [A-Za-z]. |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
821 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
822 |
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
|
823 |
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
|
824 |
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
|
825 |
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
|
826 |
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
|
827 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
828 |
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
|
829 |
will manifest itself when recompiled by STC and run. Even worse, in debugger |
1447 | 830 |
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
|
831 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
832 |
" |
1447 | 833 |
#(bc stc) do:[:mode | |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
834 |
self compile: 'at: arg |
1447 | 835 |
| _key | |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
836 |
|
1447 | 837 |
_key := arg. |
838 |
^ #key' mode: mode. |
|
839 |
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
|
840 |
] |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
841 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
842 |
"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
|
843 |
"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
|
844 |
! ! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
845 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
846 |
!CompilerTests2 methodsFor:'tests - FFI'! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
847 |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
848 |
test_external_function_call_01a |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
849 |
"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
|
850 |
|
1928 | 851 |
<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
|
852 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
853 |
i.e., when custom subclass of ExternalAddress is in namespace." |
1447 | 854 |
|
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
855 |
| malloc free | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
856 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
857 |
malloc := 'malloc: size |
1928 | 858 |
<cdecl: const RegressionTests::CompilerTests2ExternalBytes "malloc" ( int ) module: ''librun.so''> |
859 |
self primitiveFailed'. |
|
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
860 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
861 |
free := 'free: ptr |
1928 | 862 |
<cdecl: const void "free" ( RegressionTests::CompilerTests2ExternalBytes ) module: ''librun.so''> |
863 |
self primitiveFailed'. |
|
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
864 |
|
1447 | 865 |
#( #bc #stc ) do:[:mode | |
1928 | 866 |
| ptr | |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
867 |
|
1928 | 868 |
self compile:malloc mode:mode. |
869 |
self compile:free mode:mode. |
|
870 |
ptr := self perform:(mode , '_malloc:') asSymbol with:1. |
|
871 |
self assert:ptr class == RegressionTests::CompilerTests2ExternalBytes. |
|
872 |
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
|
873 |
] |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
874 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
875 |
"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
|
876 |
"Modified: / 20-09-2014 / 21:51:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1928 | 877 |
"Modified: / 11-05-2018 / 13:45:11 / stefan" |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
878 |
! |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
879 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
880 |
test_external_function_call_01b |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
881 |
"Test for stx bug for <cdecl> specs like |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
882 |
|
1928 | 883 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
884 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
885 |
i.e., when custom subclass of ExternalAddress is in namespace." |
1447 | 886 |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
887 |
| malloc free | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
888 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
889 |
malloc := 'malloc: size |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
890 |
<cdecl: const RegressionTests::CompilerTests2ExternalBytes "malloc" ( int ) module: ''librun''> |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
891 |
self primitive failed'. |
1928 | 892 |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
893 |
free := 'free: ptr |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
894 |
<cdecl: const void "free" ( RegressionTests::CompilerTests2ExternalBytes ) module: ''librun''> |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
895 |
self primitive failed'. |
1447 | 896 |
#( #bc #stc ) do:[:mode | |
1928 | 897 |
| ptr | |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
898 |
|
1928 | 899 |
self compile:malloc mode:mode. |
900 |
self compile:free mode:mode. |
|
901 |
ptr := self perform:(mode , '_malloc:') asSymbol with:1. |
|
902 |
self assert:ptr class == RegressionTests::CompilerTests2ExternalBytes. |
|
903 |
self perform:(mode , '_free:') asSymbol with:ptr. |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
904 |
] |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
905 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
906 |
"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
|
907 |
"Modified: / 20-09-2014 / 21:51:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1928 | 908 |
"Modified: / 11-05-2018 / 13:44:09 / stefan" |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
909 |
! |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
910 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
911 |
test_external_function_call_01c |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
912 |
"Test for stx bug for <cdecl> specs like |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
913 |
|
1928 | 914 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
915 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
916 |
i.e., when custom subclass of ExternalAddress is in namespace." |
1447 | 917 |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
918 |
| malloc free | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
919 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
920 |
malloc := 'malloc: size |
1928 | 921 |
<cdecl: const RegressionTests::CompilerTests2ExternalBytes "malloc" ( int )> |
922 |
self primitiveFailed'. |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
923 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
924 |
free := 'free: ptr |
1928 | 925 |
<cdecl: const void "free" ( RegressionTests::CompilerTests2ExternalBytes)> |
926 |
self primitiveFailed'. |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
927 |
|
1447 | 928 |
#( #bc #stc ) do:[:mode | |
1928 | 929 |
| ptr | |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
930 |
|
1928 | 931 |
self compile:malloc mode:mode. |
932 |
self compile:free mode:mode. |
|
933 |
ptr := self perform:(mode , '_malloc:') asSymbol with:1. |
|
934 |
self assert:ptr class == RegressionTests::CompilerTests2ExternalBytes. |
|
935 |
self perform:(mode , '_free:') asSymbol with:ptr. |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
936 |
] |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
937 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
938 |
"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
|
939 |
"Modified: / 20-09-2014 / 21:51:53 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1928 | 940 |
"Modified: / 11-05-2018 / 13:45:47 / stefan" |
784 | 941 |
! ! |
942 |
||
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
943 |
!CompilerTests2 methodsFor:'tests - arg & var names'! |
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 |
test_argAndVarNames_01 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
946 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
947 |
#(bc jit stc) do:[:mode | |
1447 | 948 |
savedContextArgAndVarNames := nil. |
949 |
self compile: (self class >> #method_argAndVarNames_01) source mode: mode. |
|
950 |
self perform: (mode , '_method_argAndVarNames_01') asSymbol. |
|
951 |
self assert: savedContextArgAndVarNames = #(each isEven). |
|
952 |
self assert: savedContextArgAndVarValues = #(4 true) |
|
953 |
||
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
954 |
] |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
955 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
956 |
"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
|
957 |
"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
|
958 |
! |
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 |
test_argAndVarNames_02 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
961 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
962 |
#(bc jit stc) do:[:mode | |
1447 | 963 |
savedContextArgAndVarNames := nil. |
964 |
self compile: (self class >> #method_argAndVarNames_02) source mode: mode. |
|
965 |
self perform: (mode , '_method_argAndVarNames_02') asSymbol. |
|
966 |
self assert: savedContextArgAndVarNames = #(each isEven). |
|
967 |
self assert: savedContextArgAndVarValues = #(4 true) |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
968 |
] |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
969 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
970 |
"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
|
971 |
"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
|
972 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
973 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
974 |
test_argAndVarNames_03 |
1247
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
975 |
"/ CG: this test tries to access the context of a block. |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
976 |
"/ 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
|
977 |
"/ lifted to its home context. |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
978 |
"/ It is questionable if the test is right. |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
979 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
980 |
#(bc jit stc) do:[:mode | |
1447 | 981 |
savedContextArgAndVarNames := nil. |
982 |
self compile: (self class >> #method_argAndVarNames_03) source mode: mode. |
|
983 |
self perform: (mode , '_method_argAndVarNames_03') asSymbol. |
|
984 |
self assert: savedContextArgAndVarNames = #(ttt). |
|
985 |
self assert: savedContextArgAndVarValues = #(123) |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
986 |
] |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
987 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
988 |
"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
|
989 |
"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
|
990 |
! |
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 |
test_argAndVarNames_04 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
993 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
994 |
#(bc jit stc) do:[:mode | |
1447 | 995 |
savedContextArgAndVarNames := nil. |
996 |
self compile: (self class >> #method_argAndVarNames_04) source mode: mode. |
|
997 |
self perform: (mode , '_method_argAndVarNames_04') asSymbol. |
|
998 |
self assert: savedContextArgAndVarNames = #(each isEven isOddNot). |
|
999 |
self assert: savedContextArgAndVarValues = #(4 true true). |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1000 |
] |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1001 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1002 |
"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
|
1003 |
"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
|
1004 |
! |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1005 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1006 |
test_argAndVarNames_05 |
1247
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1007 |
"/ CG: this test tries to access the context of a block. |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1008 |
"/ 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
|
1009 |
"/ lifted to its home context. |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1010 |
"/ It is questionable if the test is right. |
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1011 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1012 |
#(bc jit stc) do:[:mode | |
1447 | 1013 |
savedContextArgAndVarNames := nil. |
1014 |
self compile: (self class >> #method_argAndVarNames_05) source mode: mode. |
|
1015 |
self perform: (mode , '_method_argAndVarNames_05') asSymbol. |
|
1016 |
self assert: savedContextArgAndVarNames = #(len i local1 local2). |
|
1017 |
self assert: savedContextArgAndVarValues = #(5 1 #local1 42) |
|
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1018 |
] |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1019 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1020 |
"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
|
1021 |
"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
|
1022 |
! |
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 |
test_argAndVarNames_06 |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1025 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1026 |
#(bc jit stc) do:[:mode | |
1447 | 1027 |
savedContextArgAndVarNames := nil. |
1028 |
self compile: (self class >> #method_argAndVarNames_06) source mode: mode. |
|
1029 |
self perform: (mode , '_method_argAndVarNames_06') asSymbol. |
|
1030 |
self assert: savedContextArgAndVarNames = #(clsnm attributes cls superDef superNm). |
|
1031 |
self assert: savedContextArgAndVarValues = { |
|
1032 |
self class name. |
|
1033 |
#(#autoload). |
|
1034 |
self class. |
|
1035 |
Smalltalk at: #stx_goodies_sunit. |
|
1036 |
self class superclass name. |
|
1037 |
} |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1038 |
|
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1039 |
] |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1040 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1041 |
"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
|
1042 |
"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
|
1043 |
! ! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1044 |
|
899 | 1045 |
!CompilerTests2 methodsFor:'tests - line numbers'! |
1046 |
||
1047 |
test_lineno_01_bci |
|
1048 |
| m002 m300 l | |
|
1049 |
||
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1050 |
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
|
1051 |
m300 := self compile: (self class >> #method_lineno_300) source mode: #bc. |
899 | 1052 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1053 |
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
|
1054 |
self assert: (l := self bc_method_lineno_300) == 300. |
899 | 1055 |
|
1056 |
self assert: m002 code isNil. |
|
1057 |
self assert: m300 code isNil. |
|
1058 |
||
1059 |
"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
|
1060 |
"Modified: / 25-04-2013 / 15:24:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 | 1061 |
! |
1062 |
||
1063 |
test_lineno_01_jit |
|
1064 |
| m002 m300 l | |
|
1065 |
||
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1066 |
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
|
1067 |
m300 := self compile: (self class >> #method_lineno_300) source mode: #jit. |
899 | 1068 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1069 |
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
|
1070 |
self assert: (l := self jit_method_lineno_300) == 300. |
899 | 1071 |
|
929
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1072 |
self assert: m002 code notNil. |
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1073 |
self assert: m300 code notNil. |
899 | 1074 |
|
1075 |
"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
|
1076 |
"Modified: / 10-05-2013 / 18:23:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 | 1077 |
! |
1078 |
||
1079 |
test_lineno_01_stc |
|
1080 |
| m002 m300 l | |
|
1081 |
||
1082 |
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
|
1083 |
m300 := self class >> #method_lineno_300. |
899 | 1084 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1085 |
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
|
1086 |
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
|
1087 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1088 |
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
|
1089 |
self assert: (l := self stc_method_lineno_300) == 300. |
899 | 1090 |
|
1091 |
"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
|
1092 |
"Modified: / 25-04-2013 / 15:22:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 | 1093 |
! ! |
1094 |
||
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1095 |
!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
|
1096 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1097 |
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
|
1098 |
| 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
|
1099 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1100 |
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
|
1101 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1102 |
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
|
1103 |
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
|
1104 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1105 |
l_stc := self stc_method_literals_array_01a. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1106 |
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
|
1107 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1108 |
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
|
1109 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1110 |
"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
|
1111 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1112 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1113 |
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
|
1114 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1115 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1116 |
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
|
1117 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1118 |
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
|
1119 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1120 |
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
|
1121 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1122 |
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
|
1123 |
self assert: l first == #'_XXX:_:'. |
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1124 |
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
|
1125 |
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
|
1126 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1127 |
"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
|
1128 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1129 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1130 |
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
|
1131 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1132 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1133 |
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
|
1134 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1135 |
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
|
1136 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1137 |
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
|
1138 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1139 |
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
|
1140 |
self assert: l first == #'_XXX:_:'. |
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1141 |
self assert: l second == #'YYY'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1142 |
self assert: l third == #'_XXX:_:'. |
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 |
"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
|
1145 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1146 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1147 |
test_literals_array_01b |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1148 |
| m l_stc l_bc | |
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 |
m := self class >> #method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1151 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1152 |
self compile: m source mode: #stc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1153 |
self compile: m source mode: #bc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1154 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1155 |
l_stc := self stc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1156 |
l_bc := self bc_method_literals_array_01b. |
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 |
self assert: l_stc = l_bc. |
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 |
"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
|
1161 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1162 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1163 |
test_literals_array_01b_bc |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1164 |
| m l | |
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 |
m := self class >> #method_literals_array_01b. |
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 |
self compile: m source mode: #bc. |
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 |
l := self bc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1171 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1172 |
self assert: l size == 3. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1173 |
self assert: l first == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1174 |
self assert: l second == #'YYY'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1175 |
self assert: l third == #'_XXX:_:'. |
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 |
"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
|
1178 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1179 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1180 |
test_literals_array_01b_stc |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1181 |
| m l | |
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 |
m := self class >> #method_literals_array_01b. |
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 |
self compile: m source mode: #stc. |
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 |
l := self stc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1188 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1189 |
self assert: l size == 3. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1190 |
self assert: l first == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1191 |
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
|
1192 |
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
|
1193 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1194 |
"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
|
1195 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1196 |
|
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1197 |
test_literals_negativeZero_bc |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1198 |
| m l | |
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 |
m := self class >> #method_negativeZero_01. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1201 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1202 |
self compile: m source mode: #bc. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1203 |
|
1273
0afeacccdc89
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1272
diff
changeset
|
1204 |
l := self bc_method_negativeZero_01. |
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1205 |
self assert: l = 0.0. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1206 |
self assert: l isNegativeZero. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1207 |
! |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1208 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1209 |
test_literals_negativeZero_stc |
1272
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1210 |
| m negZero | |
1271
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 |
m := self class >> #method_negativeZero_01. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1213 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1214 |
self compile: m source mode: #stc. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1215 |
|
1272
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1216 |
negZero := self stc_method_negativeZero_01. |
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1217 |
self assert: negZero = 0.0. |
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1218 |
self assert: negZero isNegativeZero. |
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1219 |
! |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1220 |
|
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1221 |
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
|
1222 |
| m l | |
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 |
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
|
1225 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1226 |
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
|
1227 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1228 |
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
|
1229 |
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
|
1230 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1231 |
"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
|
1232 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1233 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1234 |
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
|
1235 |
| m l | |
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 |
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
|
1238 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1239 |
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
|
1240 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1241 |
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
|
1242 |
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
|
1243 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1244 |
"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
|
1245 |
! ! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1246 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1247 |
!CompilerTests2 methodsFor:'tests - method slot'! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1248 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1249 |
test_methodslot_01_bci |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1250 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1251 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1252 |
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
|
1253 |
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
|
1254 |
self assert: m code isNil. |
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 |
"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
|
1257 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1258 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1259 |
test_methodslot_01_jit |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1260 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1261 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1262 |
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
|
1263 |
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
|
1264 |
self assert: m code notNil. |
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 |
"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
|
1267 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1268 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1269 |
test_methodslot_01_stc |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1270 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1271 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1272 |
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
|
1273 |
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
|
1274 |
self assert: m code notNil. |
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 |
"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
|
1277 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1278 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1279 |
test_methodslot_02_bci |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1280 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1281 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1282 |
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
|
1283 |
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
|
1284 |
self assert: m code isNil. |
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 |
"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
|
1287 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1288 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1289 |
test_methodslot_02_jit |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1290 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1291 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1292 |
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
|
1293 |
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
|
1294 |
self assert: m code notNil. |
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 |
"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
|
1297 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1298 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1299 |
test_methodslot_02_stc |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1300 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1301 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1302 |
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
|
1303 |
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
|
1304 |
self assert: m code notNil. |
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 |
"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
|
1307 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1308 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1309 |
test_methodslot_03_bci |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1310 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1311 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1312 |
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
|
1313 |
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
|
1314 |
self assert: m code isNil. |
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 |
"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
|
1317 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1318 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1319 |
test_methodslot_03_jit |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1320 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1321 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1322 |
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
|
1323 |
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
|
1324 |
self assert: m code notNil. |
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 |
"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
|
1327 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1328 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1329 |
test_methodslot_03_stc |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1330 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1331 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1332 |
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
|
1333 |
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
|
1334 |
self assert: m code notNil. |
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 |
"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
|
1337 |
! ! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1338 |
|
784 | 1339 |
!CompilerTests2 class methodsFor:'documentation'! |
1340 |
||
1341 |
version |
|
1342 |
^ '$Header$' |
|
1343 |
! |
|
1344 |
||
1345 |
version_CVS |
|
1346 |
^ '$Header$' |
|
1347 |
! |
|
1348 |
||
1349 |
version_SVN |
|
929
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1350 |
^ '$Id$' |
784 | 1351 |
! ! |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
1352 |