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