author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 08 Sep 2016 12:29:45 +0100 | |
branch | jv |
changeset 1944 | a43d7460c471 |
parent 1510 | 6fb7e9d33c4d |
child 1971 | de93bc901dba |
permissions | -rw-r--r-- |
1447 | 1 |
"{ Package: 'stx:goodies/regression' }" |
784 | 2 |
|
3 |
"{ NameSpace: RegressionTests }" |
|
4 |
||
5 |
TestCase subclass:#CompilerTests2 |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
6 |
instanceVariableNames:'methods enabledJIT savedContext savedContextArgAndVarNames |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
7 |
savedContextArgAndVarValues savedContextArgAndVarValuesUsingEval |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
8 |
savedContextLine' |
784 | 9 |
classVariableNames:'' |
10 |
poolDictionaries:'' |
|
1163 | 11 |
category:'tests-Regression-Compilers' |
784 | 12 |
! |
13 |
||
14 |
||
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
15 |
!CompilerTests2 class methodsFor:'accessing'! |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
16 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
17 |
libraryName |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
18 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
19 |
OperatingSystem isUNIXlike ifTrue:[^'librun.so']. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
20 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
21 |
OperatingSystem isMSWINDOWSlike ifTrue:[^'kernel32.dll']. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
22 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
23 |
self error:'Library name for host OS is not known' |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
24 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
25 |
"Created: / 14-07-2016 / 10:10:56 / jv" |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
26 |
! ! |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
27 |
|
899 | 28 |
!CompilerTests2 methodsFor:'private'! |
29 |
||
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
30 |
assertSendersMethodIsIdenticalTo: sendersMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
31 |
"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
|
32 |
in between" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
33 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
34 |
self assertSendersSendersMethodIsIdenticalTo: sendersMethod |
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 |
"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
|
37 |
! |
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 |
assertSendersSendersMethodIsIdenticalTo: thisMethod |
1944
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
40 |
| ctx methodSlotIndex method | |
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
41 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
42 |
ctx := thisContext sender sender. |
1944
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
43 |
methodSlotIndex := Context instVarIndexFor: #method. |
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
44 |
|
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
45 |
[ ctx isBlockContext ] whileTrue:[ |
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
46 |
| block | |
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
47 |
|
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
48 |
block := ctx instVarAt: methodSlotIndex. |
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
49 |
self assert: block isBlock. |
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
50 |
self assert: block home == ctx home. |
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
51 |
ctx := ctx home. |
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
52 |
]. |
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
53 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
54 |
"/ 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
|
55 |
"/ if it is not set!! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
56 |
|
1944
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
57 |
method := ctx instVarAt: methodSlotIndex. |
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
58 |
self assert: method == thisMethod |
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
59 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
60 |
"Created: / 25-04-2013 / 15:30:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1944
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
61 |
"Modified: / 08-09-2016 / 11:15:44 / 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
|
62 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
63 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
64 |
compile: source mode: mode |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
65 |
"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
|
66 |
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
|
67 |
(i.e., foo -> stc_foo). |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
68 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
69 |
If mode is: |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
70 |
#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
|
71 |
#jit....then the method is bytecode compiled and left |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
72 |
to the jitter |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
73 |
#bc.....them the method is bytecode compiled and marked |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
74 |
as checked so JIT won't even try. |
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 |
|
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 |
Class withoutUpdatingChangesDo:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
80 |
mode == #stc ifTrue:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
81 |
ParserFlags withSTCCompilation:#always do:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
82 |
m := self class compile: (mode, '_', source) classified: 'private - *dynamic*'. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
83 |
]. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
84 |
] ifFalse:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
85 |
ParserFlags withSTCCompilation:#never do:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
86 |
m := self class compile: (mode, '_', source) classified: 'private - *dynamic*'. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
87 |
m checked: (mode == #bc) |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
88 |
]. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
89 |
]. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
90 |
]. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
91 |
methods add: m. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
92 |
^m |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
93 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
94 |
"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
|
95 |
! |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
96 |
|
899 | 97 |
currentLineNumber |
900
7acbd0cce153
Call fixAllLineNumbers, otherwise linenos are invalid.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
899
diff
changeset
|
98 |
thisContext fixAllLineNumbers. |
7acbd0cce153
Call fixAllLineNumbers, otherwise linenos are invalid.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
899
diff
changeset
|
99 |
^thisContext sender lineNumber. |
899 | 100 |
|
101 |
"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
|
102 |
"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
|
103 |
! |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
104 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
105 |
saveContext |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
106 |
self saveContext: thisContext sender. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
107 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
108 |
"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
|
109 |
! |
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 |
saveContext: aContext |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
112 |
savedContext := aContext. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
113 |
savedContextArgAndVarNames := savedContext argAndVarNames asArray. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
114 |
savedContextArgAndVarValues := savedContext argsAndVars. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
115 |
savedContextArgAndVarValuesUsingEval := savedContextArgAndVarNames |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
116 |
collect:[ :each | |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
117 |
Compiler evaluate:each |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
118 |
in:savedContext |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
119 |
receiver:savedContext receiver |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
120 |
notifying:nil |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
121 |
logged:false |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
122 |
ifFail:[ '*Error when evaluating*']. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
123 |
]. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
124 |
savedContextLine := savedContext lineNumber. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
125 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
126 |
self assert: savedContextArgAndVarNames size == savedContextArgAndVarValues size. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
127 |
self assert: savedContextArgAndVarNames size == savedContextArgAndVarValuesUsingEval size. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
128 |
|
1287
e1d75e402dff
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1273
diff
changeset
|
129 |
1 to: savedContextArgAndVarNames size do:[:i | |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
130 |
| v1 v2 | |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
131 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
132 |
v1 := savedContextArgAndVarValues at: i. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
133 |
v2 := savedContextArgAndVarValuesUsingEval at: i. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
134 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
135 |
self assert: v1 == v2. "HAS to be IDENTICAL" |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
136 |
]. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
137 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
138 |
"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
|
139 |
"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
|
140 |
! ! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
141 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
142 |
!CompilerTests2 methodsFor:'private-mock methods'! |
899 | 143 |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
144 |
method_argAndVarNames_01 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
145 |
#(1 2 3 4) select:[:each | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
146 |
| isEven | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
147 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
148 |
isEven := each even. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
149 |
self saveContext. |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
150 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
151 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
152 |
"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
|
153 |
"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
|
154 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
155 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
156 |
method_argAndVarNames_02 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
157 |
#(1 2 3 4) select:[:each | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
158 |
| isEven | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
159 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
160 |
'1234' select:[:char | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
161 |
| someOtherLocal | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
162 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
163 |
someOtherLocal := char == $1. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
164 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
165 |
isEven := each even. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
166 |
self saveContext. |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
167 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
168 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
169 |
"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
|
170 |
"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
|
171 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
172 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
173 |
method_argAndVarNames_03 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
174 |
"Reported by Stefan" |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
175 |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
176 |
savedContextArgAndVarNames := 1. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
177 |
(Smalltalk isStandAloneApp | (savedContextArgAndVarNames == 1)) ifTrue:[ |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
178 |
| ttt | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
179 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
180 |
ttt := 123. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
181 |
self saveContext. |
1149
e394c5dbf746
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1138
diff
changeset
|
182 |
]. |
e394c5dbf746
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1138
diff
changeset
|
183 |
self halt. |
e394c5dbf746
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1138
diff
changeset
|
184 |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
185 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
186 |
" |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
187 |
CompilerTests2 basicNew method_argAndVarNames_03 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
188 |
" |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
189 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
190 |
"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
|
191 |
"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
|
192 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
193 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
194 |
method_argAndVarNames_04 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
195 |
#(1 2 3 4) select:[:each | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
196 |
| isEven | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
197 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
198 |
isEven := each even. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
199 |
isEven ifTrue:[ |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
200 |
| isOddNot | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
201 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
202 |
isOddNot := each odd not. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
203 |
self saveContext. |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
204 |
] |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
205 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
206 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
207 |
"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
|
208 |
"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
|
209 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
210 |
|
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
211 |
method_argAndVarNames_05 |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
212 |
| b | |
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 |
b := [:len | |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
215 |
1 to: len do:[:i| |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
216 |
| local1 local2 | |
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 |
local1 := #local1. |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
219 |
local2 := 42. |
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 |
i == 1 ifTrue:[ |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
222 |
self saveContext. |
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
223 |
] |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
224 |
] |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
225 |
]. |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
226 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
227 |
b value: 5 |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
228 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
229 |
" |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
230 |
CompilerTests2 basicNew method_argAndVarNames_05 |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
231 |
" |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
232 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
233 |
"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
|
234 |
"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
|
235 |
! |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
236 |
|
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
237 |
method_argAndVarNames_06 |
1506
4b733abf370c
Fixed CompilerTests2>>test_argAndVarNames_06
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
238 |
(Smalltalk at:#stx_goodies_regression) classNamesAndAttributesDo:[:clsnm :attributes| |
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
239 |
| cls | |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
240 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
241 |
cls := Smalltalk at: clsnm. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
242 |
((Array with: self class) includes: cls) ifTrue:[ |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
243 |
(attributes includes: #autoload) ifTrue:[ |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
244 |
"/ Care for Object!! |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
245 |
cls superclass notNil ifTrue:[ |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
246 |
| superDef superNm | |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
247 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
248 |
superDef := ProjectDefinition definitionClassForPackage: cls superclass package. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
249 |
superNm := cls superclass name. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
250 |
self saveContext. |
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
251 |
^ self |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
252 |
]. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
253 |
]. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
254 |
]. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
255 |
]. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
256 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
257 |
" |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
258 |
CompilerTests2 basicNew method_argAndVarNames_06 |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
259 |
" |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
260 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
261 |
"Created: / 20-09-2013 / 11:44:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1506
4b733abf370c
Fixed CompilerTests2>>test_argAndVarNames_06
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
262 |
"Modified: / 11-07-2016 / 09:42:48 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1475
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
263 |
! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
264 |
|
1478 | 265 |
method_argAndVarNames_07 |
266 |
| b | |
|
267 |
||
268 |
b := [:len | |
|
269 |
1 to: len do:[:i| |
|
270 |
i == 1 ifTrue:[ |
|
271 |
self saveContext. |
|
272 |
] |
|
273 |
] |
|
274 |
]. |
|
275 |
||
276 |
b value: 5 |
|
277 |
||
278 |
" |
|
279 |
CompilerTests2 basicNew method_argAndVarNames_05 |
|
280 |
" |
|
281 |
||
282 |
"Created: / 23-12-2015 / 18:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
283 |
! |
|
284 |
||
899 | 285 |
method_lineno_002 |
286 |
1 factorial. ^self currentLineNumber |
|
287 |
||
288 |
"Created: / 12-04-2013 / 21:22:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
289 |
! |
|
290 |
||
291 |
method_lineno_300 |
|
292 |
"DO NOT MAKE THIS METHOD SHORTER, DO NOT REMOVE BLANK LINES!!!!!!" |
|
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 |
||
556 |
||
557 |
||
558 |
||
559 |
||
560 |
||
561 |
||
562 |
||
563 |
||
564 |
||
565 |
||
566 |
||
567 |
||
568 |
||
569 |
||
570 |
||
571 |
||
572 |
||
573 |
||
574 |
||
575 |
||
576 |
||
577 |
||
578 |
||
579 |
||
580 |
||
581 |
||
582 |
||
583 |
||
584 |
||
585 |
||
586 |
||
587 |
||
588 |
||
589 |
||
590 |
^self currentLineNumber |
|
591 |
||
592 |
"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
|
593 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
594 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
595 |
method_literals_array_01a |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
596 |
| literal | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
597 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
598 |
literal := #( |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
599 |
_XXX:_: |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
600 |
YYY |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
601 |
_XXX:_: |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
602 |
). |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
603 |
^ literal |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
604 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
605 |
"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
|
606 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
607 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
608 |
method_literals_array_01b |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
609 |
| literal | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
610 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
611 |
literal := #( |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
612 |
#'_XXX:_:' |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
613 |
#'YYY' |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
614 |
#'_XXX:_:' |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
615 |
). |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
616 |
^ literal |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
617 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
618 |
"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
|
619 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
620 |
|
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
621 |
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
|
622 |
| literal | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
623 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
624 |
literal := #_XXX:_:. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
625 |
^ literal. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
626 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
627 |
"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
|
628 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
629 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
630 |
method_methodslot_01: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
631 |
self assertSendersMethodIsIdenticalTo: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
632 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
633 |
"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
|
634 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
635 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
636 |
method_methodslot_02: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
637 |
[ self assertSendersMethodIsIdenticalTo: thisMethod ] |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
638 |
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
|
639 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
640 |
"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
|
641 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
642 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
643 |
method_methodslot_03: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
644 |
"Deep block nesting...." |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
645 |
[ |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
646 |
[ |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
647 |
[ |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
648 |
[ |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
649 |
self assertSendersMethodIsIdenticalTo: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
650 |
] 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
|
651 |
] 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
|
652 |
] 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
|
653 |
] 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
|
654 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
655 |
"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
|
656 |
! |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
657 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
658 |
method_negativeZero_01 |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
659 |
| literal | |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
660 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
661 |
literal := -0.0. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
662 |
^ literal. |
899 | 663 |
! ! |
664 |
||
784 | 665 |
!CompilerTests2 methodsFor:'setup'! |
666 |
||
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
667 |
setUp |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
668 |
methods := Set new. |
930
78e2acffdea6
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
929
diff
changeset
|
669 |
enabledJIT := ObjectMemory justInTimeCompilation:true. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
670 |
savedContext := savedContextArgAndVarNames |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
671 |
:= savedContextArgAndVarValues := savedContextArgAndVarValuesUsingEval |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
672 |
:= savedContextLine := '* Not assigned *'. |
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
673 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
674 |
"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
|
675 |
"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
|
676 |
! |
784 | 677 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
678 |
tearDown |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
679 |
savedContext := savedContextArgAndVarNames |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
680 |
:= savedContextArgAndVarValues := savedContextArgAndVarValuesUsingEval |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
681 |
:= savedContextLine := nil. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
682 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
683 |
ObjectMemory justInTimeCompilation: enabledJIT. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
684 |
Class withoutUpdatingChangesDo:[ |
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
|
685 |
| classesToRemove | |
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
686 |
(Smalltalk at: #'exept_regression_testData_CompilerTests2') notNil ifTrue:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
687 |
(Smalltalk at: #'exept_regression_testData_CompilerTests2') classes do:[:e| |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
688 |
e notNil ifTrue:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
689 |
Smalltalk removeClass: e |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
690 |
]. |
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
|
691 |
]. |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
692 |
]. |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
693 |
Smalltalk allClassesDo:[:cls| |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
694 |
(#( |
1499
26a16a04219b
Package renamed from exept:regression to stx:goodies/regression. Hooray!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1484
diff
changeset
|
695 |
'stx:goodies/regression/testData/CompilerTests2' |
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
|
696 |
"/Add more... |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
697 |
) includes: cls package) ifTrue:[ |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
698 |
Smalltalk removeClass: cls |
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
699 |
] |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
700 |
]. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
701 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
702 |
methods do:[:m| |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
703 |
m mclass removeSelector: m selector. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
704 |
] |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
705 |
] |
784 | 706 |
|
707 |
"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
|
708 |
"Modified: / 26-09-2014 / 12:59:58 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
784 | 709 |
! ! |
710 |
||
711 |
!CompilerTests2 methodsFor:'tests'! |
|
712 |
||
713 |
test_01 |
|
823 | 714 |
"JV@2012-10-26: |
784 | 715 |
|
823 | 716 |
When a package is loaded from source using |
784 | 717 |
|
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
718 |
Smalltalk loadPackage:'...' |
784 | 719 |
|
823 | 720 |
expression __EVALUATED FROM WORKSPACE__ AND a method from loaded class |
721 |
uses a class from the same package that is not yet loaded (i.e., it will |
|
722 |
be loaded later), |
|
784 | 723 |
|
823 | 724 |
then the compiler as of 2012-10-26 generates access to a workspace variable |
784 | 725 |
instead of access to a global |
726 |
||
727 |
This tests checks for this bug |
|
728 |
" |
|
729 |
||
730 |
| ws | |
|
731 |
||
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
732 |
"/ this test only works with a Display... |
871
098316a54e40
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
870
diff
changeset
|
733 |
self skipIf:[Display isNil] description:'Test requires a Display'. |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
734 |
|
784 | 735 |
"/First, make sure that package is not yet loaded... |
823 | 736 |
self |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
737 |
assert: (Smalltalk at: #'exept_regression_testData_CompilerTests2') isNil |
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
738 |
description: 'Mock package already loaded'. |
784 | 739 |
|
740 |
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
|
741 |
ws selectedWorkspace |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
742 |
autoDefineVariables: #workspace; |
1499
26a16a04219b
Package renamed from exept:regression to stx:goodies/regression. Hooray!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1484
diff
changeset
|
743 |
contents: '(Smalltalk loadPackage: #''stx:goodies/regression/testData/CompilerTests2'')'; |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
744 |
selectAll; |
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
745 |
doIt. |
784 | 746 |
|
823 | 747 |
self assert: (Smalltalk at: #'RegressionTests::CompilerTests2Mock1') new foo class |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
748 |
== (Smalltalk at: #'RegressionTests::CompilerTests2Mock2') |
784 | 749 |
|
750 |
"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
|
751 |
"Modified: / 24-06-2013 / 15:30:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
784 | 752 |
! |
753 |
||
754 |
test_02 |
|
823 | 755 |
"JV@2012-10-26: |
784 | 756 |
|
823 | 757 |
When a package is loaded from source using |
784 | 758 |
|
1484 | 759 |
Smalltalk loadPackage:'...' |
784 | 760 |
|
823 | 761 |
expression and a method from loaded class in namespace uses a class from the |
762 |
same package and same namespace, that is not yet loaded (i.e., it will be loaded |
|
763 |
later), |
|
784 | 764 |
|
765 |
then the compiler as of 2012-10-26 generates access to class in no namespace. |
|
766 |
||
767 |
This test checks for this bug |
|
768 |
" |
|
769 |
||
770 |
"/First, make sure that package is not yet loaded... |
|
823 | 771 |
self |
1484 | 772 |
assert: (Smalltalk at: #'exept_regression_testData_CompilerTests2') isNil |
773 |
description: 'Mock package already loaded'. |
|
784 | 774 |
|
823 | 775 |
self |
1499
26a16a04219b
Package renamed from exept:regression to stx:goodies/regression. Hooray!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1484
diff
changeset
|
776 |
assert: (Smalltalk loadPackage: #'stx:goodies/regression/testData/CompilerTests2') |
1484 | 777 |
description: 'Cannot load mock package!!'. |
784 | 778 |
|
779 |
||
823 | 780 |
self assert: (Smalltalk at: #'RegressionTests::CompilerTests2Mock1') new foo class |
1484 | 781 |
== (Smalltalk at: #'RegressionTests::CompilerTests2Mock2') |
784 | 782 |
|
783 |
"Created: / 26-10-2012 / 12:26:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
784 |
"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
|
785 |
! |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
786 |
|
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
787 |
test_03 |
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
788 |
"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
|
789 |
|
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
790 |
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
|
791 |
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
|
792 |
" |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
793 |
|
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
794 |
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
|
795 |
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
|
796 |
|
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
797 |
"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
|
798 |
"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
|
799 |
! |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
800 |
|
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
801 |
test_04 |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
802 |
"JV@2013-10-27: |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
803 |
|
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
804 |
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
|
805 |
for perform:* with constant symbol. That's because |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
806 |
in Parser, rev 1.781 >> keywordExpressionFor:, line 57 the |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
807 |
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
|
808 |
set by constant-folding method. |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
809 |
" |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
810 |
|
993 | 811 |
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
|
812 |
self assert: (self bc_mock_04:2) == 4 |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
813 |
|
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
814 |
"Created: / 27-08-2013 / 02:37:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
993 | 815 |
"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
|
816 |
! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
817 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
818 |
test_05a |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
819 |
"JV@2014-05-23: |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
820 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
821 |
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
|
822 |
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
|
823 |
variable named _<value of that symbol> (given that symbol consist |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
824 |
of [A-Za-z]). |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
825 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
826 |
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
|
827 |
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
|
828 |
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
|
829 |
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
|
830 |
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
|
831 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
832 |
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
|
833 |
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
|
834 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
835 |
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
|
836 |
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
|
837 |
compled by STC. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
838 |
" |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
839 |
#(bc stc) do:[:mode | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
840 |
self compile: 'at: _key |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
841 |
^ #key' mode: mode. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
842 |
self assert: (self perform: (mode , '_at:') asSymbol with: 2) == #key. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
843 |
] |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
844 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
845 |
"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
|
846 |
"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
|
847 |
! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
848 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
849 |
test_05b |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
850 |
"JV@2014-05-23: |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
851 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
852 |
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
|
853 |
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
|
854 |
variable named _<value of that symbol> (given that symbol consist |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
855 |
of [A-Za-z]. |
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 |
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
|
858 |
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
|
859 |
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
|
860 |
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
|
861 |
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
|
862 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
863 |
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
|
864 |
will manifest itself when recompiled by STC and run. Even worse, in debugger |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
865 |
printit you'll get correct answer and well as if you recompile. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
866 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
867 |
" |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
868 |
#(bc stc) do:[:mode | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
869 |
self compile: 'at: arg |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
870 |
| _key | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
871 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
872 |
_key := arg. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
873 |
^ #key' mode: mode. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
874 |
self assert: (self perform: (mode , '_at:') asSymbol with: 2) == #key. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
875 |
] |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
876 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
877 |
"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
|
878 |
"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
|
879 |
! ! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
880 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
881 |
!CompilerTests2 methodsFor:'tests - FFI'! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
882 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
883 |
test_external_function_call_01a_u |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
884 |
"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
|
885 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
886 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
887 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
888 |
i.e., when custom subclass of ExternalAddress is in namespace." |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
889 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
890 |
| malloc free | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
891 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
892 |
self skipIf: OperatingSystem isUNIXlike not description: 'This test is UNIX specific, see _w variant for Windows'. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
893 |
|
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
894 |
malloc := 'malloc: size |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
895 |
|
1201
717489c30ebd
Added missing class CompilerTests2ExternalBytes - required by FFI test
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1163
diff
changeset
|
896 |
<cdecl: const RegressionTests::CompilerTests2ExternalBytes "malloc" ( int ) module: ''librun.so''> |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
897 |
self primitive failed'. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
898 |
free := 'free: ptr |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
899 |
|
1201
717489c30ebd
Added missing class CompilerTests2ExternalBytes - required by FFI test
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1163
diff
changeset
|
900 |
<cdecl: const void "free" ( RegressionTests::CompilerTests2ExternalBytes ) module: ''librun.so''> |
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
901 |
self primitive failed'. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
902 |
#( #bc #stc ) do:[:mode | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
903 |
| ptr | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
904 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
905 |
self compile:malloc mode:mode. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
906 |
self compile:free mode:mode. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
907 |
ptr := self perform:(mode , '_malloc:') asSymbol with:1. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
908 |
self assert:ptr class == RegressionTests::CompilerTests2ExternalBytes. |
1201
717489c30ebd
Added missing class CompilerTests2ExternalBytes - required by FFI test
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1163
diff
changeset
|
909 |
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
|
910 |
] |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
911 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
912 |
"Created: / 12-07-2016 / 23:54:54 / jv" |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
913 |
! |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
914 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
915 |
test_external_function_call_01a_w |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
916 |
"Test for stx bug for <cdecl> specs like |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
917 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
918 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
919 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
920 |
i.e., when custom subclass of ExternalAddress is in namespace." |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
921 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
922 |
| getProcessHeap | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
923 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
924 |
self skipIf: OperatingSystem isMSWINDOWSlike not description: 'This test is Windows specific, see _u variant for UNIX'. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
925 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
926 |
getProcessHeap := 'getProcessHeap |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
927 |
<apicall: RegressionTests::CompilerTests2ExternalBytes "GetProcessHeap" ( ) module: "kernel32.dll"> |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
928 |
self primitive failed'. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
929 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
930 |
#( #bc #stc ) do:[:mode | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
931 |
| heap | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
932 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
933 |
self compile:getProcessHeap mode:mode. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
934 |
heap := self perform: (mode , '_getProcessHeap') asSymbol. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
935 |
self assert:heap class == RegressionTests::CompilerTests2ExternalBytes. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
936 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
937 |
] |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
938 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
939 |
"Created: / 12-07-2016 / 23:57:56 / jv" |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
940 |
! |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
941 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
942 |
test_external_function_call_01b_u |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
943 |
"Test for stx bug for <cdecl> specs like |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
944 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
945 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
946 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
947 |
i.e., when custom subclass of ExternalAddress is in namespace." |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
948 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
949 |
| malloc free | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
950 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
951 |
self skipIf: OperatingSystem isUNIXlike not description: 'This test is UNIX specific, see _w variant for Windows'. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
952 |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
953 |
malloc := 'malloc: size |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
954 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
955 |
<cdecl: const RegressionTests::CompilerTests2ExternalBytes "malloc" ( int ) module: ''librun''> |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
956 |
self primitive failed'. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
957 |
free := 'free: ptr |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
958 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
959 |
<cdecl: const void "free" ( RegressionTests::CompilerTests2ExternalBytes ) module: ''librun''> |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
960 |
self primitive failed'. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
961 |
#( #bc #stc ) do:[:mode | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
962 |
| ptr | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
963 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
964 |
self compile:malloc mode:mode. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
965 |
self compile:free mode:mode. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
966 |
ptr := self perform:(mode , '_malloc:') asSymbol with:1. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
967 |
self assert:ptr class == RegressionTests::CompilerTests2ExternalBytes. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
968 |
self perform:(mode , '_free:') asSymbol with:ptr. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
969 |
] |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
970 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
971 |
"Created: / 12-07-2016 / 23:55:01 / jv" |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
972 |
! |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
973 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
974 |
test_external_function_call_01b_w |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
975 |
"Test for stx bug for <cdecl> specs like |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
976 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
977 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
978 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
979 |
i.e., when custom subclass of ExternalAddress is in namespace." |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
980 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
981 |
| getProcessHeap | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
982 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
983 |
self skipIf: OperatingSystem isMSWINDOWSlike not description: 'This test is Windows specific, see _u variant for UNIX'. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
984 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
985 |
getProcessHeap := 'getProcessHeap |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
986 |
<apicall: RegressionTests::CompilerTests2ExternalBytes "GetProcessHeap" ( ) module: "kernel32"> |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
987 |
self primitive failed'. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
988 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
989 |
#( #bc #stc ) do:[:mode | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
990 |
| heap | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
991 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
992 |
self compile:getProcessHeap mode:mode. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
993 |
heap := self perform: (mode , '_getProcessHeap') asSymbol. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
994 |
self assert:heap class == RegressionTests::CompilerTests2ExternalBytes. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
995 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
996 |
] |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
997 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
998 |
"Created: / 14-07-2016 / 10:07:40 / jv" |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
999 |
! |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1000 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1001 |
test_external_function_call_01c_u |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1002 |
"Test for stx bug for <cdecl> specs like |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1003 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1004 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1005 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1006 |
i.e., when custom subclass of ExternalAddress is in namespace." |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1007 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1008 |
| malloc free | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1009 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1010 |
self skipIf: OperatingSystem isUNIXlike not description: 'This test is UNIX specific, see _w variant for Windows'. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1011 |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1012 |
malloc := 'malloc: size |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1013 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1014 |
<cdecl: const RegressionTests::CompilerTests2ExternalBytes "malloc" ( int )> |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1015 |
self primitive failed'. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1016 |
free := 'free: ptr |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1017 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1018 |
<cdecl: const void "free" ( RegressionTests::CompilerTests2ExternalBytes )> |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1019 |
self primitive failed'. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1020 |
#( #bc #stc ) do:[:mode | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1021 |
| ptr | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1022 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1023 |
self compile:malloc mode:mode. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1024 |
self compile:free mode:mode. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1025 |
ptr := self perform:(mode , '_malloc:') asSymbol with:1. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1026 |
self assert:ptr class == RegressionTests::CompilerTests2ExternalBytes. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1027 |
self perform:(mode , '_free:') asSymbol with:ptr. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1028 |
] |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1029 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1030 |
"Created: / 12-07-2016 / 23:55:06 / jv" |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1031 |
! |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1032 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1033 |
test_external_function_call_01c_w |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1034 |
"Test for stx bug for <cdecl> specs like |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1035 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1036 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1037 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1038 |
i.e., when custom subclass of ExternalAddress is in namespace." |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1039 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1040 |
| getProcessHeap | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1041 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1042 |
self skipIf: OperatingSystem isMSWINDOWSlike not description: 'This test is Windows specific, see _u variant for UNIX'. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1043 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1044 |
getProcessHeap := 'getProcessHeap |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1045 |
<apicall: RegressionTests::CompilerTests2ExternalBytes "GetProcessHeap" ( )> |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1046 |
self primitive failed'. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1047 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1048 |
#( #bc #stc ) do:[:mode | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1049 |
| heap | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1050 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1051 |
self compile:getProcessHeap mode:mode. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1052 |
heap := self perform: (mode , '_getProcessHeap') asSymbol. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1053 |
self assert:heap class == RegressionTests::CompilerTests2ExternalBytes. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1054 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1055 |
] |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1056 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1057 |
"Created: / 14-07-2016 / 10:08:04 / jv" |
784 | 1058 |
! ! |
1059 |
||
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1060 |
!CompilerTests2 methodsFor:'tests - arg & var names'! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1061 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1062 |
test_argAndVarNames_04 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1063 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1064 |
#(bc jit stc) do:[:mode | |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1065 |
savedContextArgAndVarNames := nil. |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1066 |
self compile: (self class >> #method_argAndVarNames_04) source mode: mode. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1067 |
self perform: (mode , '_method_argAndVarNames_04') asSymbol. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1068 |
self assert: savedContextArgAndVarNames = #(each isEven isOddNot). |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1069 |
self assert: savedContextArgAndVarValues = #(4 true true). |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1070 |
] |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1071 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1072 |
"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
|
1073 |
"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
|
1074 |
! |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1075 |
|
1475
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1076 |
test_argAndVarNames_05bc |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1077 |
"/ CG: this test tries to access the context of a block. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1078 |
"/ however, the block is an inlined to:do: block, so its block local gets |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1079 |
"/ lifted to its home context. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1080 |
"/ It is questionable if the test is right. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1081 |
"/ |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1082 |
"/ JV: true, but this tests exercise methods used by the |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1083 |
"/ debugger. Therefore it does not matter whether block is inlined |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1084 |
"/ or not - the debugger should show correct data in all cases!! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1085 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1086 |
savedContextArgAndVarNames := nil. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1087 |
self compile: (self class >> #method_argAndVarNames_05) source mode: #bc. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1088 |
self perform: (#bc , '_method_argAndVarNames_05') asSymbol. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1089 |
self assert: savedContextArgAndVarNames = #(len i local1 local2). |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1090 |
self assert: savedContextArgAndVarValues = #(5 1 #local1 42). |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1091 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1092 |
"Created: / 23-12-2015 / 18:38:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1093 |
! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1094 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1095 |
test_argAndVarNames_05jit |
1247
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1096 |
"/ CG: this test tries to access the context of a block. |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1097 |
"/ 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
|
1098 |
"/ lifted to its home context. |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1099 |
"/ It is questionable if the test is right. |
1475
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1100 |
"/ |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1101 |
"/ JV: true, but this tests exercise methods used by the |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1102 |
"/ debugger. Therefore it does not matter whether block is inlined |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1103 |
"/ or not - the debugger should show correct data in all cases!! |
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1104 |
|
1475
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1105 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1106 |
"/ The bytecode compiler inlines the to:do: in this case... |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1107 |
savedContextArgAndVarNames := nil. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1108 |
self compile: (self class >> #method_argAndVarNames_05) source mode: #jit. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1109 |
self perform: (#jit , '_method_argAndVarNames_05') asSymbol. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1110 |
self assert: savedContextArgAndVarNames = #(len i local1 local2). |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1111 |
self assert: savedContextArgAndVarValues = #(5 1 #local1 42). |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1112 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1113 |
"Created: / 23-12-2015 / 18:38:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1114 |
! |
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1115 |
|
1475
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1116 |
test_argAndVarNames_05stc |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1117 |
"/ CG: this test tries to access the context of a block. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1118 |
"/ however, the block is an inlined to:do: block, so its block local gets |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1119 |
"/ lifted to its home context. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1120 |
"/ It is questionable if the test is right. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1121 |
"/ |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1122 |
"/ JV: true, but this tests exercise methods used by the |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1123 |
"/ debugger. Therefore it does not matter whether block is inlined |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1124 |
"/ or not - the debugger should show correct data in all cases!! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1125 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1126 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1127 |
"/ The stc compiler as of 2015-12-23 does not (!!!!!!) inline to:do: |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1128 |
savedContextArgAndVarNames := nil. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1129 |
self compile: (self class >> #method_argAndVarNames_05) source mode: #stc. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1130 |
self perform: (#stc , '_method_argAndVarNames_05') asSymbol. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1131 |
self assert: savedContextArgAndVarNames = #(i local1 local2). |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1132 |
self assert: savedContextArgAndVarValues = #(1 #local1 42) |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1133 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1134 |
"Created: / 23-12-2015 / 18:37:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1135 |
! |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1136 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1137 |
test_argAndVarNames_06 |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1138 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1139 |
#(bc jit stc) do:[:mode | |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1140 |
savedContextArgAndVarNames := nil. |
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1141 |
self compile: (self class >> #method_argAndVarNames_06) source mode: mode. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1142 |
self perform: (mode , '_method_argAndVarNames_06') asSymbol. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1143 |
self assert: savedContextArgAndVarNames = #(clsnm attributes cls superDef superNm). |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1144 |
self assert: savedContextArgAndVarValues = { |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1145 |
self class name. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1146 |
#(#autoload). |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1147 |
self class. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1148 |
Smalltalk at: #stx_goodies_sunit. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1149 |
self class superclass name. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1150 |
} |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1151 |
|
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1152 |
] |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1153 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1154 |
"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
|
1155 |
"Modified: / 26-09-2014 / 15:09:01 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
1475
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1156 |
! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1157 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1158 |
test_argAndVarNames_07bc |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1159 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1160 |
savedContextArgAndVarNames := nil. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1161 |
self compile: (self class >> #method_argAndVarNames_07) source mode: #bc. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1162 |
self perform: (#bc , '_method_argAndVarNames_07') asSymbol. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1163 |
self assert: savedContextArgAndVarNames = #(len i ). |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1164 |
self assert: savedContextArgAndVarValues = #(5 1 ). |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1165 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1166 |
"Created: / 23-12-2015 / 18:40:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1167 |
! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1168 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1169 |
test_argAndVarNames_07jit |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1170 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1171 |
savedContextArgAndVarNames := nil. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1172 |
self compile: (self class >> #method_argAndVarNames_07) source mode: #jit. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1173 |
self perform: (#jit , '_method_argAndVarNames_07') asSymbol. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1174 |
self assert: savedContextArgAndVarNames = #(len i ). |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1175 |
self assert: savedContextArgAndVarValues = #(5 1 ). |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1176 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1177 |
"Created: / 23-12-2015 / 18:40:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1178 |
! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1179 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1180 |
test_argAndVarNames_07stc |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1181 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1182 |
savedContextArgAndVarNames := nil. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1183 |
self compile: (self class >> #method_argAndVarNames_07) source mode: #stc. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1184 |
self perform: (#stc , '_method_argAndVarNames_07') asSymbol. |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1185 |
self assert: savedContextArgAndVarNames = #( i ). |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1186 |
self assert: savedContextArgAndVarValues = #( 1 ). |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1187 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1188 |
"Created: / 23-12-2015 / 18:41:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1189 |
"Modified: / 26-12-2015 / 07:38:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1190 |
! ! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1191 |
|
899 | 1192 |
!CompilerTests2 methodsFor:'tests - line numbers'! |
1193 |
||
1194 |
test_lineno_01_bci |
|
1195 |
| m002 m300 l | |
|
1196 |
||
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1197 |
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
|
1198 |
m300 := self compile: (self class >> #method_lineno_300) source mode: #bc. |
899 | 1199 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1200 |
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
|
1201 |
self assert: (l := self bc_method_lineno_300) == 300. |
899 | 1202 |
|
1203 |
self assert: m002 code isNil. |
|
1204 |
self assert: m300 code isNil. |
|
1205 |
||
1206 |
"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
|
1207 |
"Modified: / 25-04-2013 / 15:24:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 | 1208 |
! |
1209 |
||
1210 |
test_lineno_01_jit |
|
1211 |
| m002 m300 l | |
|
1212 |
||
1473
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1213 |
|
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1214 |
self skipIf: ObjectMemory justInTimeCompilation not |
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1215 |
description: 'Just-in-time compilation not supported on this setup'. |
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1216 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1217 |
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
|
1218 |
m300 := self compile: (self class >> #method_lineno_300) source mode: #jit. |
899 | 1219 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1220 |
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
|
1221 |
self assert: (l := self jit_method_lineno_300) == 300. |
899 | 1222 |
|
929
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1223 |
self assert: m002 code notNil. |
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1224 |
self assert: m300 code notNil. |
899 | 1225 |
|
1226 |
"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
|
1227 |
"Modified: / 10-05-2013 / 18:23:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 | 1228 |
! |
1229 |
||
1230 |
test_lineno_01_stc |
|
1231 |
| m002 m300 l | |
|
1232 |
||
1233 |
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
|
1234 |
m300 := self class >> #method_lineno_300. |
899 | 1235 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1236 |
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
|
1237 |
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
|
1238 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1239 |
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
|
1240 |
self assert: (l := self stc_method_lineno_300) == 300. |
899 | 1241 |
|
1242 |
"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
|
1243 |
"Modified: / 25-04-2013 / 15:22:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 | 1244 |
! ! |
1245 |
||
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1246 |
!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
|
1247 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1248 |
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
|
1249 |
| 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
|
1250 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1251 |
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
|
1252 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1253 |
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
|
1254 |
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
|
1255 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1256 |
l_stc := self stc_method_literals_array_01a. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1257 |
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
|
1258 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1259 |
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
|
1260 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1261 |
"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
|
1262 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1263 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1264 |
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
|
1265 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1266 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1267 |
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
|
1268 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1269 |
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
|
1270 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1271 |
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
|
1272 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1273 |
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
|
1274 |
self assert: l first == #'_XXX:_:'. |
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1275 |
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
|
1276 |
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
|
1277 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1278 |
"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
|
1279 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1280 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1281 |
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
|
1282 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1283 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1284 |
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
|
1285 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1286 |
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
|
1287 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1288 |
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
|
1289 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1290 |
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
|
1291 |
self assert: l first == #'_XXX:_:'. |
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1292 |
self assert: l second == #'YYY'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1293 |
self assert: l third == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1294 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1295 |
"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
|
1296 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1297 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1298 |
test_literals_array_01b |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1299 |
| m l_stc l_bc | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1300 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1301 |
m := self class >> #method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1302 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1303 |
self compile: m source mode: #stc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1304 |
self compile: m source mode: #bc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1305 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1306 |
l_stc := self stc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1307 |
l_bc := self bc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1308 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1309 |
self assert: l_stc = l_bc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1310 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1311 |
"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
|
1312 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1313 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1314 |
test_literals_array_01b_bc |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1315 |
| m l | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1316 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1317 |
m := self class >> #method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1318 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1319 |
self compile: m source mode: #bc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1320 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1321 |
l := self bc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1322 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1323 |
self assert: l size == 3. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1324 |
self assert: l first == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1325 |
self assert: l second == #'YYY'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1326 |
self assert: l third == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1327 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1328 |
"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
|
1329 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1330 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1331 |
test_literals_array_01b_stc |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1332 |
| m l | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1333 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1334 |
m := self class >> #method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1335 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1336 |
self compile: m source mode: #stc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1337 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1338 |
l := self stc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1339 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1340 |
self assert: l size == 3. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1341 |
self assert: l first == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1342 |
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
|
1343 |
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
|
1344 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1345 |
"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
|
1346 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1347 |
|
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1348 |
test_literals_negativeZero_bc |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1349 |
| m l | |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1350 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1351 |
m := self class >> #method_negativeZero_01. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1352 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1353 |
self compile: m source mode: #bc. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1354 |
|
1273
0afeacccdc89
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1272
diff
changeset
|
1355 |
l := self bc_method_negativeZero_01. |
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1356 |
self assert: l = 0.0. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1357 |
self assert: l isNegativeZero. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1358 |
! |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1359 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1360 |
test_literals_negativeZero_stc |
1272
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1361 |
| m negZero | |
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1362 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1363 |
m := self class >> #method_negativeZero_01. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1364 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1365 |
self compile: m source mode: #stc. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1366 |
|
1272
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1367 |
negZero := self stc_method_negativeZero_01. |
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1368 |
self assert: negZero = 0.0. |
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1369 |
self assert: negZero isNegativeZero. |
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1370 |
! |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1371 |
|
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1372 |
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
|
1373 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1374 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1375 |
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
|
1376 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1377 |
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
|
1378 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1379 |
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
|
1380 |
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
|
1381 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1382 |
"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
|
1383 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1384 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1385 |
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
|
1386 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1387 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1388 |
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
|
1389 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1390 |
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
|
1391 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1392 |
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
|
1393 |
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
|
1394 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1395 |
"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
|
1396 |
! ! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1397 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1398 |
!CompilerTests2 methodsFor:'tests - method slot'! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1399 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1400 |
test_methodslot_01_bci |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1401 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1402 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1403 |
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
|
1404 |
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
|
1405 |
self assert: m code isNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1406 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1407 |
"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
|
1408 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1409 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1410 |
test_methodslot_01_jit |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1411 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1412 |
|
1473
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1413 |
self skipIf: ObjectMemory justInTimeCompilation not |
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1414 |
description: 'Just-in-time compilation not supported on this setup'. |
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1415 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1416 |
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
|
1417 |
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
|
1418 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1419 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1420 |
"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
|
1421 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1422 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1423 |
test_methodslot_01_stc |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1424 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1425 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1426 |
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
|
1427 |
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
|
1428 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1429 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1430 |
"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
|
1431 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1432 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1433 |
test_methodslot_02_bci |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1434 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1435 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1436 |
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
|
1437 |
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
|
1438 |
self assert: m code isNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1439 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1440 |
"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
|
1441 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1442 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1443 |
test_methodslot_02_jit |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1444 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1445 |
|
1473
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1446 |
self skipIf: ObjectMemory justInTimeCompilation not |
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1447 |
description: 'Just-in-time compilation not supported on this setup'. |
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1448 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1449 |
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
|
1450 |
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
|
1451 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1452 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1453 |
"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
|
1454 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1455 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1456 |
test_methodslot_02_stc |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1457 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1458 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1459 |
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
|
1460 |
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
|
1461 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1462 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1463 |
"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
|
1464 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1465 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1466 |
test_methodslot_03_bci |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1467 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1468 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1469 |
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
|
1470 |
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
|
1471 |
self assert: m code isNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1472 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1473 |
"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
|
1474 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1475 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1476 |
test_methodslot_03_jit |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1477 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1478 |
|
1473
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1479 |
self skipIf: ObjectMemory justInTimeCompilation not |
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1480 |
description: 'Just-in-time compilation not supported on this setup'. |
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1481 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1482 |
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
|
1483 |
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
|
1484 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1485 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1486 |
"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
|
1487 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1488 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1489 |
test_methodslot_03_stc |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1490 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1491 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1492 |
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
|
1493 |
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
|
1494 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1495 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1496 |
"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
|
1497 |
! ! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1498 |
|
784 | 1499 |
!CompilerTests2 class methodsFor:'documentation'! |
1500 |
||
1501 |
version |
|
1502 |
^ '$Header$' |
|
1503 |
! |
|
1504 |
||
1505 |
version_CVS |
|
1506 |
^ '$Header$' |
|
1507 |
! |
|
1508 |
||
1475
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1509 |
version_HG |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1510 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1511 |
^ '$Changeset: <not expanded> $' |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1512 |
! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1513 |
|
784 | 1514 |
version_SVN |
929
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1515 |
^ '$Id$' |
784 | 1516 |
! ! |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
1517 |