author | Jan Vrany <jan.vrany@labware.com> |
Thu, 25 Aug 2022 11:29:18 +0100 | |
branch | jv |
changeset 2607 | ddf2eb8b3f1d |
parent 2595 | 0ae7d724b885 |
permissions | -rw-r--r-- |
1974 | 1 |
" |
2 |
COPYRIGHT (c) Claus Gittinger / eXept Software AG |
|
3 |
COPYRIGHT (c) 2015-2016 Jan Vrany |
|
4 |
COPYRIGHT (c) 2018 Jan Vrany |
|
2595
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
5 |
COPYRIGHT (c) 2021 LabWare |
1974 | 6 |
All Rights Reserved |
7 |
||
8 |
This software is furnished under a license and may be used |
|
9 |
only in accordance with the terms of that license and with the |
|
10 |
inclusion of the above copyright notice. This software may not |
|
11 |
be provided or otherwise made available to, or used by, any |
|
12 |
other person. No title to or ownership of the software is |
|
13 |
hereby transferred. |
|
14 |
" |
|
1447 | 15 |
"{ Package: 'stx:goodies/regression' }" |
784 | 16 |
|
17 |
"{ NameSpace: RegressionTests }" |
|
18 |
||
19 |
TestCase subclass:#CompilerTests2 |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
20 |
instanceVariableNames:'methods enabledJIT savedContext savedContextArgAndVarNames |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
21 |
savedContextArgAndVarValues savedContextArgAndVarValuesUsingEval |
2095
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
22 |
savedContextLine verbose parserFlags' |
784 | 23 |
classVariableNames:'' |
24 |
poolDictionaries:'' |
|
1163 | 25 |
category:'tests-Regression-Compilers' |
784 | 26 |
! |
27 |
||
1974 | 28 |
!CompilerTests2 class methodsFor:'documentation'! |
29 |
||
30 |
copyright |
|
31 |
" |
|
32 |
COPYRIGHT (c) Claus Gittinger / eXept Software AG |
|
33 |
COPYRIGHT (c) 2015-2016 Jan Vrany |
|
34 |
COPYRIGHT (c) 2018 Jan Vrany |
|
2595
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
35 |
COPYRIGHT (c) 2021 LabWare |
1974 | 36 |
All Rights Reserved |
37 |
||
38 |
This software is furnished under a license and may be used |
|
39 |
only in accordance with the terms of that license and with the |
|
40 |
inclusion of the above copyright notice. This software may not |
|
41 |
be provided or otherwise made available to, or used by, any |
|
42 |
other person. No title to or ownership of the software is |
|
43 |
hereby transferred. |
|
44 |
" |
|
45 |
! ! |
|
784 | 46 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
47 |
!CompilerTests2 class methodsFor:'accessing'! |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
48 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
49 |
libraryName |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
50 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
51 |
OperatingSystem isUNIXlike ifTrue:[^'librun.so']. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
52 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
53 |
OperatingSystem isMSWINDOWSlike ifTrue:[^'kernel32.dll']. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
54 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
55 |
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
|
56 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
57 |
"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
|
58 |
! ! |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
59 |
|
899 | 60 |
!CompilerTests2 methodsFor:'private'! |
61 |
||
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
62 |
assertSendersMethodIsIdenticalTo: sendersMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
63 |
"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
|
64 |
in between" |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
65 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
66 |
self assertSendersSendersMethodIsIdenticalTo: sendersMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
67 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
68 |
"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
|
69 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
70 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
71 |
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
|
72 |
| ctx methodSlotIndex method | |
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
73 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
74 |
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
|
75 |
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
|
76 |
|
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
77 |
[ 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
|
78 |
| block | |
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
79 |
|
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
80 |
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
|
81 |
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
|
82 |
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
|
83 |
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
|
84 |
]. |
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
85 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
86 |
"/ 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
|
87 |
"/ if it is not set!! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
88 |
|
1944
a43d7460c471
Block-in-context: Fixed CompilerTests2 to work with block in context
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1510
diff
changeset
|
89 |
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
|
90 |
self assert: method == thisMethod |
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
91 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
92 |
"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
|
93 |
"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
|
94 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
95 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
96 |
compile: source mode: mode |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
97 |
"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
|
98 |
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
|
99 |
(i.e., foo -> stc_foo). |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
100 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
101 |
If mode is: |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
102 |
#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
|
103 |
#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
|
104 |
to the jitter |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
105 |
#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
|
106 |
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
|
107 |
" |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
108 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
109 |
| m | |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
110 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
111 |
Class withoutUpdatingChangesDo:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
112 |
mode == #stc ifTrue:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
113 |
ParserFlags withSTCCompilation:#always do:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
114 |
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
|
115 |
]. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
116 |
] ifFalse:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
117 |
ParserFlags withSTCCompilation:#never do:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
118 |
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
|
119 |
m checked: (mode == #bc) |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
120 |
]. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
121 |
]. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
122 |
]. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
123 |
methods add: m. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
124 |
^m |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
125 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
126 |
"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
|
127 |
! |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
128 |
|
2093
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
129 |
compile: source mode: mode andPerform: args |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
130 |
"Compile given `source` in given `mode` and perform |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
131 |
compiled method with given `args`. Return method's |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
132 |
return value. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
133 |
|
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
134 |
For possible values of `mode`, see #compile:mode:. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
135 |
" |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
136 |
|
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
137 |
| m | |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
138 |
|
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
139 |
Class withoutUpdatingChangesDo:[ |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
140 |
mode == #stc ifTrue:[ |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
141 |
ParserFlags withSTCCompilation:#always do:[ |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
142 |
m := self class compile: (mode, '_', source) classified: 'private - *dynamic*'. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
143 |
]. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
144 |
] ifFalse:[ |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
145 |
ParserFlags withSTCCompilation:#never do:[ |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
146 |
m := self class compile: (mode, '_', source) classified: 'private - *dynamic*'. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
147 |
m checked: (mode == #bc) |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
148 |
]. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
149 |
]. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
150 |
]. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
151 |
methods add: m. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
152 |
^m |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
153 |
|
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
154 |
"Created: / 15-07-2018 / 11:42:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
155 |
! |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
156 |
|
899 | 157 |
currentLineNumber |
900
7acbd0cce153
Call fixAllLineNumbers, otherwise linenos are invalid.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
899
diff
changeset
|
158 |
thisContext fixAllLineNumbers. |
7acbd0cce153
Call fixAllLineNumbers, otherwise linenos are invalid.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
899
diff
changeset
|
159 |
^thisContext sender lineNumber. |
899 | 160 |
|
161 |
"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
|
162 |
"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
|
163 |
! |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
164 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
165 |
saveContext |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
166 |
self saveContext: thisContext sender. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
167 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
168 |
"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
|
169 |
! |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
170 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
171 |
saveContext: aContext |
2095
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
172 |
| dbgVariables | |
2093
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
173 |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
174 |
savedContext := aContext. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
175 |
savedContextArgAndVarNames := savedContext argAndVarNames asArray. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
176 |
savedContextArgAndVarValues := savedContext argsAndVars. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
177 |
savedContextArgAndVarValuesUsingEval := savedContextArgAndVarNames |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
178 |
collect:[ :each | |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
179 |
Compiler evaluate:each |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
180 |
in:savedContext |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
181 |
receiver:savedContext receiver |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
182 |
notifying:nil |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
183 |
logged:false |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
184 |
ifFail:[ '*Error when evaluating*']. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
185 |
]. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
186 |
savedContextLine := savedContext lineNumber. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
187 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
188 |
self assert: savedContextArgAndVarNames size == savedContextArgAndVarValues size. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
189 |
self assert: savedContextArgAndVarNames size == savedContextArgAndVarValuesUsingEval size. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
190 |
|
1287
e1d75e402dff
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1273
diff
changeset
|
191 |
1 to: savedContextArgAndVarNames size do:[:i | |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
192 |
| v1 v2 | |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
193 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
194 |
v1 := savedContextArgAndVarValues at: i. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
195 |
v2 := savedContextArgAndVarValuesUsingEval at: i. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
196 |
|
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
197 |
self assert: v1 == v2. "HAS to be IDENTICAL" |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
198 |
]. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
199 |
|
2095
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
200 |
dbgVariables := savedContext dbgVariables. |
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
201 |
self assert: savedContextArgAndVarNames size = dbgVariables size. |
2093
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
202 |
savedContextArgAndVarNames withIndexDo:[ :name :index | |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
203 |
| var | |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
204 |
|
2095
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
205 |
var := dbgVariables detect:[:e | e frameOffset = index ]. |
2093
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
206 |
self assert: var notNil. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
207 |
self assert: var name = name. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
208 |
self assert: var frameOffset = index. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
209 |
]. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
210 |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
211 |
"Created: / 26-09-2014 / 12:49:18 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2095
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
212 |
"Modified: / 07-02-2019 / 08:49:52 / 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
|
213 |
! ! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
214 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
215 |
!CompilerTests2 methodsFor:'private-mock methods'! |
899 | 216 |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
217 |
method_argAndVarNames_01 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
218 |
#(1 2 3 4) select:[:each | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
219 |
| isEven | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
220 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
221 |
isEven := each even. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
222 |
self saveContext. |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
223 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
224 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
225 |
"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
|
226 |
"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
|
227 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
228 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
229 |
method_argAndVarNames_02 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
230 |
#(1 2 3 4) select:[:each | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
231 |
| isEven | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
232 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
233 |
'1234' select:[:char | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
234 |
| someOtherLocal | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
235 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
236 |
someOtherLocal := char == $1. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
237 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
238 |
isEven := each even. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
239 |
self saveContext. |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
240 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
241 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
242 |
"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
|
243 |
"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
|
244 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
245 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
246 |
method_argAndVarNames_03 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
247 |
"Reported by Stefan" |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
248 |
|
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
249 |
savedContextArgAndVarNames := 1. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
250 |
(Smalltalk isStandAloneApp | (savedContextArgAndVarNames == 1)) ifTrue:[ |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
251 |
| ttt | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
252 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
253 |
ttt := 123. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
254 |
self saveContext. |
1149
e394c5dbf746
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1138
diff
changeset
|
255 |
]. |
e394c5dbf746
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1138
diff
changeset
|
256 |
self halt. |
e394c5dbf746
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1138
diff
changeset
|
257 |
|
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
258 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
259 |
" |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
260 |
CompilerTests2 basicNew method_argAndVarNames_03 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
261 |
" |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
262 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
263 |
"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
|
264 |
"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
|
265 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
266 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
267 |
method_argAndVarNames_04 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
268 |
#(1 2 3 4) select:[:each | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
269 |
| isEven | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
270 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
271 |
isEven := each even. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
272 |
isEven ifTrue:[ |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
273 |
| isOddNot | |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
274 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
275 |
isOddNot := each odd not. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
276 |
self saveContext. |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
277 |
] |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
278 |
]. |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
279 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
280 |
"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
|
281 |
"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
|
282 |
! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
283 |
|
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
284 |
method_argAndVarNames_05 |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
285 |
| b | |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
286 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
287 |
b := [:len | |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
288 |
1 to: len do:[:i| |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
289 |
| local1 local2 | |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
290 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
291 |
local1 := #local1. |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
292 |
local2 := 42. |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
293 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
294 |
i == 1 ifTrue:[ |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
295 |
self saveContext. |
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
296 |
] |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
297 |
] |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
298 |
]. |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
299 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
300 |
b value: 5 |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
301 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
302 |
" |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
303 |
CompilerTests2 basicNew method_argAndVarNames_05 |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
304 |
" |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
305 |
|
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
306 |
"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
|
307 |
"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
|
308 |
! |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
309 |
|
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
310 |
method_argAndVarNames_06 |
1506
4b733abf370c
Fixed CompilerTests2>>test_argAndVarNames_06
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1500
diff
changeset
|
311 |
(Smalltalk at:#stx_goodies_regression) classNamesAndAttributesDo:[:clsnm :attributes| |
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
312 |
| cls | |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
313 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
314 |
cls := Smalltalk at: clsnm. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
315 |
((Array with: self class) includes: cls) ifTrue:[ |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
316 |
(attributes includes: #autoload) ifTrue:[ |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
317 |
"/ Care for Object!! |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
318 |
cls superclass notNil ifTrue:[ |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
319 |
| superDef superNm | |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
320 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
321 |
superDef := ProjectDefinition definitionClassForPackage: cls superclass package. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
322 |
superNm := cls superclass name. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
323 |
self saveContext. |
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
324 |
^ self |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
325 |
]. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
326 |
]. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
327 |
]. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
328 |
]. |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
329 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
330 |
" |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
331 |
CompilerTests2 basicNew method_argAndVarNames_06 |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
332 |
" |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
333 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
334 |
"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
|
335 |
"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
|
336 |
! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
337 |
|
1478 | 338 |
method_argAndVarNames_07 |
339 |
| b | |
|
340 |
||
341 |
b := [:len | |
|
342 |
1 to: len do:[:i| |
|
343 |
i == 1 ifTrue:[ |
|
344 |
self saveContext. |
|
345 |
] |
|
346 |
] |
|
347 |
]. |
|
348 |
||
349 |
b value: 5 |
|
350 |
||
351 |
" |
|
352 |
CompilerTests2 basicNew method_argAndVarNames_05 |
|
353 |
" |
|
354 |
||
355 |
"Created: / 23-12-2015 / 18:40:11 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
356 |
! |
|
357 |
||
899 | 358 |
method_lineno_002 |
359 |
1 factorial. ^self currentLineNumber |
|
360 |
||
361 |
"Created: / 12-04-2013 / 21:22:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
362 |
! |
|
363 |
||
364 |
method_lineno_300 |
|
365 |
"DO NOT MAKE THIS METHOD SHORTER, DO NOT REMOVE BLANK LINES!!!!!!" |
|
366 |
||
367 |
||
368 |
||
369 |
||
370 |
||
371 |
||
372 |
||
373 |
||
374 |
||
375 |
||
376 |
||
377 |
||
378 |
||
379 |
||
380 |
||
381 |
||
382 |
||
383 |
||
384 |
||
385 |
||
386 |
||
387 |
||
388 |
||
389 |
||
390 |
||
391 |
||
392 |
||
393 |
||
394 |
||
395 |
||
396 |
||
397 |
||
398 |
||
399 |
||
400 |
||
401 |
||
402 |
||
403 |
||
404 |
||
405 |
||
406 |
||
407 |
||
408 |
||
409 |
||
410 |
||
411 |
||
412 |
||
413 |
||
414 |
||
415 |
||
416 |
||
417 |
||
418 |
||
419 |
||
420 |
||
421 |
||
422 |
||
423 |
||
424 |
||
425 |
||
426 |
||
427 |
||
428 |
||
429 |
||
430 |
||
431 |
||
432 |
||
433 |
||
434 |
||
435 |
||
436 |
||
437 |
||
438 |
||
439 |
||
440 |
||
441 |
||
442 |
||
443 |
||
444 |
||
445 |
||
446 |
||
447 |
||
448 |
||
449 |
||
450 |
||
451 |
||
452 |
||
453 |
||
454 |
||
455 |
||
456 |
||
457 |
||
458 |
||
459 |
||
460 |
||
461 |
||
462 |
||
463 |
||
464 |
||
465 |
||
466 |
||
467 |
||
468 |
||
469 |
||
470 |
||
471 |
||
472 |
||
473 |
||
474 |
||
475 |
||
476 |
||
477 |
||
478 |
||
479 |
||
480 |
||
481 |
||
482 |
||
483 |
||
484 |
||
485 |
||
486 |
||
487 |
||
488 |
||
489 |
||
490 |
||
491 |
||
492 |
||
493 |
||
494 |
||
495 |
||
496 |
||
497 |
||
498 |
||
499 |
||
500 |
||
501 |
||
502 |
||
503 |
||
504 |
||
505 |
||
506 |
||
507 |
||
508 |
||
509 |
||
510 |
||
511 |
||
512 |
||
513 |
||
514 |
||
515 |
||
516 |
||
517 |
||
518 |
||
519 |
||
520 |
||
521 |
||
522 |
||
523 |
||
524 |
||
525 |
||
526 |
||
527 |
||
528 |
||
529 |
||
530 |
||
531 |
||
532 |
||
533 |
||
534 |
||
535 |
||
536 |
||
537 |
||
538 |
||
539 |
||
540 |
||
541 |
||
542 |
||
543 |
||
544 |
||
545 |
||
546 |
||
547 |
||
548 |
||
549 |
||
550 |
||
551 |
||
552 |
||
553 |
||
554 |
||
555 |
||
556 |
||
557 |
||
558 |
||
559 |
||
560 |
||
561 |
||
562 |
||
563 |
||
564 |
||
565 |
||
566 |
||
567 |
||
568 |
||
569 |
||
570 |
||
571 |
||
572 |
||
573 |
||
574 |
||
575 |
||
576 |
||
577 |
||
578 |
||
579 |
||
580 |
||
581 |
||
582 |
||
583 |
||
584 |
||
585 |
||
586 |
||
587 |
||
588 |
||
589 |
||
590 |
||
591 |
||
592 |
||
593 |
||
594 |
||
595 |
||
596 |
||
597 |
||
598 |
||
599 |
||
600 |
||
601 |
||
602 |
||
603 |
||
604 |
||
605 |
||
606 |
||
607 |
||
608 |
||
609 |
||
610 |
||
611 |
||
612 |
||
613 |
||
614 |
||
615 |
||
616 |
||
617 |
||
618 |
||
619 |
||
620 |
||
621 |
||
622 |
||
623 |
||
624 |
||
625 |
||
626 |
||
627 |
||
628 |
||
629 |
||
630 |
||
631 |
||
632 |
||
633 |
||
634 |
||
635 |
||
636 |
||
637 |
||
638 |
||
639 |
||
640 |
||
641 |
||
642 |
||
643 |
||
644 |
||
645 |
||
646 |
||
647 |
||
648 |
||
649 |
||
650 |
||
651 |
||
652 |
||
653 |
||
654 |
||
655 |
||
656 |
||
657 |
||
658 |
||
659 |
||
660 |
||
661 |
||
662 |
||
663 |
^self currentLineNumber |
|
664 |
||
665 |
"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
|
666 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
667 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
668 |
method_literals_array_01a |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
669 |
| literal | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
670 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
671 |
literal := #( |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
672 |
_XXX:_: |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
673 |
YYY |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
674 |
_XXX:_: |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
675 |
). |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
676 |
^ literal |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
677 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
678 |
"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
|
679 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
680 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
681 |
method_literals_array_01b |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
682 |
| literal | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
683 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
684 |
literal := #( |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
685 |
#'_XXX:_:' |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
686 |
#'YYY' |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
687 |
#'_XXX:_:' |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
688 |
). |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
689 |
^ literal |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
690 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
691 |
"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
|
692 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
693 |
|
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
694 |
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
|
695 |
| literal | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
696 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
697 |
literal := #_XXX:_:. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
698 |
^ literal. |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
699 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
700 |
"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
|
701 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
702 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
703 |
method_methodslot_01: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
704 |
self assertSendersMethodIsIdenticalTo: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
705 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
706 |
"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
|
707 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
708 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
709 |
method_methodslot_02: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
710 |
[ self assertSendersMethodIsIdenticalTo: thisMethod ] |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
711 |
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
|
712 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
713 |
"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
|
714 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
715 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
716 |
method_methodslot_03: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
717 |
"Deep block nesting...." |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
718 |
[ |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
719 |
[ |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
720 |
[ |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
721 |
[ |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
722 |
self assertSendersMethodIsIdenticalTo: thisMethod |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
723 |
] 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
|
724 |
] 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
|
725 |
] 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
|
726 |
] 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
|
727 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
728 |
"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
|
729 |
! |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
730 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
731 |
method_negativeZero_01 |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
732 |
| literal | |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
733 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
734 |
literal := -0.0. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
735 |
^ literal. |
899 | 736 |
! ! |
737 |
||
784 | 738 |
!CompilerTests2 methodsFor:'setup'! |
739 |
||
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
740 |
setUp |
2095
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
741 |
verbose := STCCompilerInterface verbose. |
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
742 |
parserFlags := ParserFlags new. |
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
743 |
|
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
744 |
STCCompilerInterface verbose: true. |
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
745 |
ParserFlags stcModulePath: Filename tempDirectory. |
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
746 |
ParserFlags stcKeepCIntermediate: true. |
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
747 |
ParserFlags stcKeepSTIntermediate: true. |
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
748 |
|
2093
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
749 |
(ParserFlags ccCompilationOptions includesString: '-g') ifFalse:[ |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
750 |
ParserFlags ccCompilationOptions: ParserFlags ccCompilationOptions , ' -g' |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
751 |
]. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
752 |
(ParserFlags stcCompilationOptions includesString: '-g') ifFalse:[ |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
753 |
ParserFlags stcCompilationOptions: ParserFlags stcCompilationOptions , ' -g' |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
754 |
]. |
03abc2c79cce
Updated `CompilerTests2 >> #test_argAndVarNames_*` to tests debug info
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1974
diff
changeset
|
755 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
756 |
methods := Set new. |
930
78e2acffdea6
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
929
diff
changeset
|
757 |
enabledJIT := ObjectMemory justInTimeCompilation:true. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
758 |
savedContext := savedContextArgAndVarNames |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
759 |
:= savedContextArgAndVarValues := savedContextArgAndVarValuesUsingEval |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
760 |
:= savedContextLine := '* Not assigned *'. |
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
761 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
762 |
"Created: / 25-04-2013 / 15:20:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
2095
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
763 |
"Modified: / 07-02-2019 / 12:46:19 / 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
|
764 |
! |
784 | 765 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
766 |
tearDown |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
767 |
savedContext := savedContextArgAndVarNames |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
768 |
:= savedContextArgAndVarValues := savedContextArgAndVarValuesUsingEval |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
769 |
:= savedContextLine := nil. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
770 |
|
2095
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
771 |
ParserFlags stcModulePath: parserFlags stcModulePath. |
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
772 |
ParserFlags stcKeepCIntermediate: parserFlags stcKeepCIntermediate. |
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
773 |
ParserFlags stcKeepSTIntermediate: parserFlags stcKeepSTIntermediate. |
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
774 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
775 |
ObjectMemory justInTimeCompilation: enabledJIT. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
776 |
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
|
777 |
| classesToRemove | |
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
778 |
(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
|
779 |
(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
|
780 |
e notNil ifTrue:[ |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
781 |
Smalltalk removeClass: e |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
782 |
]. |
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
|
783 |
]. |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
784 |
]. |
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 |
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
|
786 |
(#( |
1499
26a16a04219b
Package renamed from exept:regression to stx:goodies/regression. Hooray!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1484
diff
changeset
|
787 |
'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
|
788 |
"/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
|
789 |
) 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
|
790 |
Smalltalk removeClass: cls |
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
791 |
] |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
792 |
]. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
793 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
794 |
methods do:[:m| |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
795 |
m mclass removeSelector: m selector. |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
796 |
] |
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
797 |
] |
784 | 798 |
|
799 |
"Created: / 26-10-2012 / 11:32:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
2095
99e51857a2e8
DBG: update `CompilerTest2` tests for new flat variable table format
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
2093
diff
changeset
|
800 |
"Modified: / 07-02-2019 / 21:55:40 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
784 | 801 |
! ! |
802 |
||
803 |
!CompilerTests2 methodsFor:'tests'! |
|
804 |
||
805 |
test_01 |
|
823 | 806 |
"JV@2012-10-26: |
784 | 807 |
|
823 | 808 |
When a package is loaded from source using |
784 | 809 |
|
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
810 |
Smalltalk loadPackage:'...' |
784 | 811 |
|
823 | 812 |
expression __EVALUATED FROM WORKSPACE__ AND a method from loaded class |
813 |
uses a class from the same package that is not yet loaded (i.e., it will |
|
814 |
be loaded later), |
|
784 | 815 |
|
823 | 816 |
then the compiler as of 2012-10-26 generates access to a workspace variable |
784 | 817 |
instead of access to a global |
818 |
||
819 |
This tests checks for this bug |
|
820 |
" |
|
821 |
||
822 |
| ws | |
|
823 |
||
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
824 |
"/ this test only works with a Display... |
871
098316a54e40
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
870
diff
changeset
|
825 |
self skipIf:[Display isNil] description:'Test requires a Display'. |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
826 |
|
784 | 827 |
"/First, make sure that package is not yet loaded... |
823 | 828 |
self |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
829 |
assert: (Smalltalk at: #'exept_regression_testData_CompilerTests2') isNil |
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
830 |
description: 'Mock package already loaded'. |
784 | 831 |
|
832 |
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
|
833 |
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
|
834 |
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
|
835 |
contents: '(Smalltalk loadPackage: #''stx:goodies/regression/testData/CompilerTests2'')'; |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
836 |
selectAll; |
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
837 |
doIt. |
784 | 838 |
|
823 | 839 |
self assert: (Smalltalk at: #'RegressionTests::CompilerTests2Mock1') new foo class |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
840 |
== (Smalltalk at: #'RegressionTests::CompilerTests2Mock2') |
784 | 841 |
|
842 |
"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
|
843 |
"Modified: / 24-06-2013 / 15:30:00 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
784 | 844 |
! |
845 |
||
846 |
test_02 |
|
823 | 847 |
"JV@2012-10-26: |
784 | 848 |
|
823 | 849 |
When a package is loaded from source using |
784 | 850 |
|
1484 | 851 |
Smalltalk loadPackage:'...' |
784 | 852 |
|
823 | 853 |
expression and a method from loaded class in namespace uses a class from the |
854 |
same package and same namespace, that is not yet loaded (i.e., it will be loaded |
|
855 |
later), |
|
784 | 856 |
|
857 |
then the compiler as of 2012-10-26 generates access to class in no namespace. |
|
858 |
||
859 |
This test checks for this bug |
|
860 |
" |
|
861 |
||
862 |
"/First, make sure that package is not yet loaded... |
|
823 | 863 |
self |
1484 | 864 |
assert: (Smalltalk at: #'exept_regression_testData_CompilerTests2') isNil |
865 |
description: 'Mock package already loaded'. |
|
784 | 866 |
|
823 | 867 |
self |
1499
26a16a04219b
Package renamed from exept:regression to stx:goodies/regression. Hooray!
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1484
diff
changeset
|
868 |
assert: (Smalltalk loadPackage: #'stx:goodies/regression/testData/CompilerTests2') |
1484 | 869 |
description: 'Cannot load mock package!!'. |
784 | 870 |
|
871 |
||
823 | 872 |
self assert: (Smalltalk at: #'RegressionTests::CompilerTests2Mock1') new foo class |
1484 | 873 |
== (Smalltalk at: #'RegressionTests::CompilerTests2Mock2') |
784 | 874 |
|
875 |
"Created: / 26-10-2012 / 12:26:57 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
876 |
"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
|
877 |
! |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
878 |
|
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
879 |
test_03 |
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
880 |
"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
|
881 |
|
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
882 |
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
|
883 |
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
|
884 |
" |
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
885 |
|
992
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
886 |
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
|
887 |
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
|
888 |
|
a28d3cfb7c43
Added test from global variable access when compiling from within the workspace.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
930
diff
changeset
|
889 |
"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
|
890 |
"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
|
891 |
! |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
892 |
|
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
893 |
test_04 |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
894 |
"JV@2013-10-27: |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
895 |
|
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
896 |
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
|
897 |
for perform:* with constant symbol. That's because |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
898 |
in Parser, rev 1.781 >> keywordExpressionFor:, line 57 the |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
899 |
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
|
900 |
set by constant-folding method. |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
901 |
" |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
902 |
|
993 | 903 |
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
|
904 |
self assert: (self bc_mock_04:2) == 4 |
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
905 |
|
4acfe6220c73
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
991
diff
changeset
|
906 |
"Created: / 27-08-2013 / 02:37:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
993 | 907 |
"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
|
908 |
! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
909 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
910 |
test_05a |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
911 |
"JV@2014-05-23: |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
912 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
913 |
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
|
914 |
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
|
915 |
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
|
916 |
of [A-Za-z]). |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
917 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
918 |
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
|
919 |
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
|
920 |
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
|
921 |
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
|
922 |
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
|
923 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
924 |
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
|
925 |
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
|
926 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
927 |
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
|
928 |
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
|
929 |
compled by STC. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
930 |
" |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
931 |
#(bc stc) do:[:mode | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
932 |
self compile: 'at: _key |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
933 |
^ #key' mode: mode. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
934 |
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
|
935 |
] |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
936 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
937 |
"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
|
938 |
"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
|
939 |
! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
940 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
941 |
test_05b |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
942 |
"JV@2014-05-23: |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
943 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
944 |
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
|
945 |
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
|
946 |
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
|
947 |
of [A-Za-z]. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
948 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
949 |
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
|
950 |
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
|
951 |
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
|
952 |
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
|
953 |
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
|
954 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
955 |
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
|
956 |
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
|
957 |
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
|
958 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
959 |
" |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
960 |
#(bc stc) do:[:mode | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
961 |
self compile: 'at: arg |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
962 |
| _key | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
963 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
964 |
_key := arg. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
965 |
^ #key' mode: mode. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
966 |
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
|
967 |
] |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
968 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
969 |
"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
|
970 |
"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
|
971 |
! ! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
972 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
973 |
!CompilerTests2 methodsFor:'tests - FFI'! |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
974 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
975 |
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
|
976 |
"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
|
977 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
978 |
<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
|
979 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
980 |
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
|
981 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
982 |
| malloc free | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
983 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
984 |
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
|
985 |
|
1138
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
986 |
malloc := 'malloc: size |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
987 |
|
1201
717489c30ebd
Added missing class CompilerTests2ExternalBytes - required by FFI test
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1163
diff
changeset
|
988 |
<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
|
989 |
self primitive failed'. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
990 |
free := 'free: ptr |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
991 |
|
1201
717489c30ebd
Added missing class CompilerTests2ExternalBytes - required by FFI test
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1163
diff
changeset
|
992 |
<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
|
993 |
self primitive failed'. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
994 |
#( #bc #stc ) do:[:mode | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
995 |
| ptr | |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
996 |
|
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
997 |
self compile:malloc mode:mode. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
998 |
self compile:free mode:mode. |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
999 |
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
|
1000 |
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
|
1001 |
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
|
1002 |
] |
cd03872a5b98
Two more tests covering stc bugs:
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1037
diff
changeset
|
1003 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1004 |
"Created: / 12-07-2016 / 23:54:54 / jv" |
1246
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 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1007 |
test_external_function_call_01a_w |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1008 |
"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
|
1009 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1010 |
<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
|
1011 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1012 |
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
|
1013 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1014 |
| getProcessHeap | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1015 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1016 |
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
|
1017 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1018 |
getProcessHeap := 'getProcessHeap |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1019 |
<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
|
1020 |
self primitive failed'. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1021 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1022 |
#( #bc #stc ) do:[:mode | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1023 |
| heap | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1024 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1025 |
self compile:getProcessHeap mode:mode. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1026 |
heap := self perform: (mode , '_getProcessHeap') asSymbol. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1027 |
self assert:heap class == RegressionTests::CompilerTests2ExternalBytes. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1028 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1029 |
] |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1030 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1031 |
"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
|
1032 |
! |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1033 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1034 |
test_external_function_call_01b_u |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1035 |
"Test for stx bug for <cdecl> specs like |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1036 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1037 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1038 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1039 |
i.e., when custom subclass of ExternalAddress is in namespace." |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1040 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1041 |
| malloc free | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1042 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1043 |
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
|
1044 |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1045 |
malloc := 'malloc: size |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1046 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1047 |
<cdecl: const RegressionTests::CompilerTests2ExternalBytes "malloc" ( int ) module: ''librun''> |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1048 |
self primitive failed'. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1049 |
free := 'free: ptr |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1050 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1051 |
<cdecl: const void "free" ( RegressionTests::CompilerTests2ExternalBytes ) module: ''librun''> |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1052 |
self primitive failed'. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1053 |
#( #bc #stc ) do:[:mode | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1054 |
| ptr | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1055 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1056 |
self compile:malloc mode:mode. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1057 |
self compile:free mode:mode. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1058 |
ptr := self perform:(mode , '_malloc:') asSymbol with:1. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1059 |
self assert:ptr class == RegressionTests::CompilerTests2ExternalBytes. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1060 |
self perform:(mode , '_free:') asSymbol with:ptr. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1061 |
] |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1062 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1063 |
"Created: / 12-07-2016 / 23:55:01 / jv" |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1064 |
! |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1065 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1066 |
test_external_function_call_01b_w |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1067 |
"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
|
1068 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1069 |
<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
|
1070 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1071 |
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
|
1072 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1073 |
| getProcessHeap | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1074 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1075 |
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
|
1076 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1077 |
getProcessHeap := 'getProcessHeap |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1078 |
<apicall: RegressionTests::CompilerTests2ExternalBytes "GetProcessHeap" ( ) module: "kernel32"> |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1079 |
self primitive failed'. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1080 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1081 |
#( #bc #stc ) do:[:mode | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1082 |
| heap | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1083 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1084 |
self compile:getProcessHeap mode:mode. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1085 |
heap := self perform: (mode , '_getProcessHeap') asSymbol. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1086 |
self assert:heap class == RegressionTests::CompilerTests2ExternalBytes. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1087 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1088 |
] |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1089 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1090 |
"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
|
1091 |
! |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1092 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1093 |
test_external_function_call_01c_u |
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1094 |
"Test for stx bug for <cdecl> specs like |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1095 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1096 |
<cdecl: Cairo::FontFace 'cairo_get_font_face' ( Cairo::GraphicsContext ) > |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1097 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1098 |
i.e., when custom subclass of ExternalAddress is in namespace." |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1099 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1100 |
| malloc free | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1101 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1102 |
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
|
1103 |
|
1246
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1104 |
malloc := 'malloc: size |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1105 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1106 |
<cdecl: const RegressionTests::CompilerTests2ExternalBytes "malloc" ( int )> |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1107 |
self primitive failed'. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1108 |
free := 'free: ptr |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1109 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1110 |
<cdecl: const void "free" ( RegressionTests::CompilerTests2ExternalBytes )> |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1111 |
self primitive failed'. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1112 |
#( #bc #stc ) do:[:mode | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1113 |
| ptr | |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1114 |
|
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1115 |
self compile:malloc mode:mode. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1116 |
self compile:free mode:mode. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1117 |
ptr := self perform:(mode , '_malloc:') asSymbol with:1. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1118 |
self assert:ptr class == RegressionTests::CompilerTests2ExternalBytes. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1119 |
self perform:(mode , '_free:') asSymbol with:ptr. |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1120 |
] |
cc5bd61b11b4
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1245
diff
changeset
|
1121 |
|
1510
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1122 |
"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
|
1123 |
! |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1124 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1125 |
test_external_function_call_01c_w |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1126 |
"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
|
1127 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1128 |
<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
|
1129 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1130 |
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
|
1131 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1132 |
| getProcessHeap | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1133 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1134 |
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
|
1135 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1136 |
getProcessHeap := 'getProcessHeap |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1137 |
<apicall: RegressionTests::CompilerTests2ExternalBytes "GetProcessHeap" ( )> |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1138 |
self primitive failed'. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1139 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1140 |
#( #bc #stc ) do:[:mode | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1141 |
| heap | |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1142 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1143 |
self compile:getProcessHeap mode:mode. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1144 |
heap := self perform: (mode , '_getProcessHeap') asSymbol. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1145 |
self assert:heap class == RegressionTests::CompilerTests2ExternalBytes. |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1146 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1147 |
] |
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1148 |
|
6fb7e9d33c4d
Fixed CompilerTests2>>test_external_function_call_*
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1506
diff
changeset
|
1149 |
"Created: / 14-07-2016 / 10:08:04 / jv" |
784 | 1150 |
! ! |
1151 |
||
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1152 |
!CompilerTests2 methodsFor:'tests - arg & var names'! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1153 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1154 |
test_argAndVarNames_04 |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1155 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1156 |
#(bc jit stc) do:[:mode | |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1157 |
savedContextArgAndVarNames := nil. |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1158 |
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
|
1159 |
self perform: (mode , '_method_argAndVarNames_04') asSymbol. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1160 |
self assert: savedContextArgAndVarNames = #(each isEven isOddNot). |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1161 |
self assert: savedContextArgAndVarValues = #(4 true true). |
988
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1162 |
] |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1163 |
|
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1164 |
"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
|
1165 |
"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
|
1166 |
! |
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1167 |
|
1475
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1168 |
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
|
1169 |
"/ 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
|
1170 |
"/ 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
|
1171 |
"/ 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
|
1172 |
"/ 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
|
1173 |
"/ |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1174 |
"/ 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
|
1175 |
"/ 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
|
1176 |
"/ 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
|
1177 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1178 |
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
|
1179 |
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
|
1180 |
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
|
1181 |
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
|
1182 |
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
|
1183 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1184 |
"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
|
1185 |
! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1186 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1187 |
test_argAndVarNames_05jit |
1247
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1188 |
"/ CG: this test tries to access the context of a block. |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1189 |
"/ 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
|
1190 |
"/ lifted to its home context. |
ff9a4f439ff9
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1246
diff
changeset
|
1191 |
"/ 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
|
1192 |
"/ |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1193 |
"/ 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
|
1194 |
"/ 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
|
1195 |
"/ 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
|
1196 |
|
1475
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1197 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1198 |
"/ 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
|
1199 |
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
|
1200 |
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
|
1201 |
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
|
1202 |
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
|
1203 |
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
|
1204 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1205 |
"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
|
1206 |
! |
991
c855ef9d606c
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
988
diff
changeset
|
1207 |
|
1475
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1208 |
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
|
1209 |
"/ 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
|
1210 |
"/ 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
|
1211 |
"/ 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
|
1212 |
"/ 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
|
1213 |
"/ |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1214 |
"/ 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
|
1215 |
"/ 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
|
1216 |
"/ 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
|
1217 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1218 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1219 |
"/ 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
|
1220 |
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
|
1221 |
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
|
1222 |
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
|
1223 |
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
|
1224 |
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
|
1225 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1226 |
"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
|
1227 |
! |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1228 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1229 |
test_argAndVarNames_06 |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1230 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1231 |
#(bc jit stc) do:[:mode | |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1232 |
savedContextArgAndVarNames := nil. |
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1233 |
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
|
1234 |
self perform: (mode , '_method_argAndVarNames_06') asSymbol. |
1212
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1235 |
self assert: savedContextArgAndVarNames = #(clsnm attributes cls superDef superNm). |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1236 |
self assert: savedContextArgAndVarValues = { |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1237 |
self class name. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1238 |
#(#autoload). |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1239 |
self class. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1240 |
Smalltalk at: #stx_goodies_sunit. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1241 |
self class superclass name. |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1242 |
} |
8429b2bff582
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1201
diff
changeset
|
1243 |
|
1001
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1244 |
] |
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1245 |
|
9478e093ee77
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
993
diff
changeset
|
1246 |
"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
|
1247 |
"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
|
1248 |
! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1249 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1250 |
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
|
1251 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1252 |
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
|
1253 |
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
|
1254 |
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
|
1255 |
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
|
1256 |
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
|
1257 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1258 |
"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
|
1259 |
! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1260 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1261 |
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
|
1262 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1263 |
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
|
1264 |
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
|
1265 |
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
|
1266 |
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
|
1267 |
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
|
1268 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1269 |
"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
|
1270 |
! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1271 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1272 |
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
|
1273 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1274 |
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
|
1275 |
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
|
1276 |
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
|
1277 |
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
|
1278 |
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
|
1279 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1280 |
"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
|
1281 |
"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
|
1282 |
! ! |
cd49b35f671f
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
948
diff
changeset
|
1283 |
|
899 | 1284 |
!CompilerTests2 methodsFor:'tests - line numbers'! |
1285 |
||
1286 |
test_lineno_01_bci |
|
1287 |
| m002 m300 l | |
|
1288 |
||
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1289 |
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
|
1290 |
m300 := self compile: (self class >> #method_lineno_300) source mode: #bc. |
899 | 1291 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1292 |
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
|
1293 |
self assert: (l := self bc_method_lineno_300) == 300. |
899 | 1294 |
|
1295 |
self assert: m002 code isNil. |
|
1296 |
self assert: m300 code isNil. |
|
1297 |
||
1298 |
"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
|
1299 |
"Modified: / 25-04-2013 / 15:24:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 | 1300 |
! |
1301 |
||
1302 |
test_lineno_01_jit |
|
1303 |
| m002 m300 l | |
|
1304 |
||
1473
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1305 |
|
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1306 |
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
|
1307 |
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
|
1308 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1309 |
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
|
1310 |
m300 := self compile: (self class >> #method_lineno_300) source mode: #jit. |
899 | 1311 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1312 |
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
|
1313 |
self assert: (l := self jit_method_lineno_300) == 300. |
899 | 1314 |
|
929
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1315 |
self assert: m002 code notNil. |
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1316 |
self assert: m300 code notNil. |
899 | 1317 |
|
1318 |
"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
|
1319 |
"Modified: / 10-05-2013 / 18:23:07 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 | 1320 |
! |
1321 |
||
1322 |
test_lineno_01_stc |
|
1323 |
| m002 m300 l | |
|
1324 |
||
1325 |
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
|
1326 |
m300 := self class >> #method_lineno_300. |
899 | 1327 |
|
921
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1328 |
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
|
1329 |
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
|
1330 |
|
cb5e99d58aab
Refactoring only - add more versatile compile method
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
900
diff
changeset
|
1331 |
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
|
1332 |
self assert: (l := self stc_method_lineno_300) == 300. |
899 | 1333 |
|
1334 |
"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
|
1335 |
"Modified: / 25-04-2013 / 15:22:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
899 | 1336 |
! ! |
1337 |
||
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1338 |
!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
|
1339 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1340 |
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
|
1341 |
| 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
|
1342 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1343 |
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
|
1344 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1345 |
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
|
1346 |
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
|
1347 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1348 |
l_stc := self stc_method_literals_array_01a. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1349 |
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
|
1350 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1351 |
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
|
1352 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1353 |
"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
|
1354 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1355 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1356 |
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
|
1357 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1358 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1359 |
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
|
1360 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1361 |
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
|
1362 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1363 |
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
|
1364 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1365 |
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
|
1366 |
self assert: l first == #'_XXX:_:'. |
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1367 |
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
|
1368 |
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
|
1369 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1370 |
"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
|
1371 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1372 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1373 |
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
|
1374 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1375 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1376 |
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
|
1377 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1378 |
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
|
1379 |
|
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1380 |
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
|
1381 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1382 |
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
|
1383 |
self assert: l first == #'_XXX:_:'. |
1245
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1384 |
self assert: l second == #'YYY'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1385 |
self assert: l third == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1386 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1387 |
"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
|
1388 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1389 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1390 |
test_literals_array_01b |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1391 |
| m l_stc l_bc | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1392 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1393 |
m := self class >> #method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1394 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1395 |
self compile: m source mode: #stc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1396 |
self compile: m source mode: #bc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1397 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1398 |
l_stc := self stc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1399 |
l_bc := self bc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1400 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1401 |
self assert: l_stc = l_bc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1402 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1403 |
"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
|
1404 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1405 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1406 |
test_literals_array_01b_bc |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1407 |
| m l | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1408 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1409 |
m := self class >> #method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1410 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1411 |
self compile: m source mode: #bc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1412 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1413 |
l := self bc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1414 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1415 |
self assert: l size == 3. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1416 |
self assert: l first == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1417 |
self assert: l second == #'YYY'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1418 |
self assert: l third == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1419 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1420 |
"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
|
1421 |
! |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1422 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1423 |
test_literals_array_01b_stc |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1424 |
| m l | |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1425 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1426 |
m := self class >> #method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1427 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1428 |
self compile: m source mode: #stc. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1429 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1430 |
l := self stc_method_literals_array_01b. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1431 |
|
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1432 |
self assert: l size == 3. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1433 |
self assert: l first == #'_XXX:_:'. |
a00a20a29299
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1212
diff
changeset
|
1434 |
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
|
1435 |
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
|
1436 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1437 |
"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
|
1438 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1439 |
|
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1440 |
test_literals_negativeZero_bc |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1441 |
| m l | |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1442 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1443 |
m := self class >> #method_negativeZero_01. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1444 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1445 |
self compile: m source mode: #bc. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1446 |
|
1273
0afeacccdc89
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1272
diff
changeset
|
1447 |
l := self bc_method_negativeZero_01. |
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1448 |
self assert: l = 0.0. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1449 |
self assert: l isNegativeZero. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1450 |
! |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1451 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1452 |
test_literals_negativeZero_stc |
1272
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1453 |
| m negZero | |
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1454 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1455 |
m := self class >> #method_negativeZero_01. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1456 |
|
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1457 |
self compile: m source mode: #stc. |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1458 |
|
1272
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1459 |
negZero := self stc_method_negativeZero_01. |
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1460 |
self assert: negZero = 0.0. |
dbe0aa7a4e17
class: RegressionTests::CompilerTests2
Stefan Vogel <sv@exept.de>
parents:
1271
diff
changeset
|
1461 |
self assert: negZero isNegativeZero. |
1271
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1462 |
! |
6004da64f1ef
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
1247
diff
changeset
|
1463 |
|
1037
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1464 |
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
|
1465 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1466 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1467 |
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
|
1468 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1469 |
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
|
1470 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1471 |
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
|
1472 |
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
|
1473 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1474 |
"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
|
1475 |
! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1476 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1477 |
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
|
1478 |
| m l | |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1479 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1480 |
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
|
1481 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1482 |
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
|
1483 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1484 |
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
|
1485 |
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
|
1486 |
|
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1487 |
"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
|
1488 |
! ! |
4bba0706b9ae
Added tests covering symbol parsing inconsistency in array literals.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1001
diff
changeset
|
1489 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1490 |
!CompilerTests2 methodsFor:'tests - method slot'! |
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 |
test_methodslot_01_bci |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1493 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1494 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1495 |
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
|
1496 |
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
|
1497 |
self assert: m code isNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1498 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1499 |
"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
|
1500 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1501 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1502 |
test_methodslot_01_jit |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1503 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1504 |
|
1473
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1505 |
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
|
1506 |
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
|
1507 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1508 |
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
|
1509 |
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
|
1510 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1511 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1512 |
"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
|
1513 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1514 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1515 |
test_methodslot_01_stc |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1516 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1517 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1518 |
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
|
1519 |
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
|
1520 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1521 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1522 |
"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
|
1523 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1524 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1525 |
test_methodslot_02_bci |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1526 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1527 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1528 |
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
|
1529 |
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
|
1530 |
self assert: m code isNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1531 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1532 |
"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
|
1533 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1534 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1535 |
test_methodslot_02_jit |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1536 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1537 |
|
1473
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1538 |
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
|
1539 |
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
|
1540 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1541 |
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
|
1542 |
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
|
1543 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1544 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1545 |
"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
|
1546 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1547 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1548 |
test_methodslot_02_stc |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1549 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1550 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1551 |
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
|
1552 |
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
|
1553 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1554 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1555 |
"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
|
1556 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1557 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1558 |
test_methodslot_03_bci |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1559 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1560 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1561 |
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
|
1562 |
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
|
1563 |
self assert: m code isNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1564 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1565 |
"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
|
1566 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1567 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1568 |
test_methodslot_03_jit |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1569 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1570 |
|
1473
e31a9559e135
Skip JIT tests on setups which do not support JIT
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1287
diff
changeset
|
1571 |
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
|
1572 |
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
|
1573 |
|
922
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1574 |
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
|
1575 |
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
|
1576 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1577 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1578 |
"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
|
1579 |
! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1580 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1581 |
test_methodslot_03_stc |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1582 |
| m | |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1583 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1584 |
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
|
1585 |
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
|
1586 |
self assert: m code notNil. |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1587 |
|
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1588 |
"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
|
1589 |
! ! |
7c65bb0a73f5
Added tests for method-in-context slot.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
921
diff
changeset
|
1590 |
|
1971
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1591 |
!CompilerTests2 methodsFor:'tests - regression'! |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1592 |
|
2595
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1593 |
test_hash_typed_array_prefix_collon_symbols |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1594 |
"/ Smalltalk/X supports Scheme-like typed array |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1595 |
"/ literals like #d(1 2 3). However, due to a bug in |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1596 |
"/ scanner, symbols named by these prefixes followed |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1597 |
"/ by collon were not scanned correctly, i.e, |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1598 |
"/ #d: was actually scanned as two tokens, #d and collon. |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1599 |
"/ |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1600 |
"/ This tests for this bug. |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1601 |
| parser | |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1602 |
parser := (Scanner for: '#a:') nextToken; yourself. |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1603 |
self assert: parser tokenType == #Symbol. |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1604 |
self assert: parser tokenValue == #'a:' . |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1605 |
|
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1606 |
parser := (Scanner for: '#d:') nextToken; yourself. |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1607 |
self assert: parser tokenType == #Symbol. |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1608 |
self assert: parser tokenValue == #'d:' . |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1609 |
|
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1610 |
ByteCodeCompiler |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1611 |
compile:'foo #d:' |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1612 |
forClass:self class install:false |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1613 |
|
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1614 |
"Created: / 18-03-2021 / 23:30:45 / Jan Vrany <jan.vrany@labware.com>" |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1615 |
! |
0ae7d724b885
Add test for 'special' symbols
Jan Vrany <jan.vrany@labware.com>
parents:
2095
diff
changeset
|
1616 |
|
1971
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1617 |
test_issue_205a |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1618 |
| source | |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1619 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1620 |
ParserFlags allowAssignmentToBlockArgument: true. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1621 |
ParserFlags warnAssignmentToBlockArgument: false. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1622 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1623 |
source := 'foo | r | r := 0. 1 to: 10 do:[ :i | r := i. i := 100. self assert: i == 100 ]. ^ r'. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1624 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1625 |
self compile: source mode: #bc. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1626 |
self assert: (self perform: #bc_foo) == 10. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1627 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1628 |
self compile: source mode: #jit. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1629 |
self assert: (self perform: #jit_foo) == 10. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1630 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1631 |
"Created: / 18-04-2018 / 15:12:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1632 |
"Modified: / 18-04-2018 / 23:20:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1633 |
! |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1634 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1635 |
test_issue_205b |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1636 |
| source | |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1637 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1638 |
ParserFlags allowAssignmentToBlockArgument: true. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1639 |
ParserFlags warnAssignmentToBlockArgument: false. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1640 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1641 |
source := 'foo | r | r := 0. 1 to: 10 do:[ :i | r := i. r == 1 ifTrue:[ r > 0 ifTrue: [ i := 100. self assert: i == 100 ] ] ]. ^ r'. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1642 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1643 |
self compile: source mode: #bc. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1644 |
self assert: (self perform: #bc_foo) == 10. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1645 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1646 |
self compile: source mode: #jit. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1647 |
self assert: (self perform: #jit_foo) == 10. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1648 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1649 |
"Created: / 18-04-2018 / 16:33:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1650 |
"Modified: / 18-04-2018 / 23:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1651 |
! |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1652 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1653 |
test_issue_205c |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1654 |
| source | |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1655 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1656 |
ParserFlags allowAssignmentToBlockArgument: true. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1657 |
ParserFlags warnAssignmentToBlockArgument: false. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1658 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1659 |
source := 'foo | r | r := 0. 1 to: 10 do:[ :i | r := i. #(1 2 3 5) do:[:e| i := 100 ]. self assert: i == 100 ]. ^ r'. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1660 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1661 |
self compile: source mode: #bc. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1662 |
self assert: (self perform: #bc_foo) == 10. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1663 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1664 |
self compile: source mode: #jit. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1665 |
self assert: (self perform: #jit_foo) == 10. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1666 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1667 |
"Created: / 18-04-2018 / 16:35:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1668 |
! |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1669 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1670 |
test_issue_205d |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1671 |
| source | |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1672 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1673 |
ParserFlags allowAssignmentToBlockArgument: true. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1674 |
ParserFlags warnAssignmentToBlockArgument: false. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1675 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1676 |
source := 'foo | r | r := 0. 1 to: 10 by: 2 do:[ :i | r := i. i := 100. self assert: i == 100 ]. ^ r'. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1677 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1678 |
self compile: source mode: #bc. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1679 |
self assert: (self perform: #bc_foo) == 9. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1680 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1681 |
self compile: source mode: #jit. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1682 |
self assert: (self perform: #jit_foo) == 9. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1683 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1684 |
"Created: / 18-04-2018 / 16:45:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1685 |
"Modified: / 18-04-2018 / 23:31:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1686 |
! |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1687 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1688 |
test_issue_205e |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1689 |
| source | |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1690 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1691 |
ParserFlags allowAssignmentToBlockArgument: true. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1692 |
ParserFlags warnAssignmentToBlockArgument: false. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1693 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1694 |
source := 'foo | r | r := 0. 1 to: 10 by: 2 do:[ :i | r := i. r == 1 ifTrue:[ r > 0 ifTrue: [ i := 100. self assert: i == 100 ] ] ]. ^ r'. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1695 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1696 |
self compile: source mode: #bc. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1697 |
self assert: (self perform: #bc_foo) == 9. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1698 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1699 |
self compile: source mode: #jit. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1700 |
self assert: (self perform: #jit_foo) == 9. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1701 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1702 |
"Created: / 18-04-2018 / 16:46:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1703 |
"Modified: / 18-04-2018 / 23:32:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1704 |
! |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1705 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1706 |
test_issue_205f |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1707 |
| source | |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1708 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1709 |
ParserFlags allowAssignmentToBlockArgument: true. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1710 |
ParserFlags warnAssignmentToBlockArgument: false. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1711 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1712 |
source := 'foo | r | r := 0. 1 to: 10 by: 2 do:[ :i | r := i. #(1 2 3 5) do:[:e| i := 100 ]. self assert: i == 100 ]. ^ r'. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1713 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1714 |
self compile: source mode: #bc. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1715 |
self assert: (self perform: #bc_foo) == 9. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1716 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1717 |
self compile: source mode: #jit. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1718 |
self assert: (self perform: #jit_foo) == 9. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1719 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1720 |
"Created: / 18-04-2018 / 16:51:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1721 |
! |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1722 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1723 |
test_issue_205g |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1724 |
| source | |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1725 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1726 |
ParserFlags allowAssignmentToBlockArgument: true. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1727 |
ParserFlags warnAssignmentToBlockArgument: false. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1728 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1729 |
source := 'foo | r | r := 0. [ 1 to: 10 do:[ :i | r := i. i := 100. self assert: i == 100 ] ] valueWithOptionalArgument: ''bogus''. ^ r'. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1730 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1731 |
self compile: source mode: #bc. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1732 |
self assert: (self perform: #bc_foo) == 10. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1733 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1734 |
self compile: source mode: #jit. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1735 |
self assert: (self perform: #jit_foo) == 10. |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1736 |
|
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1737 |
"Created: / 18-04-2018 / 23:15:17 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1738 |
! ! |
de93bc901dba
Issue #205: added regression tests
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1944
diff
changeset
|
1739 |
|
784 | 1740 |
!CompilerTests2 class methodsFor:'documentation'! |
1741 |
||
1742 |
version |
|
1743 |
^ '$Header$' |
|
1744 |
! |
|
1745 |
||
1746 |
version_CVS |
|
1747 |
^ '$Header$' |
|
1748 |
! |
|
1749 |
||
1475
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1750 |
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
|
1751 |
|
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1752 |
^ '$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
|
1753 |
! |
ea3d40ebae8f
More tests for context variables and values (used by the debugger)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
1473
diff
changeset
|
1754 |
|
784 | 1755 |
version_SVN |
929
5c6f8d37f9ce
class: RegressionTests::CompilerTests2
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
922
diff
changeset
|
1756 |
^ '$Id$' |
784 | 1757 |
! ! |
870
577f844aedf7
class: RegressionTests::CompilerTests2
Claus Gittinger <cg@exept.de>
parents:
823
diff
changeset
|
1758 |