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