Tests moved to separate subpackage to follow St/X conventions.
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 30 Oct 2014 22:27:09 +0000
changeset 44840c68a91cdd
parent 43 c8afb8e4c3cc
child 45 04a50b0d540a
Tests moved to separate subpackage to follow St/X conventions.
IRBuilderTest.st
IRTransformTest.st
Make.proto
abbrev.stc
bc.mak
ctu_ircompiler.st
ircompiler.rc
tests/IRBuilderTest.st
tests/IRTransformTest.st
tests/Make.proto
tests/Make.spec
tests/Makefile.init
tests/abbrev.stc
tests/bc.mak
tests/bmake.bat
tests/ctu_ircompiler_tests.st
tests/lccmake.bat
tests/libInit.cc
tests/mingwmake.bat
tests/tests.rc
tests/vcmake.bat
     1.1 --- a/IRBuilderTest.st	Thu Oct 30 22:23:12 2014 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,1031 +0,0 @@
     1.4 -"{ Package: 'ctu:ircompiler' }"
     1.5 -
     1.6 -TestCase subclass:#IRBuilderTest
     1.7 -	instanceVariableNames:''
     1.8 -	classVariableNames:'TestToPush'
     1.9 -	poolDictionaries:''
    1.10 -	category:'IR Compiler-Tests'
    1.11 -!
    1.12 -
    1.13 -
    1.14 -!IRBuilderTest class methodsFor:'as yet unclassified'!
    1.15 -
    1.16 -testToPush
    1.17 -	^TestToPush
    1.18 -!
    1.19 -
    1.20 -testToPush: anObject
    1.21 -
    1.22 -	TestToPush := anObject
    1.23 -! !
    1.24 -
    1.25 -!IRBuilderTest methodsFor:'mock methods'!
    1.26 -
    1.27 -mock1: arg1 with: arg2
    1.28 -
    1.29 -    ^arg1 + arg2
    1.30 -
    1.31 -    "Created: / 02-12-2008 / 09:11:46 / Jan Vrany <vranyj1@fel.cvut.cz>"
    1.32 -!
    1.33 -
    1.34 -mock2
    1.35 -
    1.36 -    ^[ testSelector ]
    1.37 -
    1.38 -    "
    1.39 -    decompiling IRBuilderTest>>mock2
    1.40 -    nA: 0 nV: 0 nT: 2   
    1.41 -    
    1.42 -    1: 37 04 00 00             makeBlock 4 (7) nv=0 na=0
    1.43 -    5: 5A                      pushInstVar1
    1.44 -    6: 00                      retTop
    1.45 -    7: 08 03                   LINE[3]
    1.46 -    9: 00                      retTop
    1.47 -    "
    1.48 -
    1.49 -    "Created: / 28-03-2009 / 18:47:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
    1.50 -    "Modified: / 28-03-2009 / 20:16:08 / Jan Vrany <vranyj1@fel.cvut.cz>"
    1.51 -!
    1.52 -
    1.53 -mock3
    1.54 -    | b |
    1.55 -    b := 1.
    1.56 -    ^[ b ]
    1.57 -
    1.58 -    "
    1.59 -    decompiling IRBuilderTest>>mock3
    1.60 -    nA: 0 nV: 1 nT: 2
    1.61 -
    1.62 -    1: 79                      push1
    1.63 -    2: 64                      storeMethodVar1
    1.64 -    3: 37 04 00 00             makeBlock 4 (9) nv=0 na=0
    1.65 -    7: 50                      pushMethodVar1
    1.66 -    8: 00                      retTop
    1.67 -    9: 08 04                   LINE[4]
    1.68 -    11:00                      retTop
    1.69 -    "
    1.70 -
    1.71 -    "Created: / 28-03-2009 / 20:16:36 / Jan Vrany <vranyj1@fel.cvut.cz>"
    1.72 -!
    1.73 -
    1.74 -mock4
    1.75 -
    1.76 -    ^[:arg| arg ]
    1.77 -
    1.78 -    "
    1.79 -    decompiling IRBuilderTest>>mock4
    1.80 -    nA: 0 nV: 0 nT: 2
    1.81 -
    1.82 -    1: 37 04 00 01             makeBlock 4 (7) nv=0 na=1
    1.83 -    5: 8C                      pushBlockArg1
    1.84 -    6: 00                      retTop
    1.85 -    7: 08 03                   LINE[3]
    1.86 -    9: 00                      retTop
    1.87 -
    1.88 -
    1.89 -
    1.90 -    "
    1.91 -
    1.92 -    "Created: / 28-03-2009 / 20:18:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
    1.93 -!
    1.94 -
    1.95 -mock5
    1.96 -
    1.97 -    ^[|temp| temp ]
    1.98 -
    1.99 -    "
   1.100 -    decompiling IRBuilderTest>>mock5
   1.101 -    nA: 0 nV: 0 nT: 2
   1.102 -    
   1.103 -    1: 37 04 01 00             makeBlock 4 (7) nv=1 na=0
   1.104 -    5: E8                      pushBlockVar1
   1.105 -    6: 00                      retTop
   1.106 -    7: 08 03                   LINE[3]
   1.107 -    9: 00                      retTop
   1.108 -    "
   1.109 -
   1.110 -    "Created: / 28-03-2009 / 20:19:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.111 -!
   1.112 -
   1.113 -mock6
   1.114 -
   1.115 -    ^[|temp| [ temp ] ]
   1.116 -
   1.117 -    "
   1.118 -    decompiling IRBuilderTest>>mock6
   1.119 -    nA: 0 nV: 0 nT: 3
   1.120 -
   1.121 -    1: 37 0B 01 00             makeBlock 11 (14) nv=1 na=0
   1.122 -    5: 37 06 00 00             makeBlock 6 (13) nv=0 na=0
   1.123 -    9: 80 01 01                pushOuterBlockVar 1 lvl: 1
   1.124 -    12:00                      retTop
   1.125 -    13:00                      retTop
   1.126 -    14:08 03                   LINE[3]
   1.127 -    16:00                      retTop
   1.128 -
   1.129 -    "
   1.130 -
   1.131 -    "Created: / 28-03-2009 / 20:20:06 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.132 -!
   1.133 -
   1.134 -mock7
   1.135 -    | b |
   1.136 -    b := 1.
   1.137 -    ^[ ^b ]
   1.138 -
   1.139 -    "
   1.140 -    decompiling IRBuilderTest>>mock7
   1.141 -    nA: 0 nV: 1 nT: 2
   1.142 -
   1.143 -    1: 79                      push1
   1.144 -    2: 64                      storeMethodVar1
   1.145 -    3: 37 06 00 00             makeBlock 6 (11) nv=0 na=0
   1.146 -    7: 50                      pushMethodVar1
   1.147 -    8: 08 04                   LINE[4]
   1.148 -    10:07                      homeRetTop
   1.149 -    11:08 04                   LINE[4]
   1.150 -    13:00                      retTop
   1.151 -
   1.152 -    "
   1.153 -
   1.154 -    "Created: / 28-03-2009 / 20:21:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.155 -!
   1.156 -
   1.157 -mock8
   1.158 -
   1.159 -    ^([:arg| arg ] value: 22)
   1.160 -
   1.161 -    "Created: / 30-03-2009 / 19:21:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.162 -!
   1.163 -
   1.164 -mock9
   1.165 -
   1.166 -    ^[:barg1 | [:barg2 | barg2 ] value: barg1 ]
   1.167 -        value: 22
   1.168 -
   1.169 -    "
   1.170 -    decompiling IRBuilderTest>>mock9
   1.171 -    nA: 0 nV: 0 nT: 3
   1.172 -    
   1.173 -     1: 37 0C 00 01             makeBlock 12 (15) nv=0 na=1
   1.174 -     5: 37 04 00 01             makeBlock 4 (11) nv=0 na=1
   1.175 -     9: 8C                      pushBlockArg1
   1.176 -    10: 00                      retTop
   1.177 -    11: 8C                      pushBlockArg1
   1.178 -    12: 98 03                   send1 #value:[3]
   1.179 -    14: 00                      retTop
   1.180 -    15: 10 16                   pushNum 22
   1.181 -    17: 98 04                   send1 #value:[4]
   1.182 -    19: 08 03                   LINE[3]
   1.183 -    21: 00 
   1.184 -    
   1.185 -    "
   1.186 -
   1.187 -    "Created: / 11-05-2009 / 23:09:57 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.188 -! !
   1.189 -
   1.190 -!IRBuilderTest methodsFor:'testing'!
   1.191 -
   1.192 -halt
   1.193 -        "Redefinition for testing the #send:toSuperOf:"
   1.194 -
   1.195 -    "Created: / 11-06-2008 / 16:08:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.196 -!
   1.197 -
   1.198 -isThisEverCalled
   1.199 -	"Redefinition for testing the #send:toSuperOf:"
   1.200 -!
   1.201 -
   1.202 -testDup
   1.203 -    |iRMethod aCompiledMethod|
   1.204 -
   1.205 -    iRMethod := (IRBuilder new)
   1.206 -                numRargs:1;
   1.207 -                addTemps:#( #self );
   1.208 -                pushLiteral:3;
   1.209 -                pushDup;
   1.210 -                send:#'=';
   1.211 -                returnTop;
   1.212 -                ir.
   1.213 -    aCompiledMethod := iRMethod compiledCode.
   1.214 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.215 -    self 
   1.216 -        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = true).
   1.217 -!
   1.218 -
   1.219 -testInstVar
   1.220 -    |aCompiledMethod irBuilder|
   1.221 -
   1.222 -    irBuilder := (IRBuilder new)
   1.223 -                numRargs:1;
   1.224 -                addTemps:#( #self );
   1.225 -                pushInstVar:1;
   1.226 -                pushInstVar:2;
   1.227 -                send:#'+';
   1.228 -                returnTop;
   1.229 -                ir.
   1.230 -    aCompiledMethod := irBuilder compiledCode.
   1.231 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.232 -    self 
   1.233 -        assert:((aCompiledMethod valueWithReceiver:(3 @ 4) arguments:#()) = 7).
   1.234 -
   1.235 -    "Modified: / 11-06-2008 / 13:16:41 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.236 -!
   1.237 -
   1.238 -testJumpAheadTo
   1.239 -    |iRMethod aCompiledMethod|
   1.240 -
   1.241 -    iRMethod := (IRBuilder new)
   1.242 -                numRargs:1;
   1.243 -                addTemps:#( #self );
   1.244 -                pushTemp:#self;
   1.245 -                jumpAheadTo:#end;
   1.246 -                pushLiteral:3;
   1.247 -                jumpAheadTarget:#end;
   1.248 -                returnTop;
   1.249 -                ir.
   1.250 -    aCompiledMethod := iRMethod compiledCode.
   1.251 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.252 -    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = nil).
   1.253 -!
   1.254 -
   1.255 -testJumpAheadToIf
   1.256 -    |iRMethod aCompiledMethod|
   1.257 -
   1.258 -    iRMethod := (IRBuilder new)
   1.259 -                numRargs:1;
   1.260 -                addTemps:#( #self );
   1.261 -                pushTemp:#self;
   1.262 -                pushLiteral:true;
   1.263 -                jumpAheadTo:#end if:true;
   1.264 -                pushLiteral:3;
   1.265 -                jumpAheadTarget:#end;
   1.266 -                returnTop;
   1.267 -                ir.
   1.268 -    aCompiledMethod := iRMethod compiledCode.
   1.269 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.270 -    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = nil).
   1.271 -!
   1.272 -
   1.273 -testJumpBackTo
   1.274 -    |iRMethod aCompiledMethod|
   1.275 -
   1.276 -    iRMethod := (IRBuilder new)
   1.277 -                numRargs:1;
   1.278 -                addTemps:#( #self );
   1.279 -                pushTemp:#self;
   1.280 -                pushLiteral:false;
   1.281 -                jumpBackTarget:#begin;
   1.282 -                jumpAheadTo:#end if:true;
   1.283 -                pushLiteral:true;
   1.284 -                jumpBackTo:#begin;
   1.285 -                jumpAheadTarget:#end;
   1.286 -                returnTop;
   1.287 -                ir.
   1.288 -    aCompiledMethod := iRMethod compiledCode.
   1.289 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.290 -    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = nil).
   1.291 -!
   1.292 -
   1.293 -testLine1
   1.294 -    |iRMethod aCompiledMethod|
   1.295 -
   1.296 -    iRMethod := (IRBuilder new)
   1.297 -                numRargs:1;
   1.298 -                addTemps:#( #self );
   1.299 -                line:5;
   1.300 -                pushLiteral:true;
   1.301 -                returnTop;
   1.302 -                ir.
   1.303 -    aCompiledMethod := iRMethod compiledCode.
   1.304 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.305 -    self 
   1.306 -        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = true).
   1.307 -
   1.308 -    "Created: / 02-12-2008 / 09:11:06 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.309 -!
   1.310 -
   1.311 -testLine2
   1.312 -    |iRMethod aCompiledMethod|
   1.313 -
   1.314 -    iRMethod := (IRBuilder new)
   1.315 -                numRargs:1;
   1.316 -                addTemps:#( #self );
   1.317 -                line:5;
   1.318 -                pushLiteral:true;
   1.319 -                pushLiteral:false;
   1.320 -                send:#'&';
   1.321 -                returnTop;
   1.322 -                ir.
   1.323 -    aCompiledMethod := iRMethod compiledCode.
   1.324 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.325 -    self 
   1.326 -        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = false).
   1.327 -
   1.328 -    "Created: / 02-12-2008 / 09:11:42 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.329 -!
   1.330 -
   1.331 -testLiteralArray
   1.332 -    |iRMethod aCompiledMethod|
   1.333 -
   1.334 -    iRMethod := (IRBuilder new)
   1.335 -                numRargs:1;
   1.336 -                addTemps:#( #self );
   1.337 -                pushLiteral:#( #test 4 #you );
   1.338 -                returnTop;
   1.339 -                ir.
   1.340 -    aCompiledMethod := iRMethod compiledCode.
   1.341 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.342 -    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) 
   1.343 -                = #( #test 4 #you )).
   1.344 -!
   1.345 -
   1.346 -testLiteralBoolean
   1.347 -    |iRMethod aCompiledMethod|
   1.348 -
   1.349 -    iRMethod := (IRBuilder new)
   1.350 -                numRargs:1;
   1.351 -                addTemps:#( #self );
   1.352 -                pushLiteral:true;
   1.353 -                returnTop;
   1.354 -                ir.
   1.355 -    aCompiledMethod := iRMethod compiledCode.
   1.356 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.357 -    self 
   1.358 -        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = true).
   1.359 -!
   1.360 -
   1.361 -testLiteralCharacter
   1.362 -    |iRMethod aCompiledMethod|
   1.363 -
   1.364 -    iRMethod := (IRBuilder new)
   1.365 -                numRargs:1;
   1.366 -                addTemps:#( #self );
   1.367 -                pushLiteral:$e;
   1.368 -                returnTop;
   1.369 -                ir.
   1.370 -    aCompiledMethod := iRMethod compiledCode.
   1.371 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.372 -    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = $e).
   1.373 -!
   1.374 -
   1.375 -testLiteralFloat
   1.376 -    |iRMethod aCompiledMethod|
   1.377 -
   1.378 -    iRMethod := (IRBuilder new)
   1.379 -                numRargs:1;
   1.380 -                addTemps:#( #self );
   1.381 -                pushLiteral:2.0;
   1.382 -                returnTop;
   1.383 -                ir.
   1.384 -    aCompiledMethod := iRMethod compiledCode.
   1.385 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.386 -    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = 2.0).
   1.387 -
   1.388 -    "Modified: / 03-11-2008 / 08:39:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.389 -!
   1.390 -
   1.391 -testLiteralInteger
   1.392 -    |iRMethod aCompiledMethod|
   1.393 -
   1.394 -    iRMethod := (IRBuilder new)
   1.395 -                numRargs:1;
   1.396 -                addTemps:#( #self );
   1.397 -                pushLiteral:2;
   1.398 -                returnTop;
   1.399 -                ir.
   1.400 -    aCompiledMethod := iRMethod compiledCode.
   1.401 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.402 -    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = 2).
   1.403 -!
   1.404 -
   1.405 -testLiteralNil
   1.406 -    |iRMethod aCompiledMethod|
   1.407 -
   1.408 -    iRMethod := (IRBuilder new)
   1.409 -                numRargs:1;
   1.410 -                addTemps:#( #self );
   1.411 -                pushLiteral:nil;
   1.412 -                returnTop;
   1.413 -                ir.
   1.414 -    aCompiledMethod := iRMethod compiledCode.
   1.415 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.416 -    self assert:((aCompiledMethod valueWithReceiver:4 arguments:#()) = nil).
   1.417 -!
   1.418 -
   1.419 -testLiteralString
   1.420 -    |iRMethod aCompiledMethod|
   1.421 -
   1.422 -    iRMethod := (IRBuilder new)
   1.423 -                numRargs:1;
   1.424 -                addTemps:#( #self );
   1.425 -                pushLiteral:'hello';
   1.426 -                returnTop;
   1.427 -                ir.
   1.428 -    aCompiledMethod := iRMethod compiledCode.
   1.429 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.430 -    self 
   1.431 -        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = 'hello').
   1.432 -!
   1.433 -
   1.434 -testLiteralSymbole
   1.435 -    |iRMethod aCompiledMethod|
   1.436 -
   1.437 -    iRMethod := (IRBuilder new)
   1.438 -                numRargs:1;
   1.439 -                addTemps:#( #self );
   1.440 -                pushLiteral:#you;
   1.441 -                returnTop;
   1.442 -                ir.
   1.443 -    aCompiledMethod := iRMethod compiledCode.
   1.444 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.445 -    self 
   1.446 -        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = #you).
   1.447 -!
   1.448 -
   1.449 -testLiteralVariableClass
   1.450 -    |iRMethod aCompiledMethod|
   1.451 -
   1.452 -    iRMethod := (IRBuilder new)
   1.453 -                numRargs:1;
   1.454 -                addTemps:#( #self );
   1.455 -                pushLiteralVariable:Object binding;
   1.456 -                returnTop;
   1.457 -                ir.
   1.458 -    aCompiledMethod := iRMethod compiledCode.
   1.459 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.460 -    self 
   1.461 -        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = Object).
   1.462 -!
   1.463 -
   1.464 -testLiteralVariableClassVariable
   1.465 -    |iRMethod aCompiledMethod|
   1.466 -
   1.467 -    iRMethod := (IRBuilder new)
   1.468 -                numRargs:1;
   1.469 -                addTemps:#( #self );
   1.470 -                pushLiteralVariable:(ArithmeticValue bindingOf:#ArithmeticSignal);
   1.471 -                returnTop;
   1.472 -                ir.
   1.473 -    aCompiledMethod := iRMethod compiledCode.
   1.474 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.475 -    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) 
   1.476 -                = ArithmeticValue arithmeticSignal).
   1.477 -
   1.478 -    "Modified: / 11-06-2008 / 11:31:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.479 -!
   1.480 -
   1.481 -testLiteralVariableGlobale
   1.482 -    |iRMethod aCompiledMethod|
   1.483 -
   1.484 -    iRMethod := (IRBuilder new)
   1.485 -                numRargs:1;
   1.486 -                addTemps:#( #self );
   1.487 -                pushLiteralVariable:Smalltalk binding;
   1.488 -                returnTop;
   1.489 -                ir.
   1.490 -    aCompiledMethod := iRMethod compiledCode.
   1.491 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.492 -    self 
   1.493 -        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = Smalltalk).
   1.494 -
   1.495 -    "Modified: / 11-06-2008 / 11:32:07 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.496 -!
   1.497 -
   1.498 -testPopTop
   1.499 -    |iRMethod aCompiledMethod|
   1.500 -
   1.501 -    iRMethod := (IRBuilder new)
   1.502 -                numRargs:1;
   1.503 -                addTemps:#( #self );
   1.504 -                pushLiteral:true;
   1.505 -                pushLiteral:false;
   1.506 -                popTop;
   1.507 -                returnTop;
   1.508 -                ir.
   1.509 -    aCompiledMethod := iRMethod compiledCode.
   1.510 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.511 -    self 
   1.512 -        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = true).
   1.513 -
   1.514 -    "Modified: / 11-06-2008 / 13:22:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.515 -!
   1.516 -
   1.517 -testPushReceiver
   1.518 -    |iRMethod aCompiledMethod receiver|
   1.519 -
   1.520 -    iRMethod := (IRBuilder new)
   1.521 -                numRargs:1;
   1.522 -                addTemps:#( #self );
   1.523 -                pushReceiver;
   1.524 -                returnTop;
   1.525 -                ir.
   1.526 -    aCompiledMethod := iRMethod compiledCode.
   1.527 -    receiver := (5 @ 8).
   1.528 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.529 -    self assert:((aCompiledMethod valueWithReceiver:receiver arguments:#()) 
   1.530 -                == receiver).
   1.531 -!
   1.532 -
   1.533 -testPushTempArgument
   1.534 -    |iRMethod aCompiledMethod|
   1.535 -
   1.536 -    iRMethod := (IRBuilder new)
   1.537 -                numRargs:3;
   1.538 -                addTemps:#( #self #a #b );
   1.539 -                pushTemp:#a;
   1.540 -                pushTemp:#b;
   1.541 -                send:#'+';
   1.542 -                returnTop;
   1.543 -                ir.
   1.544 -    aCompiledMethod := iRMethod compiledCode.
   1.545 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.546 -    self 
   1.547 -        assert:((aCompiledMethod valueWithReceiver:nil arguments:#( 2 8 )) = 10).
   1.548 -!
   1.549 -
   1.550 -testPushTempSelf
   1.551 -    |iRMethod aCompiledMethod|
   1.552 -
   1.553 -    iRMethod := (IRBuilder new)
   1.554 -                numRargs:1;
   1.555 -                addTemps:#( #self );
   1.556 -                pushTemp:#self;
   1.557 -                send:#class;
   1.558 -                returnTop;
   1.559 -                ir.
   1.560 -    aCompiledMethod := iRMethod compiledCode.
   1.561 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.562 -    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) 
   1.563 -                == UndefinedObject).
   1.564 -!
   1.565 -
   1.566 -testPushTempTemp
   1.567 -    |iRMethod aCompiledMethod|
   1.568 -
   1.569 -    iRMethod := (IRBuilder new)
   1.570 -                numRargs:1;
   1.571 -                addTemps:#( #self #a );
   1.572 -                pushTemp:#a;
   1.573 -                returnTop;
   1.574 -                ir.
   1.575 -    aCompiledMethod := iRMethod compiledCode.
   1.576 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.577 -    self assert:((aCompiledMethod valueWithReceiver:5 arguments:#()) = nil).
   1.578 -!
   1.579 -
   1.580 -testPushThisContext
   1.581 -    |iRMethod aCompiledMethod|
   1.582 -
   1.583 -    iRMethod := (IRBuilder new)
   1.584 -                numRargs:1;
   1.585 -                addTemps:#( #self #a );
   1.586 -                pushThisContext;
   1.587 -                send:#receiver;
   1.588 -                returnTop;
   1.589 -                ir.
   1.590 -    aCompiledMethod := iRMethod compiledCode.
   1.591 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.592 -    self assert:((aCompiledMethod valueWithReceiver:5 arguments:#()) = 5).
   1.593 -!
   1.594 -
   1.595 -testPushThisEnv
   1.596 -    |iRMethod aCompiledMethod receiver|
   1.597 -
   1.598 -    ^ self.
   1.599 -    iRMethod := (IRBuilder new)
   1.600 -                numRargs:1;
   1.601 -                addTemps:#( #self );
   1.602 -                pushThisContext;
   1.603 -                pushLiteral:5;
   1.604 -                pushLiteral:ClosureEnvironment;
   1.605 -                pushLiteral:1;
   1.606 -                send:#new:;
   1.607 -                send:#privSetInstVar:put:;
   1.608 -                pushThisEnv;
   1.609 -                returnTop;
   1.610 -                ir.
   1.611 -    aCompiledMethod := iRMethod compiledCode.
   1.612 -    receiver := Object new.
   1.613 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.614 -    self assert:((aCompiledMethod valueWithReceiver:receiver arguments:#()) 
   1.615 -                isKindOf:ClosureEnvironment)
   1.616 -!
   1.617 -
   1.618 -testSendNumArgs1
   1.619 -    |iRMethod aCompiledMethod|
   1.620 -
   1.621 -    iRMethod := (IRBuilder new)
   1.622 -                numRargs:1;
   1.623 -                addTemps:#( #self );
   1.624 -                pushReceiver;
   1.625 -                pushLiteral:1;
   1.626 -                pushLiteral:2;
   1.627 -                send:#mock1 numArgs:2;
   1.628 -                returnTop;
   1.629 -                ir.
   1.630 -    aCompiledMethod := iRMethod compiledCode.
   1.631 -    self class basicAddSelector:#mock1
   1.632 -        withMethod:(self class >> #mock1:with:).
   1.633 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.634 -    self 
   1.635 -        assert:(aCompiledMethod valueWithReceiver:(IRBuilderTest new)
   1.636 -                arguments:#()) = 3.
   1.637 -    self class basicRemoveSelector:#mock1.
   1.638 -
   1.639 -    "Created: / 01-12-2008 / 19:58:18 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.640 -!
   1.641 -
   1.642 -testSendNumArgs2
   1.643 -    |iRMethod aCompiledMethod|
   1.644 -
   1.645 -    iRMethod := (IRBuilder new)
   1.646 -                numRargs:1;
   1.647 -                addTemps:#( #self );
   1.648 -                pushReceiver;
   1.649 -                pushLiteral:1;
   1.650 -                send:#mock1 numArgs:1;
   1.651 -                returnTop;
   1.652 -                ir.
   1.653 -    aCompiledMethod := iRMethod compiledCode.
   1.654 -    self class basicAddSelector:#mock1
   1.655 -        withMethod:(self class >> #mock1:with:).
   1.656 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.657 -    self 
   1.658 -        should:[
   1.659 -            (aCompiledMethod valueWithReceiver:(IRBuilderTest new) arguments:#())
   1.660 -        ]
   1.661 -        raise:Error.
   1.662 -    self class basicRemoveSelector:#mock1.
   1.663 -
   1.664 -    "Created: / 01-12-2008 / 19:59:02 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.665 -!
   1.666 -
   1.667 -testSendSuper
   1.668 -    |iRMethod aCompiledMethod|
   1.669 -
   1.670 -    iRMethod := (IRBuilder new)
   1.671 -                numRargs:1;
   1.672 -                addTemps:#( #self );
   1.673 -                pushReceiver;
   1.674 -                send:#halt toSuperOf:IRBuilderTest;
   1.675 -                returnTop;
   1.676 -                ir.
   1.677 -    aCompiledMethod := iRMethod compiledCode.
   1.678 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.679 -    self 
   1.680 -        should:[
   1.681 -            (aCompiledMethod valueWithReceiver:(IRBuilderTest new) arguments:#())
   1.682 -        ]
   1.683 -        raise:Error.
   1.684 -
   1.685 -    "Modified: / 11-06-2008 / 16:09:12 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.686 -!
   1.687 -
   1.688 -testStorIntoVariable
   1.689 -    |iRMethod aCompiledMethod|
   1.690 -
   1.691 -    iRMethod := (IRBuilder new)
   1.692 -                numRargs:1;
   1.693 -                addTemps:#( #self );
   1.694 -                pushLiteral:4;
   1.695 -                storeIntoLiteralVariable:(IRBuilderTest bindingOf:#TestToPush);
   1.696 -                returnTop;
   1.697 -                ir.
   1.698 -    aCompiledMethod := iRMethod compiledCode.
   1.699 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.700 -    aCompiledMethod valueWithReceiver:nil arguments:#().
   1.701 -    self assert:(IRBuilderTest testToPush = 4).
   1.702 -    IRBuilderTest testToPush:nil.
   1.703 -!
   1.704 -
   1.705 -testStoreTemp
   1.706 -    |iRMethod aCompiledMethod|
   1.707 -
   1.708 -    iRMethod := (IRBuilder new)
   1.709 -                numRargs:1;
   1.710 -                addTemps:#( #self #a );
   1.711 -                pushLiteral:34;
   1.712 -                storeTemp:#a;
   1.713 -                pushTemp:#a;
   1.714 -                returnTop;
   1.715 -                ir.
   1.716 -    aCompiledMethod := iRMethod compiledCode.
   1.717 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.718 -    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = 34).
   1.719 -
   1.720 -    "Modified: / 11-06-2008 / 16:24:43 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.721 -!
   1.722 -
   1.723 -testStoreThisEnv
   1.724 -    |iRMethod aCompiledMethod|
   1.725 -
   1.726 -    ^ self.
   1.727 -    iRMethod := (IRBuilder new)
   1.728 -                numRargs:1;
   1.729 -                addTemps:#( #self #a );
   1.730 -                pushLiteral:ClosureEnvironment;
   1.731 -                pushLiteral:1;
   1.732 -                send:#new:;
   1.733 -                storeThisEnv;
   1.734 -                pushThisContext;
   1.735 -                pushLiteral:5;
   1.736 -                send:#privGetInstVar:;
   1.737 -                returnTop;
   1.738 -                ir.
   1.739 -    aCompiledMethod := iRMethod compiledCode.
   1.740 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.741 -    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) 
   1.742 -                isKindOf:ClosureEnvironment).
   1.743 -
   1.744 -    "Modified: / 11-06-2008 / 14:47:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.745 -!
   1.746 -
   1.747 -testTwoJumpAheadToIfsToSameTarget
   1.748 -    |iRMethod aCompiledMethod|
   1.749 -
   1.750 -    iRMethod := (IRBuilder new)
   1.751 -                numRargs:1;
   1.752 -                addTemps:#( #self );
   1.753 -                pushTemp:#self;
   1.754 -                pushLiteral:false;
   1.755 -                jumpAheadTo:#end if:true;
   1.756 -                pushLiteral:true;
   1.757 -                jumpAheadTo:#end if:true;
   1.758 -                pushLiteral:3;
   1.759 -                jumpAheadTarget:#end;
   1.760 -                returnTop;
   1.761 -                ir.
   1.762 -    aCompiledMethod := iRMethod compiledCode.
   1.763 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.764 -    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = nil).
   1.765 -
   1.766 -    "Created: / 03-11-2008 / 13:34:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.767 -! !
   1.768 -
   1.769 -!IRBuilderTest methodsFor:'testing - blocks'!
   1.770 -
   1.771 -testBlock_blockNesting_1
   1.772 -    |aCompiledMethod irBuilder|
   1.773 -
   1.774 -    irBuilder := (IRBuilder new)
   1.775 -                numRargs:1;
   1.776 -                addTemps:#( #self );
   1.777 -                pushBlockUsingBuilder:[:builder | 
   1.778 -                        builder
   1.779 -                            numRargs:1;
   1.780 -                            addTemps:#( #barg1 );
   1.781 -                            pushBlockUsingBuilder:[:builder|
   1.782 -                                builder
   1.783 -                                    numRargs: 1;
   1.784 -                                    addTemps: #( #barg2 );
   1.785 -                                    pushTemp: #barg2;
   1.786 -                                    returnTop
   1.787 -                            ];
   1.788 -                            pushTemp: #barg1;
   1.789 -                            send: #value:;
   1.790 -                            returnTop
   1.791 -                    ];
   1.792 -                pushLiteral: 22;
   1.793 -                send:#value;
   1.794 -                returnTop;
   1.795 -                ir.
   1.796 -    "
   1.797 -        irBuilder ir
   1.798 -    "
   1.799 -
   1.800 -    aCompiledMethod := irBuilder compiledCode.
   1.801 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.802 -    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = 22).
   1.803 -
   1.804 -    "Created: / 11-05-2009 / 23:04:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.805 -!
   1.806 -
   1.807 -testBlock_blockTempArg
   1.808 -    |aCompiledMethod irBuilder|
   1.809 -
   1.810 -    irBuilder := (IRBuilder new)
   1.811 -                numRargs:1;
   1.812 -                addTemps:#( #self );
   1.813 -                pushBlockUsingBuilder:[:builder | 
   1.814 -                        builder
   1.815 -                            numRargs:1;
   1.816 -                            addTemps:#( #barg1 );
   1.817 -                            pushTemp:#barg1;
   1.818 -                            returnTop
   1.819 -                    ];
   1.820 -                pushLiteral:22;
   1.821 -                send:#value:;
   1.822 -                returnTop;
   1.823 -                ir.
   1.824 -    "
   1.825 -        irBuilder ir
   1.826 -    "
   1.827 -
   1.828 -    aCompiledMethod := irBuilder compiledCode.
   1.829 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.830 -    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = 22).
   1.831 -
   1.832 -    "Created: / 30-03-2009 / 14:26:18 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.833 -    "Modified: / 30-03-2009 / 19:16:25 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.834 -!
   1.835 -
   1.836 -testBlock_blockTempVar
   1.837 -    |aCompiledMethod irBuilder|
   1.838 -
   1.839 -    irBuilder := (IRBuilder new)
   1.840 -                numRargs:1;
   1.841 -                addTemps:#( #self );
   1.842 -                pushBlockUsingBuilder:[:builder | 
   1.843 -                        builder
   1.844 -                            numRargs:0;
   1.845 -                            addTemps:#( #bvar1 );
   1.846 -                            pushLiteral: 22;
   1.847 -                            storeTemp:#bvar1;
   1.848 -                            pushTemp: #bvar1;
   1.849 -                            returnTop
   1.850 -                    ];
   1.851 -                send:#value;
   1.852 -                returnTop;
   1.853 -                ir.
   1.854 -    "
   1.855 -        irBuilder ir
   1.856 -    "
   1.857 -
   1.858 -    aCompiledMethod := irBuilder compiledCode.
   1.859 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.860 -    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = 22).
   1.861 -
   1.862 -    "Created: / 30-03-2009 / 23:03:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.863 -!
   1.864 -
   1.865 -testBlock_block_in_another_basic_block
   1.866 -    |aCompiledMethod irBuilder|
   1.867 -
   1.868 -    irBuilder := (IRBuilder new)
   1.869 -                numRargs:1;
   1.870 -                addTemps:#( #self );
   1.871 -                pushLiteral: false;
   1.872 -                pushLiteral: true;
   1.873 -                jumpAheadTo: #end if: false;
   1.874 -                pushBlockUsingBuilder:[:builder | 
   1.875 -                        builder
   1.876 -                            numRargs: 0;
   1.877 -                            pushLiteral: true;
   1.878 -                            returnTop
   1.879 -                    ];
   1.880 -                send: #value;
   1.881 -                jumpAheadTarget: #end;
   1.882 -                returnTop;
   1.883 -                ir.
   1.884 -    "
   1.885 -        irBuilder ir
   1.886 -    "
   1.887 -
   1.888 -    aCompiledMethod := irBuilder compiledCode.
   1.889 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.890 -    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = true).
   1.891 -
   1.892 -    "Created: / 13-05-2009 / 11:24:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.893 -!
   1.894 -
   1.895 -testBlock_exceptionHandler
   1.896 -    |aCompiledMethod irBuilder|
   1.897 -
   1.898 -    irBuilder := (IRBuilder new)
   1.899 -                numRargs:1;
   1.900 -                addTemps:#( #self);
   1.901 -               pushBlockUsingBuilder:[:builder | 
   1.902 -                        builder
   1.903 -                            numRargs:0;  
   1.904 -                            pushLiteral: 1;
   1.905 -                            pushLiteral: 0;
   1.906 -                            send: #/;
   1.907 -                            pushLiteral: false;
   1.908 -                            remoteReturn
   1.909 -                    ];
   1.910 -                pushLiteralVariable: #Error;
   1.911 -                pushBlockUsingBuilder:[:builder|
   1.912 -                    builder
   1.913 -                        numRargs:0;
   1.914 -                        pushLiteral: true;
   1.915 -                        remoteReturn];
   1.916 -                send: #on:do:;
   1.917 -                pushLiteral: false;
   1.918 -                returnTop;
   1.919 -                ir.
   1.920 -    "
   1.921 -        irBuilder ir
   1.922 -    "
   1.923 -
   1.924 -    aCompiledMethod := irBuilder compiledCode.
   1.925 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.926 -    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = true).
   1.927 -
   1.928 -    "Created: / 11-05-2009 / 21:53:19 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.929 -!
   1.930 -
   1.931 -testBlock_exceptionHandler_noRemoteReturn
   1.932 -    |aCompiledMethod irBuilder|
   1.933 -
   1.934 -    irBuilder := (IRBuilder new)
   1.935 -                numRargs:1;
   1.936 -                addTemps:#( #self);
   1.937 -               pushBlockUsingBuilder:[:builder | 
   1.938 -                        builder
   1.939 -                            numRargs:0;  
   1.940 -                            pushLiteral: 1;
   1.941 -                            pushLiteral: 0;
   1.942 -                            send: #/;
   1.943 -                            pushLiteral: false;
   1.944 -                            returnTop
   1.945 -                    ];
   1.946 -                pushLiteralVariable: #Error;
   1.947 -                pushBlockUsingBuilder:[:builder|
   1.948 -                    builder
   1.949 -                        numRargs:0;
   1.950 -                        pushLiteral: true;
   1.951 -                        returnTop];
   1.952 -                send: #on:do:;
   1.953 -                returnTop;
   1.954 -                ir.
   1.955 -    "
   1.956 -        irBuilder ir
   1.957 -    "
   1.958 -
   1.959 -    aCompiledMethod := irBuilder compiledCode.
   1.960 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.961 -    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = true).
   1.962 -
   1.963 -    "Created: / 11-05-2009 / 21:53:25 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.964 -!
   1.965 -
   1.966 -testBlock_invalid_instruction_ordering_bug_1
   1.967 -    |aCompiledMethod irBuilder|
   1.968 -
   1.969 -    irBuilder := (IRBuilder new)
   1.970 -                    numRargs: 1;
   1.971 -                    addTemps: #(self i);
   1.972 -                    pushTemp: #i;
   1.973 -                    pushLiteral: 3;
   1.974 -                    pushReceiver;
   1.975 -
   1.976 -                    pushBlockUsingBuilder: [ :builder | 
   1.977 -                        builder
   1.978 -                            numRargs: 0;
   1.979 -                            addTemps: #();
   1.980 -                            pushTemp: #i;
   1.981 -                            returnTop.
   1.982 -                    ];
   1.983 -                    returnTop;
   1.984 -                    ir.
   1.985 -    "
   1.986 -        irBuilder ir
   1.987 -    "
   1.988 -
   1.989 -    aCompiledMethod := irBuilder compiledCode.
   1.990 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   1.991 -    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) isKindOf: Block).
   1.992 -
   1.993 -    "Created: / 11-05-2009 / 21:55:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
   1.994 -!
   1.995 -
   1.996 -testBlock_methodTempVar
   1.997 -    |aCompiledMethod irBuilder|
   1.998 -
   1.999 -    irBuilder := (IRBuilder new)
  1.1000 -                numRargs:1;
  1.1001 -                addTemps:#( #self #a);
  1.1002 -                pushLiteral: 22;
  1.1003 -                storeTemp: #a;
  1.1004 -                pushBlockUsingBuilder:[:builder | 
  1.1005 -                        builder
  1.1006 -                            numRargs:0;
  1.1007 -                            pushTemp: #a;
  1.1008 -                            returnTop
  1.1009 -                    ];
  1.1010 -                send:#value;
  1.1011 -                returnTop;
  1.1012 -                ir.
  1.1013 -    "
  1.1014 -        irBuilder ir
  1.1015 -    "
  1.1016 -
  1.1017 -    aCompiledMethod := irBuilder compiledCode.
  1.1018 -    self assert:(aCompiledMethod isKindOf:CompiledMethod).
  1.1019 -    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = 22).
  1.1020 -
  1.1021 -    "Created: / 30-03-2009 / 23:05:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1.1022 -    "Modified: / 01-04-2009 / 19:43:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
  1.1023 -! !
  1.1024 -
  1.1025 -!IRBuilderTest class methodsFor:'documentation'!
  1.1026 -
  1.1027 -version_CVS
  1.1028 -    ^ 'Header: /cvs/stx/cvut/stx/goodies/newcompiler/IRBuilderTest.st,v 1.3 2009/10/08 12:03:51 fm Exp '
  1.1029 -!
  1.1030 -
  1.1031 -version_SVN
  1.1032 -    ^ '$Id::                                                                                                                        $'
  1.1033 -! !
  1.1034 -
     2.1 --- a/IRTransformTest.st	Thu Oct 30 22:23:12 2014 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,172 +0,0 @@
     2.4 -"{ Package: 'ctu:ircompiler' }"
     2.5 -
     2.6 -TestCase subclass:#IRTransformTest
     2.7 -	instanceVariableNames:''
     2.8 -	classVariableNames:''
     2.9 -	poolDictionaries:''
    2.10 -	category:'IR Compiler-Tests'
    2.11 -!
    2.12 -
    2.13 -
    2.14 -!IRTransformTest methodsFor:'testing'!
    2.15 -
    2.16 -testAdd
    2.17 -    |iRMethod aCompiledMethod|
    2.18 -
    2.19 -    iRMethod := (IRBuilder new)
    2.20 -                numRargs:1;
    2.21 -                addTemps:#( #self );
    2.22 -                pushLiteral:1;
    2.23 -                returnTop;
    2.24 -                ir.
    2.25 -    (iRMethod allSequences last) last delete.
    2.26 -    (iRMethod allSequences last) last delete.
    2.27 -    (iRMethod allSequences last) add:(IRInstruction pushLiteral:2).
    2.28 -    (iRMethod allSequences last) add:(IRInstruction returnTop).
    2.29 -    aCompiledMethod := iRMethod compiledCode.
    2.30 -    self should:[ (aCompiledMethod valueWithReceiver:nil arguments:#()) = 2 ].
    2.31 -!
    2.32 -
    2.33 -testAddBefore
    2.34 -    |iRMethod aCompiledMethod ret|
    2.35 -
    2.36 -    iRMethod := (IRBuilder new)
    2.37 -                numRargs:1;
    2.38 -                addTemps:#( #self );
    2.39 -                pushLiteral:1;
    2.40 -                returnTop;
    2.41 -                ir.
    2.42 -    (iRMethod allSequences last) last delete.
    2.43 -    (iRMethod allSequences last) last delete.
    2.44 -    ret := (IRInstruction returnTop).
    2.45 -    (iRMethod allSequences last) add:ret.
    2.46 -    (iRMethod allSequences last) add:(IRInstruction pushLiteral:2) before:ret.
    2.47 -    aCompiledMethod := iRMethod compiledCode.
    2.48 -    self should:[ (aCompiledMethod valueWithReceiver:nil arguments:#()) = 2 ].
    2.49 -!
    2.50 -
    2.51 -testAddIntructions
    2.52 -        
    2.53 -        | iRMethod aCompiledMethod |
    2.54 -
    2.55 -        iRMethod := IRBuilder new
    2.56 -                numRargs: 1;
    2.57 -                addTemps: #(self);              "receiver and args declarations"
    2.58 -                pushLiteral: 1;                                 
    2.59 -                returnTop;
    2.60 -                ir.
    2.61 -
    2.62 -        (iRMethod allSequences last) last delete.
    2.63 -        (iRMethod allSequences last) last delete.
    2.64 -
    2.65 -        (iRMethod allSequences last)
    2.66 -                        addInstructions: {(IRInstruction pushLiteral: 2). (IRInstruction returnTop)}.
    2.67 -
    2.68 -        aCompiledMethod := iRMethod compiledCode.
    2.69 -        self should: [(aCompiledMethod valueWithReceiver: nil arguments: #() ) = 2].
    2.70 -
    2.71 -    "Modified: / 30-03-2009 / 19:40:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
    2.72 -!
    2.73 -
    2.74 -testAddIntructionsBefore
    2.75 -        
    2.76 -        | iRMethod aCompiledMethod push |
    2.77 -
    2.78 -        iRMethod := IRBuilder new
    2.79 -                numRargs: 1;
    2.80 -                addTemps: #(self);              "receiver and args declarations"
    2.81 -                pushLiteral: 1;                                 
    2.82 -                returnTop;
    2.83 -                ir.
    2.84 -
    2.85 -        push := (iRMethod allSequences last) at: (iRMethod allSequences size - 1) .
    2.86 -
    2.87 -        (iRMethod allSequences last)
    2.88 -                        addInstructions: {(IRInstruction pushLiteral: 2). (IRInstruction returnTop)} before: push.
    2.89 -
    2.90 -        aCompiledMethod := iRMethod compiledCode.
    2.91 -        self should: [(aCompiledMethod valueWithReceiver: nil arguments: #() ) = 2].
    2.92 -
    2.93 -    "Modified: / 30-03-2009 / 19:40:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
    2.94 -!
    2.95 -
    2.96 -testAddIntructionsBeforeFromLList
    2.97 -    |iRMethod aCompiledMethod push llist col|
    2.98 -
    2.99 -    iRMethod := (IRBuilder new)
   2.100 -                numRargs:1;
   2.101 -                addTemps:#( #self );
   2.102 -                pushLiteral:1;
   2.103 -                returnTop;
   2.104 -                ir.
   2.105 -    push := (iRMethod allSequences last) at:(iRMethod allSequences size - 1).
   2.106 -    llist := LinkedList new.
   2.107 -    llist add:(IRInstruction pushLiteral:2).
   2.108 -    llist add:(IRInstruction returnTop).
   2.109 -    col := llist asOrderedCollection.
   2.110 -    (iRMethod allSequences last) addInstructions:col before:push.
   2.111 -    aCompiledMethod := iRMethod compiledCode.
   2.112 -    self should:[ (aCompiledMethod valueWithReceiver:nil arguments:#()) = 2 ].
   2.113 -!
   2.114 -
   2.115 -testDelete
   2.116 -    |iRMethod aCompiledMethod|
   2.117 -
   2.118 -    iRMethod := (IRBuilder new)
   2.119 -                numRargs:1;
   2.120 -                addTemps:#( #self );
   2.121 -                pushLiteral:1;
   2.122 -                pushLiteral:2;
   2.123 -                returnTop;
   2.124 -                ir.
   2.125 -    ((iRMethod allSequences last) 
   2.126 -        detect:[:each | each isConstant:[:c | c == 2 ] ]) delete.
   2.127 -    aCompiledMethod := iRMethod compiledCode.
   2.128 -    self should:[ (aCompiledMethod valueWithReceiver:nil arguments:#()) = 1 ].
   2.129 -!
   2.130 -
   2.131 -testReplace
   2.132 -    |iRMethod aCompiledMethod|
   2.133 -
   2.134 -    iRMethod := (IRBuilder new)
   2.135 -                numRargs:1;
   2.136 -                addTemps:#( #self );
   2.137 -                pushLiteral:1;
   2.138 -                returnTop;
   2.139 -                ir.
   2.140 -    (iRMethod allSequences last at:1) 
   2.141 -        replaceWith:(IRInstruction pushLiteral:2).
   2.142 -    aCompiledMethod := iRMethod compiledCode.
   2.143 -    self should:[ (aCompiledMethod valueWithReceiver:nil arguments:#()) = 2 ].
   2.144 -!
   2.145 -
   2.146 -testReplaceInstr
   2.147 -        
   2.148 -        | iRMethod aCompiledMethod |
   2.149 -
   2.150 -        iRMethod := IRBuilder new
   2.151 -                numRargs: 1;
   2.152 -                addTemps: #(self);              "receiver and args declarations"
   2.153 -                pushLiteral: 1;                                 
   2.154 -                returnTop;
   2.155 -                ir.
   2.156 -        
   2.157 -        (iRMethod allSequences last at: 1) 
   2.158 -                        replaceWithInstructions: {(IRInstruction pushLiteral: 2)}.
   2.159 -
   2.160 -        aCompiledMethod := iRMethod compiledCode.
   2.161 -        self should: [(aCompiledMethod valueWithReceiver: nil arguments: #() ) = 2].
   2.162 -
   2.163 -    "Modified: / 30-03-2009 / 19:40:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
   2.164 -! !
   2.165 -
   2.166 -!IRTransformTest class methodsFor:'documentation'!
   2.167 -
   2.168 -version_CVS
   2.169 -    ^ 'Header: /cvs/stx/cvut/stx/goodies/newcompiler/IRTransformTest.st,v 1.3 2009/10/08 11:56:52 fm Exp '
   2.170 -!
   2.171 -
   2.172 -version_SVN
   2.173 -    ^ '$Id::                                                                                                                        $'
   2.174 -! !
   2.175 -
     3.1 --- a/Make.proto	Thu Oct 30 22:23:12 2014 +0000
     3.2 +++ b/Make.proto	Thu Oct 30 22:27:09 2014 +0000
     3.3 @@ -34,7 +34,7 @@
     3.4  # add the path(es) here:,
     3.5  # ********** OPTIONAL: MODIFY the next lines ***
     3.6  # LOCALINCLUDES=-Ifoo -Ibar
     3.7 -LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libcomp -I$(INCLUDE_TOP)/stx/libcompat -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libwidg
     3.8 +LOCALINCLUDES= -I$(INCLUDE_TOP)/stx/goodies/refactoryBrowser/parser -I$(INCLUDE_TOP)/stx/libbasic -I$(INCLUDE_TOP)/stx/libcomp -I$(INCLUDE_TOP)/stx/libcompat -I$(INCLUDE_TOP)/stx/libtool -I$(INCLUDE_TOP)/stx/libwidg
     3.9  
    3.10  
    3.11  # if you need any additional defines for embedded C code,
    3.12 @@ -124,12 +124,7 @@
    3.13  # build all mandatory prerequisite packages (containing superclasses) for this package
    3.14  prereq:
    3.15  	cd $(TOP)/libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
    3.16 -	cd $(TOP)/libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
    3.17 -	cd $(TOP)/libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
    3.18  	cd $(TOP)/libcomp && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
    3.19 -	cd $(TOP)/libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
    3.20 -	cd $(TOP)/libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
    3.21 -	cd $(TOP)/goodies/sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
    3.22  
    3.23  
    3.24  
     4.1 --- a/abbrev.stc	Thu Oct 30 22:23:12 2014 +0000
     4.2 +++ b/abbrev.stc	Thu Oct 30 22:27:09 2014 +0000
     4.3 @@ -2,14 +2,12 @@
     4.4  # this file is needed for stc to be able to compile modules independently.
     4.5  # it provides information about a classes filename, category and especially namespace.
     4.6  IRBuilder IRBuilder ctu:ircompiler 'IR Compiler-IR' 0
     4.7 -IRBuilderTest IRBuilderTest ctu:ircompiler 'IR Compiler-Tests' 1
     4.8  IRBytecodeGenerator IRBytecodeGenerator ctu:ircompiler 'IR Compiler-Bytecode' 0
     4.9  IRFunction IRFunction ctu:ircompiler 'IR Compiler-IR' 0
    4.10  IRInstruction IRInstruction ctu:ircompiler 'IR Compiler-IR' 0
    4.11  IRInterpreter IRInterpreter ctu:ircompiler 'IR Compiler-IR' 0
    4.12  IRSequence IRSequence ctu:ircompiler 'IR Compiler-IR' 0
    4.13  IRStackCount IRStackCount ctu:ircompiler 'IR Compiler-Bytecode' 0
    4.14 -IRTransformTest IRTransformTest ctu:ircompiler 'IR Compiler-Tests' 1
    4.15  ctu_ircompiler ctu_ircompiler ctu:ircompiler '* Projects & Packages *' 3
    4.16  IRAccess IRAccess ctu:ircompiler 'IR Compiler-IR' 0
    4.17  IRClosure IRClosure ctu:ircompiler 'IR Compiler-IR' 0
     5.1 --- a/bc.mak	Thu Oct 30 22:23:12 2014 +0000
     5.2 +++ b/bc.mak	Thu Oct 30 22:27:09 2014 +0000
     5.3 @@ -34,7 +34,7 @@
     5.4  
     5.5  
     5.6  
     5.7 -LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libcomp -I$(INCLUDE_TOP)\stx\libcompat -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\libwidg
     5.8 +LOCALINCLUDES= -I$(INCLUDE_TOP)\stx\goodies\refactoryBrowser\parser -I$(INCLUDE_TOP)\stx\libbasic -I$(INCLUDE_TOP)\stx\libcomp -I$(INCLUDE_TOP)\stx\libcompat -I$(INCLUDE_TOP)\stx\libtool -I$(INCLUDE_TOP)\stx\libwidg
     5.9  LOCALDEFINES=
    5.10  
    5.11  STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
    5.12 @@ -51,12 +51,7 @@
    5.13  # build all mandatory prerequisite packages (containing superclasses) for this package
    5.14  prereq:
    5.15  	pushd ..\..\stx\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
    5.16 -	pushd ..\..\stx\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
    5.17 -	pushd ..\..\stx\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
    5.18  	pushd ..\..\stx\libcomp & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
    5.19 -	pushd ..\..\stx\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
    5.20 -	pushd ..\..\stx\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
    5.21 -	pushd ..\..\stx\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
    5.22  
    5.23  
    5.24  
     6.1 --- a/ctu_ircompiler.st	Thu Oct 30 22:23:12 2014 +0000
     6.2 +++ b/ctu_ircompiler.st	Thu Oct 30 22:27:09 2014 +0000
     6.3 @@ -33,7 +33,6 @@
     6.4       by searching along the inheritance chain of all of my classes."
     6.5  
     6.6      ^ #(
     6.7 -        #'stx:goodies/sunit'    "TestAsserter - superclass of IRBuilderTest"
     6.8          #'stx:libbasic'    "Behavior - extended"
     6.9          #'stx:libcomp'    "ByteCodeCompiler - extended"
    6.10      )
    6.11 @@ -75,14 +74,12 @@
    6.12      ^ #(
    6.13          "<className> or (<className> attributes...) in load order"
    6.14          IRBuilder
    6.15 -        (IRBuilderTest autoload)
    6.16          IRBytecodeGenerator
    6.17          IRFunction
    6.18          IRInstruction
    6.19          IRInterpreter
    6.20          IRSequence
    6.21          IRStackCount
    6.22 -        (IRTransformTest autoload)
    6.23          #'ctu_ircompiler'
    6.24          IRAccess
    6.25          IRClosure
     7.1 --- a/ircompiler.rc	Thu Oct 30 22:23:12 2014 +0000
     7.2 +++ b/ircompiler.rc	Thu Oct 30 22:27:09 2014 +0000
     7.3 @@ -25,7 +25,7 @@
     7.4        VALUE "LegalCopyright", "Copyright Jan Vrany & Mathieu Suen 2008\0"
     7.5        VALUE "ProductName", "NewCompiler\0"
     7.6        VALUE "ProductVersion", "6.2.4.0\0"
     7.7 -      VALUE "ProductDate", "Thu, 30 Oct 2014 22:22:54 GMT\0"
     7.8 +      VALUE "ProductDate", "Thu, 30 Oct 2014 22:24:49 GMT\0"
     7.9      END
    7.10  
    7.11    END
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/tests/IRBuilderTest.st	Thu Oct 30 22:27:09 2014 +0000
     8.3 @@ -0,0 +1,1031 @@
     8.4 +"{ Package: 'ctu:ircompiler/tests' }"
     8.5 +
     8.6 +TestCase subclass:#IRBuilderTest
     8.7 +	instanceVariableNames:''
     8.8 +	classVariableNames:'TestToPush'
     8.9 +	poolDictionaries:''
    8.10 +	category:'IR Compiler-Tests'
    8.11 +!
    8.12 +
    8.13 +
    8.14 +!IRBuilderTest class methodsFor:'as yet unclassified'!
    8.15 +
    8.16 +testToPush
    8.17 +	^TestToPush
    8.18 +!
    8.19 +
    8.20 +testToPush: anObject
    8.21 +
    8.22 +	TestToPush := anObject
    8.23 +! !
    8.24 +
    8.25 +!IRBuilderTest methodsFor:'mock methods'!
    8.26 +
    8.27 +mock1: arg1 with: arg2
    8.28 +
    8.29 +    ^arg1 + arg2
    8.30 +
    8.31 +    "Created: / 02-12-2008 / 09:11:46 / Jan Vrany <vranyj1@fel.cvut.cz>"
    8.32 +!
    8.33 +
    8.34 +mock2
    8.35 +
    8.36 +    ^[ testSelector ]
    8.37 +
    8.38 +    "
    8.39 +    decompiling IRBuilderTest>>mock2
    8.40 +    nA: 0 nV: 0 nT: 2   
    8.41 +    
    8.42 +    1: 37 04 00 00             makeBlock 4 (7) nv=0 na=0
    8.43 +    5: 5A                      pushInstVar1
    8.44 +    6: 00                      retTop
    8.45 +    7: 08 03                   LINE[3]
    8.46 +    9: 00                      retTop
    8.47 +    "
    8.48 +
    8.49 +    "Created: / 28-03-2009 / 18:47:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
    8.50 +    "Modified: / 28-03-2009 / 20:16:08 / Jan Vrany <vranyj1@fel.cvut.cz>"
    8.51 +!
    8.52 +
    8.53 +mock3
    8.54 +    | b |
    8.55 +    b := 1.
    8.56 +    ^[ b ]
    8.57 +
    8.58 +    "
    8.59 +    decompiling IRBuilderTest>>mock3
    8.60 +    nA: 0 nV: 1 nT: 2
    8.61 +
    8.62 +    1: 79                      push1
    8.63 +    2: 64                      storeMethodVar1
    8.64 +    3: 37 04 00 00             makeBlock 4 (9) nv=0 na=0
    8.65 +    7: 50                      pushMethodVar1
    8.66 +    8: 00                      retTop
    8.67 +    9: 08 04                   LINE[4]
    8.68 +    11:00                      retTop
    8.69 +    "
    8.70 +
    8.71 +    "Created: / 28-03-2009 / 20:16:36 / Jan Vrany <vranyj1@fel.cvut.cz>"
    8.72 +!
    8.73 +
    8.74 +mock4
    8.75 +
    8.76 +    ^[:arg| arg ]
    8.77 +
    8.78 +    "
    8.79 +    decompiling IRBuilderTest>>mock4
    8.80 +    nA: 0 nV: 0 nT: 2
    8.81 +
    8.82 +    1: 37 04 00 01             makeBlock 4 (7) nv=0 na=1
    8.83 +    5: 8C                      pushBlockArg1
    8.84 +    6: 00                      retTop
    8.85 +    7: 08 03                   LINE[3]
    8.86 +    9: 00                      retTop
    8.87 +
    8.88 +
    8.89 +
    8.90 +    "
    8.91 +
    8.92 +    "Created: / 28-03-2009 / 20:18:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
    8.93 +!
    8.94 +
    8.95 +mock5
    8.96 +
    8.97 +    ^[|temp| temp ]
    8.98 +
    8.99 +    "
   8.100 +    decompiling IRBuilderTest>>mock5
   8.101 +    nA: 0 nV: 0 nT: 2
   8.102 +    
   8.103 +    1: 37 04 01 00             makeBlock 4 (7) nv=1 na=0
   8.104 +    5: E8                      pushBlockVar1
   8.105 +    6: 00                      retTop
   8.106 +    7: 08 03                   LINE[3]
   8.107 +    9: 00                      retTop
   8.108 +    "
   8.109 +
   8.110 +    "Created: / 28-03-2009 / 20:19:17 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.111 +!
   8.112 +
   8.113 +mock6
   8.114 +
   8.115 +    ^[|temp| [ temp ] ]
   8.116 +
   8.117 +    "
   8.118 +    decompiling IRBuilderTest>>mock6
   8.119 +    nA: 0 nV: 0 nT: 3
   8.120 +
   8.121 +    1: 37 0B 01 00             makeBlock 11 (14) nv=1 na=0
   8.122 +    5: 37 06 00 00             makeBlock 6 (13) nv=0 na=0
   8.123 +    9: 80 01 01                pushOuterBlockVar 1 lvl: 1
   8.124 +    12:00                      retTop
   8.125 +    13:00                      retTop
   8.126 +    14:08 03                   LINE[3]
   8.127 +    16:00                      retTop
   8.128 +
   8.129 +    "
   8.130 +
   8.131 +    "Created: / 28-03-2009 / 20:20:06 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.132 +!
   8.133 +
   8.134 +mock7
   8.135 +    | b |
   8.136 +    b := 1.
   8.137 +    ^[ ^b ]
   8.138 +
   8.139 +    "
   8.140 +    decompiling IRBuilderTest>>mock7
   8.141 +    nA: 0 nV: 1 nT: 2
   8.142 +
   8.143 +    1: 79                      push1
   8.144 +    2: 64                      storeMethodVar1
   8.145 +    3: 37 06 00 00             makeBlock 6 (11) nv=0 na=0
   8.146 +    7: 50                      pushMethodVar1
   8.147 +    8: 08 04                   LINE[4]
   8.148 +    10:07                      homeRetTop
   8.149 +    11:08 04                   LINE[4]
   8.150 +    13:00                      retTop
   8.151 +
   8.152 +    "
   8.153 +
   8.154 +    "Created: / 28-03-2009 / 20:21:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.155 +!
   8.156 +
   8.157 +mock8
   8.158 +
   8.159 +    ^([:arg| arg ] value: 22)
   8.160 +
   8.161 +    "Created: / 30-03-2009 / 19:21:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.162 +!
   8.163 +
   8.164 +mock9
   8.165 +
   8.166 +    ^[:barg1 | [:barg2 | barg2 ] value: barg1 ]
   8.167 +        value: 22
   8.168 +
   8.169 +    "
   8.170 +    decompiling IRBuilderTest>>mock9
   8.171 +    nA: 0 nV: 0 nT: 3
   8.172 +    
   8.173 +     1: 37 0C 00 01             makeBlock 12 (15) nv=0 na=1
   8.174 +     5: 37 04 00 01             makeBlock 4 (11) nv=0 na=1
   8.175 +     9: 8C                      pushBlockArg1
   8.176 +    10: 00                      retTop
   8.177 +    11: 8C                      pushBlockArg1
   8.178 +    12: 98 03                   send1 #value:[3]
   8.179 +    14: 00                      retTop
   8.180 +    15: 10 16                   pushNum 22
   8.181 +    17: 98 04                   send1 #value:[4]
   8.182 +    19: 08 03                   LINE[3]
   8.183 +    21: 00 
   8.184 +    
   8.185 +    "
   8.186 +
   8.187 +    "Created: / 11-05-2009 / 23:09:57 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.188 +! !
   8.189 +
   8.190 +!IRBuilderTest methodsFor:'testing'!
   8.191 +
   8.192 +halt
   8.193 +        "Redefinition for testing the #send:toSuperOf:"
   8.194 +
   8.195 +    "Created: / 11-06-2008 / 16:08:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.196 +!
   8.197 +
   8.198 +isThisEverCalled
   8.199 +	"Redefinition for testing the #send:toSuperOf:"
   8.200 +!
   8.201 +
   8.202 +testDup
   8.203 +    |iRMethod aCompiledMethod|
   8.204 +
   8.205 +    iRMethod := (IRBuilder new)
   8.206 +                numRargs:1;
   8.207 +                addTemps:#( #self );
   8.208 +                pushLiteral:3;
   8.209 +                pushDup;
   8.210 +                send:#'=';
   8.211 +                returnTop;
   8.212 +                ir.
   8.213 +    aCompiledMethod := iRMethod compiledCode.
   8.214 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.215 +    self 
   8.216 +        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = true).
   8.217 +!
   8.218 +
   8.219 +testInstVar
   8.220 +    |aCompiledMethod irBuilder|
   8.221 +
   8.222 +    irBuilder := (IRBuilder new)
   8.223 +                numRargs:1;
   8.224 +                addTemps:#( #self );
   8.225 +                pushInstVar:1;
   8.226 +                pushInstVar:2;
   8.227 +                send:#'+';
   8.228 +                returnTop;
   8.229 +                ir.
   8.230 +    aCompiledMethod := irBuilder compiledCode.
   8.231 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.232 +    self 
   8.233 +        assert:((aCompiledMethod valueWithReceiver:(3 @ 4) arguments:#()) = 7).
   8.234 +
   8.235 +    "Modified: / 11-06-2008 / 13:16:41 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.236 +!
   8.237 +
   8.238 +testJumpAheadTo
   8.239 +    |iRMethod aCompiledMethod|
   8.240 +
   8.241 +    iRMethod := (IRBuilder new)
   8.242 +                numRargs:1;
   8.243 +                addTemps:#( #self );
   8.244 +                pushTemp:#self;
   8.245 +                jumpAheadTo:#end;
   8.246 +                pushLiteral:3;
   8.247 +                jumpAheadTarget:#end;
   8.248 +                returnTop;
   8.249 +                ir.
   8.250 +    aCompiledMethod := iRMethod compiledCode.
   8.251 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.252 +    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = nil).
   8.253 +!
   8.254 +
   8.255 +testJumpAheadToIf
   8.256 +    |iRMethod aCompiledMethod|
   8.257 +
   8.258 +    iRMethod := (IRBuilder new)
   8.259 +                numRargs:1;
   8.260 +                addTemps:#( #self );
   8.261 +                pushTemp:#self;
   8.262 +                pushLiteral:true;
   8.263 +                jumpAheadTo:#end if:true;
   8.264 +                pushLiteral:3;
   8.265 +                jumpAheadTarget:#end;
   8.266 +                returnTop;
   8.267 +                ir.
   8.268 +    aCompiledMethod := iRMethod compiledCode.
   8.269 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.270 +    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = nil).
   8.271 +!
   8.272 +
   8.273 +testJumpBackTo
   8.274 +    |iRMethod aCompiledMethod|
   8.275 +
   8.276 +    iRMethod := (IRBuilder new)
   8.277 +                numRargs:1;
   8.278 +                addTemps:#( #self );
   8.279 +                pushTemp:#self;
   8.280 +                pushLiteral:false;
   8.281 +                jumpBackTarget:#begin;
   8.282 +                jumpAheadTo:#end if:true;
   8.283 +                pushLiteral:true;
   8.284 +                jumpBackTo:#begin;
   8.285 +                jumpAheadTarget:#end;
   8.286 +                returnTop;
   8.287 +                ir.
   8.288 +    aCompiledMethod := iRMethod compiledCode.
   8.289 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.290 +    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = nil).
   8.291 +!
   8.292 +
   8.293 +testLine1
   8.294 +    |iRMethod aCompiledMethod|
   8.295 +
   8.296 +    iRMethod := (IRBuilder new)
   8.297 +                numRargs:1;
   8.298 +                addTemps:#( #self );
   8.299 +                line:5;
   8.300 +                pushLiteral:true;
   8.301 +                returnTop;
   8.302 +                ir.
   8.303 +    aCompiledMethod := iRMethod compiledCode.
   8.304 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.305 +    self 
   8.306 +        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = true).
   8.307 +
   8.308 +    "Created: / 02-12-2008 / 09:11:06 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.309 +!
   8.310 +
   8.311 +testLine2
   8.312 +    |iRMethod aCompiledMethod|
   8.313 +
   8.314 +    iRMethod := (IRBuilder new)
   8.315 +                numRargs:1;
   8.316 +                addTemps:#( #self );
   8.317 +                line:5;
   8.318 +                pushLiteral:true;
   8.319 +                pushLiteral:false;
   8.320 +                send:#'&';
   8.321 +                returnTop;
   8.322 +                ir.
   8.323 +    aCompiledMethod := iRMethod compiledCode.
   8.324 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.325 +    self 
   8.326 +        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = false).
   8.327 +
   8.328 +    "Created: / 02-12-2008 / 09:11:42 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.329 +!
   8.330 +
   8.331 +testLiteralArray
   8.332 +    |iRMethod aCompiledMethod|
   8.333 +
   8.334 +    iRMethod := (IRBuilder new)
   8.335 +                numRargs:1;
   8.336 +                addTemps:#( #self );
   8.337 +                pushLiteral:#( #test 4 #you );
   8.338 +                returnTop;
   8.339 +                ir.
   8.340 +    aCompiledMethod := iRMethod compiledCode.
   8.341 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.342 +    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) 
   8.343 +                = #( #test 4 #you )).
   8.344 +!
   8.345 +
   8.346 +testLiteralBoolean
   8.347 +    |iRMethod aCompiledMethod|
   8.348 +
   8.349 +    iRMethod := (IRBuilder new)
   8.350 +                numRargs:1;
   8.351 +                addTemps:#( #self );
   8.352 +                pushLiteral:true;
   8.353 +                returnTop;
   8.354 +                ir.
   8.355 +    aCompiledMethod := iRMethod compiledCode.
   8.356 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.357 +    self 
   8.358 +        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = true).
   8.359 +!
   8.360 +
   8.361 +testLiteralCharacter
   8.362 +    |iRMethod aCompiledMethod|
   8.363 +
   8.364 +    iRMethod := (IRBuilder new)
   8.365 +                numRargs:1;
   8.366 +                addTemps:#( #self );
   8.367 +                pushLiteral:$e;
   8.368 +                returnTop;
   8.369 +                ir.
   8.370 +    aCompiledMethod := iRMethod compiledCode.
   8.371 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.372 +    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = $e).
   8.373 +!
   8.374 +
   8.375 +testLiteralFloat
   8.376 +    |iRMethod aCompiledMethod|
   8.377 +
   8.378 +    iRMethod := (IRBuilder new)
   8.379 +                numRargs:1;
   8.380 +                addTemps:#( #self );
   8.381 +                pushLiteral:2.0;
   8.382 +                returnTop;
   8.383 +                ir.
   8.384 +    aCompiledMethod := iRMethod compiledCode.
   8.385 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.386 +    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = 2.0).
   8.387 +
   8.388 +    "Modified: / 03-11-2008 / 08:39:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.389 +!
   8.390 +
   8.391 +testLiteralInteger
   8.392 +    |iRMethod aCompiledMethod|
   8.393 +
   8.394 +    iRMethod := (IRBuilder new)
   8.395 +                numRargs:1;
   8.396 +                addTemps:#( #self );
   8.397 +                pushLiteral:2;
   8.398 +                returnTop;
   8.399 +                ir.
   8.400 +    aCompiledMethod := iRMethod compiledCode.
   8.401 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.402 +    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = 2).
   8.403 +!
   8.404 +
   8.405 +testLiteralNil
   8.406 +    |iRMethod aCompiledMethod|
   8.407 +
   8.408 +    iRMethod := (IRBuilder new)
   8.409 +                numRargs:1;
   8.410 +                addTemps:#( #self );
   8.411 +                pushLiteral:nil;
   8.412 +                returnTop;
   8.413 +                ir.
   8.414 +    aCompiledMethod := iRMethod compiledCode.
   8.415 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.416 +    self assert:((aCompiledMethod valueWithReceiver:4 arguments:#()) = nil).
   8.417 +!
   8.418 +
   8.419 +testLiteralString
   8.420 +    |iRMethod aCompiledMethod|
   8.421 +
   8.422 +    iRMethod := (IRBuilder new)
   8.423 +                numRargs:1;
   8.424 +                addTemps:#( #self );
   8.425 +                pushLiteral:'hello';
   8.426 +                returnTop;
   8.427 +                ir.
   8.428 +    aCompiledMethod := iRMethod compiledCode.
   8.429 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.430 +    self 
   8.431 +        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = 'hello').
   8.432 +!
   8.433 +
   8.434 +testLiteralSymbole
   8.435 +    |iRMethod aCompiledMethod|
   8.436 +
   8.437 +    iRMethod := (IRBuilder new)
   8.438 +                numRargs:1;
   8.439 +                addTemps:#( #self );
   8.440 +                pushLiteral:#you;
   8.441 +                returnTop;
   8.442 +                ir.
   8.443 +    aCompiledMethod := iRMethod compiledCode.
   8.444 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.445 +    self 
   8.446 +        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = #you).
   8.447 +!
   8.448 +
   8.449 +testLiteralVariableClass
   8.450 +    |iRMethod aCompiledMethod|
   8.451 +
   8.452 +    iRMethod := (IRBuilder new)
   8.453 +                numRargs:1;
   8.454 +                addTemps:#( #self );
   8.455 +                pushLiteralVariable:Object binding;
   8.456 +                returnTop;
   8.457 +                ir.
   8.458 +    aCompiledMethod := iRMethod compiledCode.
   8.459 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.460 +    self 
   8.461 +        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = Object).
   8.462 +!
   8.463 +
   8.464 +testLiteralVariableClassVariable
   8.465 +    |iRMethod aCompiledMethod|
   8.466 +
   8.467 +    iRMethod := (IRBuilder new)
   8.468 +                numRargs:1;
   8.469 +                addTemps:#( #self );
   8.470 +                pushLiteralVariable:(ArithmeticValue bindingOf:#ArithmeticSignal);
   8.471 +                returnTop;
   8.472 +                ir.
   8.473 +    aCompiledMethod := iRMethod compiledCode.
   8.474 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.475 +    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) 
   8.476 +                = ArithmeticValue arithmeticSignal).
   8.477 +
   8.478 +    "Modified: / 11-06-2008 / 11:31:32 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.479 +!
   8.480 +
   8.481 +testLiteralVariableGlobale
   8.482 +    |iRMethod aCompiledMethod|
   8.483 +
   8.484 +    iRMethod := (IRBuilder new)
   8.485 +                numRargs:1;
   8.486 +                addTemps:#( #self );
   8.487 +                pushLiteralVariable:Smalltalk binding;
   8.488 +                returnTop;
   8.489 +                ir.
   8.490 +    aCompiledMethod := iRMethod compiledCode.
   8.491 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.492 +    self 
   8.493 +        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = Smalltalk).
   8.494 +
   8.495 +    "Modified: / 11-06-2008 / 11:32:07 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.496 +!
   8.497 +
   8.498 +testPopTop
   8.499 +    |iRMethod aCompiledMethod|
   8.500 +
   8.501 +    iRMethod := (IRBuilder new)
   8.502 +                numRargs:1;
   8.503 +                addTemps:#( #self );
   8.504 +                pushLiteral:true;
   8.505 +                pushLiteral:false;
   8.506 +                popTop;
   8.507 +                returnTop;
   8.508 +                ir.
   8.509 +    aCompiledMethod := iRMethod compiledCode.
   8.510 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.511 +    self 
   8.512 +        assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = true).
   8.513 +
   8.514 +    "Modified: / 11-06-2008 / 13:22:11 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.515 +!
   8.516 +
   8.517 +testPushReceiver
   8.518 +    |iRMethod aCompiledMethod receiver|
   8.519 +
   8.520 +    iRMethod := (IRBuilder new)
   8.521 +                numRargs:1;
   8.522 +                addTemps:#( #self );
   8.523 +                pushReceiver;
   8.524 +                returnTop;
   8.525 +                ir.
   8.526 +    aCompiledMethod := iRMethod compiledCode.
   8.527 +    receiver := (5 @ 8).
   8.528 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.529 +    self assert:((aCompiledMethod valueWithReceiver:receiver arguments:#()) 
   8.530 +                == receiver).
   8.531 +!
   8.532 +
   8.533 +testPushTempArgument
   8.534 +    |iRMethod aCompiledMethod|
   8.535 +
   8.536 +    iRMethod := (IRBuilder new)
   8.537 +                numRargs:3;
   8.538 +                addTemps:#( #self #a #b );
   8.539 +                pushTemp:#a;
   8.540 +                pushTemp:#b;
   8.541 +                send:#'+';
   8.542 +                returnTop;
   8.543 +                ir.
   8.544 +    aCompiledMethod := iRMethod compiledCode.
   8.545 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.546 +    self 
   8.547 +        assert:((aCompiledMethod valueWithReceiver:nil arguments:#( 2 8 )) = 10).
   8.548 +!
   8.549 +
   8.550 +testPushTempSelf
   8.551 +    |iRMethod aCompiledMethod|
   8.552 +
   8.553 +    iRMethod := (IRBuilder new)
   8.554 +                numRargs:1;
   8.555 +                addTemps:#( #self );
   8.556 +                pushTemp:#self;
   8.557 +                send:#class;
   8.558 +                returnTop;
   8.559 +                ir.
   8.560 +    aCompiledMethod := iRMethod compiledCode.
   8.561 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.562 +    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) 
   8.563 +                == UndefinedObject).
   8.564 +!
   8.565 +
   8.566 +testPushTempTemp
   8.567 +    |iRMethod aCompiledMethod|
   8.568 +
   8.569 +    iRMethod := (IRBuilder new)
   8.570 +                numRargs:1;
   8.571 +                addTemps:#( #self #a );
   8.572 +                pushTemp:#a;
   8.573 +                returnTop;
   8.574 +                ir.
   8.575 +    aCompiledMethod := iRMethod compiledCode.
   8.576 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.577 +    self assert:((aCompiledMethod valueWithReceiver:5 arguments:#()) = nil).
   8.578 +!
   8.579 +
   8.580 +testPushThisContext
   8.581 +    |iRMethod aCompiledMethod|
   8.582 +
   8.583 +    iRMethod := (IRBuilder new)
   8.584 +                numRargs:1;
   8.585 +                addTemps:#( #self #a );
   8.586 +                pushThisContext;
   8.587 +                send:#receiver;
   8.588 +                returnTop;
   8.589 +                ir.
   8.590 +    aCompiledMethod := iRMethod compiledCode.
   8.591 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.592 +    self assert:((aCompiledMethod valueWithReceiver:5 arguments:#()) = 5).
   8.593 +!
   8.594 +
   8.595 +testPushThisEnv
   8.596 +    |iRMethod aCompiledMethod receiver|
   8.597 +
   8.598 +    ^ self.
   8.599 +    iRMethod := (IRBuilder new)
   8.600 +                numRargs:1;
   8.601 +                addTemps:#( #self );
   8.602 +                pushThisContext;
   8.603 +                pushLiteral:5;
   8.604 +                pushLiteral:ClosureEnvironment;
   8.605 +                pushLiteral:1;
   8.606 +                send:#new:;
   8.607 +                send:#privSetInstVar:put:;
   8.608 +                pushThisEnv;
   8.609 +                returnTop;
   8.610 +                ir.
   8.611 +    aCompiledMethod := iRMethod compiledCode.
   8.612 +    receiver := Object new.
   8.613 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.614 +    self assert:((aCompiledMethod valueWithReceiver:receiver arguments:#()) 
   8.615 +                isKindOf:ClosureEnvironment)
   8.616 +!
   8.617 +
   8.618 +testSendNumArgs1
   8.619 +    |iRMethod aCompiledMethod|
   8.620 +
   8.621 +    iRMethod := (IRBuilder new)
   8.622 +                numRargs:1;
   8.623 +                addTemps:#( #self );
   8.624 +                pushReceiver;
   8.625 +                pushLiteral:1;
   8.626 +                pushLiteral:2;
   8.627 +                send:#mock1 numArgs:2;
   8.628 +                returnTop;
   8.629 +                ir.
   8.630 +    aCompiledMethod := iRMethod compiledCode.
   8.631 +    self class basicAddSelector:#mock1
   8.632 +        withMethod:(self class >> #mock1:with:).
   8.633 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.634 +    self 
   8.635 +        assert:(aCompiledMethod valueWithReceiver:(IRBuilderTest new)
   8.636 +                arguments:#()) = 3.
   8.637 +    self class basicRemoveSelector:#mock1.
   8.638 +
   8.639 +    "Created: / 01-12-2008 / 19:58:18 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.640 +!
   8.641 +
   8.642 +testSendNumArgs2
   8.643 +    |iRMethod aCompiledMethod|
   8.644 +
   8.645 +    iRMethod := (IRBuilder new)
   8.646 +                numRargs:1;
   8.647 +                addTemps:#( #self );
   8.648 +                pushReceiver;
   8.649 +                pushLiteral:1;
   8.650 +                send:#mock1 numArgs:1;
   8.651 +                returnTop;
   8.652 +                ir.
   8.653 +    aCompiledMethod := iRMethod compiledCode.
   8.654 +    self class basicAddSelector:#mock1
   8.655 +        withMethod:(self class >> #mock1:with:).
   8.656 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.657 +    self 
   8.658 +        should:[
   8.659 +            (aCompiledMethod valueWithReceiver:(IRBuilderTest new) arguments:#())
   8.660 +        ]
   8.661 +        raise:Error.
   8.662 +    self class basicRemoveSelector:#mock1.
   8.663 +
   8.664 +    "Created: / 01-12-2008 / 19:59:02 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.665 +!
   8.666 +
   8.667 +testSendSuper
   8.668 +    |iRMethod aCompiledMethod|
   8.669 +
   8.670 +    iRMethod := (IRBuilder new)
   8.671 +                numRargs:1;
   8.672 +                addTemps:#( #self );
   8.673 +                pushReceiver;
   8.674 +                send:#halt toSuperOf:IRBuilderTest;
   8.675 +                returnTop;
   8.676 +                ir.
   8.677 +    aCompiledMethod := iRMethod compiledCode.
   8.678 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.679 +    self 
   8.680 +        should:[
   8.681 +            (aCompiledMethod valueWithReceiver:(IRBuilderTest new) arguments:#())
   8.682 +        ]
   8.683 +        raise:Error.
   8.684 +
   8.685 +    "Modified: / 11-06-2008 / 16:09:12 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.686 +!
   8.687 +
   8.688 +testStorIntoVariable
   8.689 +    |iRMethod aCompiledMethod|
   8.690 +
   8.691 +    iRMethod := (IRBuilder new)
   8.692 +                numRargs:1;
   8.693 +                addTemps:#( #self );
   8.694 +                pushLiteral:4;
   8.695 +                storeIntoLiteralVariable:(IRBuilderTest bindingOf:#TestToPush);
   8.696 +                returnTop;
   8.697 +                ir.
   8.698 +    aCompiledMethod := iRMethod compiledCode.
   8.699 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.700 +    aCompiledMethod valueWithReceiver:nil arguments:#().
   8.701 +    self assert:(IRBuilderTest testToPush = 4).
   8.702 +    IRBuilderTest testToPush:nil.
   8.703 +!
   8.704 +
   8.705 +testStoreTemp
   8.706 +    |iRMethod aCompiledMethod|
   8.707 +
   8.708 +    iRMethod := (IRBuilder new)
   8.709 +                numRargs:1;
   8.710 +                addTemps:#( #self #a );
   8.711 +                pushLiteral:34;
   8.712 +                storeTemp:#a;
   8.713 +                pushTemp:#a;
   8.714 +                returnTop;
   8.715 +                ir.
   8.716 +    aCompiledMethod := iRMethod compiledCode.
   8.717 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.718 +    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = 34).
   8.719 +
   8.720 +    "Modified: / 11-06-2008 / 16:24:43 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.721 +!
   8.722 +
   8.723 +testStoreThisEnv
   8.724 +    |iRMethod aCompiledMethod|
   8.725 +
   8.726 +    ^ self.
   8.727 +    iRMethod := (IRBuilder new)
   8.728 +                numRargs:1;
   8.729 +                addTemps:#( #self #a );
   8.730 +                pushLiteral:ClosureEnvironment;
   8.731 +                pushLiteral:1;
   8.732 +                send:#new:;
   8.733 +                storeThisEnv;
   8.734 +                pushThisContext;
   8.735 +                pushLiteral:5;
   8.736 +                send:#privGetInstVar:;
   8.737 +                returnTop;
   8.738 +                ir.
   8.739 +    aCompiledMethod := iRMethod compiledCode.
   8.740 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.741 +    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) 
   8.742 +                isKindOf:ClosureEnvironment).
   8.743 +
   8.744 +    "Modified: / 11-06-2008 / 14:47:51 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.745 +!
   8.746 +
   8.747 +testTwoJumpAheadToIfsToSameTarget
   8.748 +    |iRMethod aCompiledMethod|
   8.749 +
   8.750 +    iRMethod := (IRBuilder new)
   8.751 +                numRargs:1;
   8.752 +                addTemps:#( #self );
   8.753 +                pushTemp:#self;
   8.754 +                pushLiteral:false;
   8.755 +                jumpAheadTo:#end if:true;
   8.756 +                pushLiteral:true;
   8.757 +                jumpAheadTo:#end if:true;
   8.758 +                pushLiteral:3;
   8.759 +                jumpAheadTarget:#end;
   8.760 +                returnTop;
   8.761 +                ir.
   8.762 +    aCompiledMethod := iRMethod compiledCode.
   8.763 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.764 +    self assert:((aCompiledMethod valueWithReceiver:nil arguments:#()) = nil).
   8.765 +
   8.766 +    "Created: / 03-11-2008 / 13:34:50 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.767 +! !
   8.768 +
   8.769 +!IRBuilderTest methodsFor:'testing - blocks'!
   8.770 +
   8.771 +testBlock_blockNesting_1
   8.772 +    |aCompiledMethod irBuilder|
   8.773 +
   8.774 +    irBuilder := (IRBuilder new)
   8.775 +                numRargs:1;
   8.776 +                addTemps:#( #self );
   8.777 +                pushBlockUsingBuilder:[:builder | 
   8.778 +                        builder
   8.779 +                            numRargs:1;
   8.780 +                            addTemps:#( #barg1 );
   8.781 +                            pushBlockUsingBuilder:[:builder|
   8.782 +                                builder
   8.783 +                                    numRargs: 1;
   8.784 +                                    addTemps: #( #barg2 );
   8.785 +                                    pushTemp: #barg2;
   8.786 +                                    returnTop
   8.787 +                            ];
   8.788 +                            pushTemp: #barg1;
   8.789 +                            send: #value:;
   8.790 +                            returnTop
   8.791 +                    ];
   8.792 +                pushLiteral: 22;
   8.793 +                send:#value;
   8.794 +                returnTop;
   8.795 +                ir.
   8.796 +    "
   8.797 +        irBuilder ir
   8.798 +    "
   8.799 +
   8.800 +    aCompiledMethod := irBuilder compiledCode.
   8.801 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.802 +    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = 22).
   8.803 +
   8.804 +    "Created: / 11-05-2009 / 23:04:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.805 +!
   8.806 +
   8.807 +testBlock_blockTempArg
   8.808 +    |aCompiledMethod irBuilder|
   8.809 +
   8.810 +    irBuilder := (IRBuilder new)
   8.811 +                numRargs:1;
   8.812 +                addTemps:#( #self );
   8.813 +                pushBlockUsingBuilder:[:builder | 
   8.814 +                        builder
   8.815 +                            numRargs:1;
   8.816 +                            addTemps:#( #barg1 );
   8.817 +                            pushTemp:#barg1;
   8.818 +                            returnTop
   8.819 +                    ];
   8.820 +                pushLiteral:22;
   8.821 +                send:#value:;
   8.822 +                returnTop;
   8.823 +                ir.
   8.824 +    "
   8.825 +        irBuilder ir
   8.826 +    "
   8.827 +
   8.828 +    aCompiledMethod := irBuilder compiledCode.
   8.829 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.830 +    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = 22).
   8.831 +
   8.832 +    "Created: / 30-03-2009 / 14:26:18 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.833 +    "Modified: / 30-03-2009 / 19:16:25 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.834 +!
   8.835 +
   8.836 +testBlock_blockTempVar
   8.837 +    |aCompiledMethod irBuilder|
   8.838 +
   8.839 +    irBuilder := (IRBuilder new)
   8.840 +                numRargs:1;
   8.841 +                addTemps:#( #self );
   8.842 +                pushBlockUsingBuilder:[:builder | 
   8.843 +                        builder
   8.844 +                            numRargs:0;
   8.845 +                            addTemps:#( #bvar1 );
   8.846 +                            pushLiteral: 22;
   8.847 +                            storeTemp:#bvar1;
   8.848 +                            pushTemp: #bvar1;
   8.849 +                            returnTop
   8.850 +                    ];
   8.851 +                send:#value;
   8.852 +                returnTop;
   8.853 +                ir.
   8.854 +    "
   8.855 +        irBuilder ir
   8.856 +    "
   8.857 +
   8.858 +    aCompiledMethod := irBuilder compiledCode.
   8.859 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.860 +    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = 22).
   8.861 +
   8.862 +    "Created: / 30-03-2009 / 23:03:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.863 +!
   8.864 +
   8.865 +testBlock_block_in_another_basic_block
   8.866 +    |aCompiledMethod irBuilder|
   8.867 +
   8.868 +    irBuilder := (IRBuilder new)
   8.869 +                numRargs:1;
   8.870 +                addTemps:#( #self );
   8.871 +                pushLiteral: false;
   8.872 +                pushLiteral: true;
   8.873 +                jumpAheadTo: #end if: false;
   8.874 +                pushBlockUsingBuilder:[:builder | 
   8.875 +                        builder
   8.876 +                            numRargs: 0;
   8.877 +                            pushLiteral: true;
   8.878 +                            returnTop
   8.879 +                    ];
   8.880 +                send: #value;
   8.881 +                jumpAheadTarget: #end;
   8.882 +                returnTop;
   8.883 +                ir.
   8.884 +    "
   8.885 +        irBuilder ir
   8.886 +    "
   8.887 +
   8.888 +    aCompiledMethod := irBuilder compiledCode.
   8.889 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.890 +    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = true).
   8.891 +
   8.892 +    "Created: / 13-05-2009 / 11:24:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.893 +!
   8.894 +
   8.895 +testBlock_exceptionHandler
   8.896 +    |aCompiledMethod irBuilder|
   8.897 +
   8.898 +    irBuilder := (IRBuilder new)
   8.899 +                numRargs:1;
   8.900 +                addTemps:#( #self);
   8.901 +               pushBlockUsingBuilder:[:builder | 
   8.902 +                        builder
   8.903 +                            numRargs:0;  
   8.904 +                            pushLiteral: 1;
   8.905 +                            pushLiteral: 0;
   8.906 +                            send: #/;
   8.907 +                            pushLiteral: false;
   8.908 +                            remoteReturn
   8.909 +                    ];
   8.910 +                pushLiteralVariable: #Error;
   8.911 +                pushBlockUsingBuilder:[:builder|
   8.912 +                    builder
   8.913 +                        numRargs:0;
   8.914 +                        pushLiteral: true;
   8.915 +                        remoteReturn];
   8.916 +                send: #on:do:;
   8.917 +                pushLiteral: false;
   8.918 +                returnTop;
   8.919 +                ir.
   8.920 +    "
   8.921 +        irBuilder ir
   8.922 +    "
   8.923 +
   8.924 +    aCompiledMethod := irBuilder compiledCode.
   8.925 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.926 +    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = true).
   8.927 +
   8.928 +    "Created: / 11-05-2009 / 21:53:19 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.929 +!
   8.930 +
   8.931 +testBlock_exceptionHandler_noRemoteReturn
   8.932 +    |aCompiledMethod irBuilder|
   8.933 +
   8.934 +    irBuilder := (IRBuilder new)
   8.935 +                numRargs:1;
   8.936 +                addTemps:#( #self);
   8.937 +               pushBlockUsingBuilder:[:builder | 
   8.938 +                        builder
   8.939 +                            numRargs:0;  
   8.940 +                            pushLiteral: 1;
   8.941 +                            pushLiteral: 0;
   8.942 +                            send: #/;
   8.943 +                            pushLiteral: false;
   8.944 +                            returnTop
   8.945 +                    ];
   8.946 +                pushLiteralVariable: #Error;
   8.947 +                pushBlockUsingBuilder:[:builder|
   8.948 +                    builder
   8.949 +                        numRargs:0;
   8.950 +                        pushLiteral: true;
   8.951 +                        returnTop];
   8.952 +                send: #on:do:;
   8.953 +                returnTop;
   8.954 +                ir.
   8.955 +    "
   8.956 +        irBuilder ir
   8.957 +    "
   8.958 +
   8.959 +    aCompiledMethod := irBuilder compiledCode.
   8.960 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.961 +    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = true).
   8.962 +
   8.963 +    "Created: / 11-05-2009 / 21:53:25 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.964 +!
   8.965 +
   8.966 +testBlock_invalid_instruction_ordering_bug_1
   8.967 +    |aCompiledMethod irBuilder|
   8.968 +
   8.969 +    irBuilder := (IRBuilder new)
   8.970 +                    numRargs: 1;
   8.971 +                    addTemps: #(self i);
   8.972 +                    pushTemp: #i;
   8.973 +                    pushLiteral: 3;
   8.974 +                    pushReceiver;
   8.975 +
   8.976 +                    pushBlockUsingBuilder: [ :builder | 
   8.977 +                        builder
   8.978 +                            numRargs: 0;
   8.979 +                            addTemps: #();
   8.980 +                            pushTemp: #i;
   8.981 +                            returnTop.
   8.982 +                    ];
   8.983 +                    returnTop;
   8.984 +                    ir.
   8.985 +    "
   8.986 +        irBuilder ir
   8.987 +    "
   8.988 +
   8.989 +    aCompiledMethod := irBuilder compiledCode.
   8.990 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
   8.991 +    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) isKindOf: Block).
   8.992 +
   8.993 +    "Created: / 11-05-2009 / 21:55:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
   8.994 +!
   8.995 +
   8.996 +testBlock_methodTempVar
   8.997 +    |aCompiledMethod irBuilder|
   8.998 +
   8.999 +    irBuilder := (IRBuilder new)
  8.1000 +                numRargs:1;
  8.1001 +                addTemps:#( #self #a);
  8.1002 +                pushLiteral: 22;
  8.1003 +                storeTemp: #a;
  8.1004 +                pushBlockUsingBuilder:[:builder | 
  8.1005 +                        builder
  8.1006 +                            numRargs:0;
  8.1007 +                            pushTemp: #a;
  8.1008 +                            returnTop
  8.1009 +                    ];
  8.1010 +                send:#value;
  8.1011 +                returnTop;
  8.1012 +                ir.
  8.1013 +    "
  8.1014 +        irBuilder ir
  8.1015 +    "
  8.1016 +
  8.1017 +    aCompiledMethod := irBuilder compiledCode.
  8.1018 +    self assert:(aCompiledMethod isKindOf:CompiledMethod).
  8.1019 +    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = 22).
  8.1020 +
  8.1021 +    "Created: / 30-03-2009 / 23:05:00 / Jan Vrany <vranyj1@fel.cvut.cz>"
  8.1022 +    "Modified: / 01-04-2009 / 19:43:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
  8.1023 +! !
  8.1024 +
  8.1025 +!IRBuilderTest class methodsFor:'documentation'!
  8.1026 +
  8.1027 +version_CVS
  8.1028 +    ^ 'Header: /cvs/stx/cvut/stx/goodies/newcompiler/IRBuilderTest.st,v 1.3 2009/10/08 12:03:51 fm Exp '
  8.1029 +!
  8.1030 +
  8.1031 +version_SVN
  8.1032 +    ^ '$Id::                                                                                                                        $'
  8.1033 +! !
  8.1034 +
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/tests/IRTransformTest.st	Thu Oct 30 22:27:09 2014 +0000
     9.3 @@ -0,0 +1,172 @@
     9.4 +"{ Package: 'ctu:ircompiler/tests' }"
     9.5 +
     9.6 +TestCase subclass:#IRTransformTest
     9.7 +	instanceVariableNames:''
     9.8 +	classVariableNames:''
     9.9 +	poolDictionaries:''
    9.10 +	category:'IR Compiler-Tests'
    9.11 +!
    9.12 +
    9.13 +
    9.14 +!IRTransformTest methodsFor:'testing'!
    9.15 +
    9.16 +testAdd
    9.17 +    |iRMethod aCompiledMethod|
    9.18 +
    9.19 +    iRMethod := (IRBuilder new)
    9.20 +                numRargs:1;
    9.21 +                addTemps:#( #self );
    9.22 +                pushLiteral:1;
    9.23 +                returnTop;
    9.24 +                ir.
    9.25 +    (iRMethod allSequences last) last delete.
    9.26 +    (iRMethod allSequences last) last delete.
    9.27 +    (iRMethod allSequences last) add:(IRInstruction pushLiteral:2).
    9.28 +    (iRMethod allSequences last) add:(IRInstruction returnTop).
    9.29 +    aCompiledMethod := iRMethod compiledCode.
    9.30 +    self should:[ (aCompiledMethod valueWithReceiver:nil arguments:#()) = 2 ].
    9.31 +!
    9.32 +
    9.33 +testAddBefore
    9.34 +    |iRMethod aCompiledMethod ret|
    9.35 +
    9.36 +    iRMethod := (IRBuilder new)
    9.37 +                numRargs:1;
    9.38 +                addTemps:#( #self );
    9.39 +                pushLiteral:1;
    9.40 +                returnTop;
    9.41 +                ir.
    9.42 +    (iRMethod allSequences last) last delete.
    9.43 +    (iRMethod allSequences last) last delete.
    9.44 +    ret := (IRInstruction returnTop).
    9.45 +    (iRMethod allSequences last) add:ret.
    9.46 +    (iRMethod allSequences last) add:(IRInstruction pushLiteral:2) before:ret.
    9.47 +    aCompiledMethod := iRMethod compiledCode.
    9.48 +    self should:[ (aCompiledMethod valueWithReceiver:nil arguments:#()) = 2 ].
    9.49 +!
    9.50 +
    9.51 +testAddIntructions
    9.52 +        
    9.53 +        | iRMethod aCompiledMethod |
    9.54 +
    9.55 +        iRMethod := IRBuilder new
    9.56 +                numRargs: 1;
    9.57 +                addTemps: #(self);              "receiver and args declarations"
    9.58 +                pushLiteral: 1;                                 
    9.59 +                returnTop;
    9.60 +                ir.
    9.61 +
    9.62 +        (iRMethod allSequences last) last delete.
    9.63 +        (iRMethod allSequences last) last delete.
    9.64 +
    9.65 +        (iRMethod allSequences last)
    9.66 +                        addInstructions: {(IRInstruction pushLiteral: 2). (IRInstruction returnTop)}.
    9.67 +
    9.68 +        aCompiledMethod := iRMethod compiledCode.
    9.69 +        self should: [(aCompiledMethod valueWithReceiver: nil arguments: #() ) = 2].
    9.70 +
    9.71 +    "Modified: / 30-03-2009 / 19:40:10 / Jan Vrany <vranyj1@fel.cvut.cz>"
    9.72 +!
    9.73 +
    9.74 +testAddIntructionsBefore
    9.75 +        
    9.76 +        | iRMethod aCompiledMethod push |
    9.77 +
    9.78 +        iRMethod := IRBuilder new
    9.79 +                numRargs: 1;
    9.80 +                addTemps: #(self);              "receiver and args declarations"
    9.81 +                pushLiteral: 1;                                 
    9.82 +                returnTop;
    9.83 +                ir.
    9.84 +
    9.85 +        push := (iRMethod allSequences last) at: (iRMethod allSequences size - 1) .
    9.86 +
    9.87 +        (iRMethod allSequences last)
    9.88 +                        addInstructions: {(IRInstruction pushLiteral: 2). (IRInstruction returnTop)} before: push.
    9.89 +
    9.90 +        aCompiledMethod := iRMethod compiledCode.
    9.91 +        self should: [(aCompiledMethod valueWithReceiver: nil arguments: #() ) = 2].
    9.92 +
    9.93 +    "Modified: / 30-03-2009 / 19:40:21 / Jan Vrany <vranyj1@fel.cvut.cz>"
    9.94 +!
    9.95 +
    9.96 +testAddIntructionsBeforeFromLList
    9.97 +    |iRMethod aCompiledMethod push llist col|
    9.98 +
    9.99 +    iRMethod := (IRBuilder new)
   9.100 +                numRargs:1;
   9.101 +                addTemps:#( #self );
   9.102 +                pushLiteral:1;
   9.103 +                returnTop;
   9.104 +                ir.
   9.105 +    push := (iRMethod allSequences last) at:(iRMethod allSequences size - 1).
   9.106 +    llist := LinkedList new.
   9.107 +    llist add:(IRInstruction pushLiteral:2).
   9.108 +    llist add:(IRInstruction returnTop).
   9.109 +    col := llist asOrderedCollection.
   9.110 +    (iRMethod allSequences last) addInstructions:col before:push.
   9.111 +    aCompiledMethod := iRMethod compiledCode.
   9.112 +    self should:[ (aCompiledMethod valueWithReceiver:nil arguments:#()) = 2 ].
   9.113 +!
   9.114 +
   9.115 +testDelete
   9.116 +    |iRMethod aCompiledMethod|
   9.117 +
   9.118 +    iRMethod := (IRBuilder new)
   9.119 +                numRargs:1;
   9.120 +                addTemps:#( #self );
   9.121 +                pushLiteral:1;
   9.122 +                pushLiteral:2;
   9.123 +                returnTop;
   9.124 +                ir.
   9.125 +    ((iRMethod allSequences last) 
   9.126 +        detect:[:each | each isConstant:[:c | c == 2 ] ]) delete.
   9.127 +    aCompiledMethod := iRMethod compiledCode.
   9.128 +    self should:[ (aCompiledMethod valueWithReceiver:nil arguments:#()) = 1 ].
   9.129 +!
   9.130 +
   9.131 +testReplace
   9.132 +    |iRMethod aCompiledMethod|
   9.133 +
   9.134 +    iRMethod := (IRBuilder new)
   9.135 +                numRargs:1;
   9.136 +                addTemps:#( #self );
   9.137 +                pushLiteral:1;
   9.138 +                returnTop;
   9.139 +                ir.
   9.140 +    (iRMethod allSequences last at:1) 
   9.141 +        replaceWith:(IRInstruction pushLiteral:2).
   9.142 +    aCompiledMethod := iRMethod compiledCode.
   9.143 +    self should:[ (aCompiledMethod valueWithReceiver:nil arguments:#()) = 2 ].
   9.144 +!
   9.145 +
   9.146 +testReplaceInstr
   9.147 +        
   9.148 +        | iRMethod aCompiledMethod |
   9.149 +
   9.150 +        iRMethod := IRBuilder new
   9.151 +                numRargs: 1;
   9.152 +                addTemps: #(self);              "receiver and args declarations"
   9.153 +                pushLiteral: 1;                                 
   9.154 +                returnTop;
   9.155 +                ir.
   9.156 +        
   9.157 +        (iRMethod allSequences last at: 1) 
   9.158 +                        replaceWithInstructions: {(IRInstruction pushLiteral: 2)}.
   9.159 +
   9.160 +        aCompiledMethod := iRMethod compiledCode.
   9.161 +        self should: [(aCompiledMethod valueWithReceiver: nil arguments: #() ) = 2].
   9.162 +
   9.163 +    "Modified: / 30-03-2009 / 19:40:30 / Jan Vrany <vranyj1@fel.cvut.cz>"
   9.164 +! !
   9.165 +
   9.166 +!IRTransformTest class methodsFor:'documentation'!
   9.167 +
   9.168 +version_CVS
   9.169 +    ^ 'Header: /cvs/stx/cvut/stx/goodies/newcompiler/IRTransformTest.st,v 1.3 2009/10/08 11:56:52 fm Exp '
   9.170 +!
   9.171 +
   9.172 +version_SVN
   9.173 +    ^ '$Id::                                                                                                                        $'
   9.174 +! !
   9.175 +
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/tests/Make.proto	Thu Oct 30 22:27:09 2014 +0000
    10.3 @@ -0,0 +1,134 @@
    10.4 +# $Header$
    10.5 +#
    10.6 +# DO NOT EDIT
    10.7 +# automagically generated from the projectDefinition: ctu_ircompiler_tests.
    10.8 +#
    10.9 +# Warning: once you modify this file, do not rerun
   10.10 +# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
   10.11 +#
   10.12 +# The Makefile as generated by this Make.proto supports the following targets:
   10.13 +#    make         - compile all st-files to a classLib
   10.14 +#    make clean   - clean all temp files
   10.15 +#    make clobber - clean all
   10.16 +#
   10.17 +# This file contains definitions for Unix based platforms.
   10.18 +# It shares common definitions with the win32-make in Make.spec.
   10.19 +
   10.20 +#
   10.21 +# position (of this package) in directory hierarchy:
   10.22 +# (must point to ST/X top directory, for tools and includes)
   10.23 +TOP=../../../stx
   10.24 +INCLUDE_TOP=$(TOP)/..
   10.25 +
   10.26 +# subdirectories where targets are to be made:
   10.27 +SUBDIRS=
   10.28 +
   10.29 +
   10.30 +# subdirectories where Makefiles are to be made:
   10.31 +# (only define if different from SUBDIRS)
   10.32 +# ALLSUBDIRS=
   10.33 +
   10.34 +REQUIRED_SUPPORT_DIRS=
   10.35 +
   10.36 +# if your embedded C code requires any system includes,
   10.37 +# add the path(es) here:,
   10.38 +# ********** OPTIONAL: MODIFY the next lines ***
   10.39 +# LOCALINCLUDES=-Ifoo -Ibar
   10.40 +LOCALINCLUDES= -I$(INCLUDE_TOP)/ctu/ircompiler -I$(INCLUDE_TOP)/stx/goodies/sunit -I$(INCLUDE_TOP)/stx/libbasic
   10.41 +
   10.42 +
   10.43 +# if you need any additional defines for embedded C code,
   10.44 +# add them here:,
   10.45 +# ********** OPTIONAL: MODIFY the next lines ***
   10.46 +# LOCALDEFINES=-Dfoo -Dbar -DDEBUG
   10.47 +LOCALDEFINES=
   10.48 +
   10.49 +LIBNAME=libctu_ircompiler_tests
   10.50 +STCLOCALOPT='-package=$(PACKAGE)' -I. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -headerDir=.  -varPrefix=$(LIBNAME)
   10.51 +
   10.52 +
   10.53 +# ********** OPTIONAL: MODIFY the next line ***
   10.54 +# additional C-libraries that should be pre-linked with the class-objects
   10.55 +LD_OBJ_LIBS=
   10.56 +LOCAL_SHARED_LIBS=
   10.57 +
   10.58 +
   10.59 +# ********** OPTIONAL: MODIFY the next line ***
   10.60 +# additional C targets or libraries should be added below
   10.61 +LOCAL_EXTRA_TARGETS=
   10.62 +
   10.63 +OBJS= $(COMMON_OBJS) $(UNIX_OBJS)
   10.64 +
   10.65 +
   10.66 +
   10.67 +all:: preMake classLibRule postMake
   10.68 +
   10.69 +pre_objs::  
   10.70 +
   10.71 +
   10.72 +
   10.73 +
   10.74 +
   10.75 +
   10.76 +# Enforce recompilation of package definition class if Mercurial working
   10.77 +# copy state changes. Together with --guessVersion it ensures that package
   10.78 +# definition class always contains correct binary revision string.
   10.79 +ifneq (**NOHG**, $(shell hg root 2> /dev/null || echo -n '**NOHG**'))
   10.80 +ctu_ircompiler_tests.$(O): $(shell hg root)/.hg/dirstate
   10.81 +endif
   10.82 +
   10.83 +
   10.84 +
   10.85 +
   10.86 +# run default testsuite for this package
   10.87 +test: $(TOP)/goodies/builder/reports
   10.88 +	$(MAKE) -C $(TOP)/goodies/builder/reports -f Makefile.init
   10.89 +	$(TOP)/goodies/builder/reports/report-runner.sh -D . -r Builder::TestReport -p $(PACKAGE)
   10.90 +
   10.91 +
   10.92 +
   10.93 +# add more install actions here
   10.94 +install::
   10.95 +
   10.96 +# add more install actions for aux-files (resources) here
   10.97 +installAux::
   10.98 +
   10.99 +# add more preMake actions here
  10.100 +preMake::
  10.101 +
  10.102 +# add more postMake actions here
  10.103 +postMake:: cleanjunk
  10.104 +
  10.105 +# build all mandatory prerequisite packages (containing superclasses) for this package
  10.106 +prereq:
  10.107 +	cd $(TOP)/libbasic && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
  10.108 +	cd $(TOP)/libbasic2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
  10.109 +	cd $(TOP)/libbasic3 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
  10.110 +	cd $(TOP)/libview && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
  10.111 +	cd $(TOP)/libview2 && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
  10.112 +	cd $(TOP)/goodies/sunit && $(MAKE) "CFLAGS_LOCAL=$(GLOBALDEFINES)"
  10.113 +
  10.114 +
  10.115 +
  10.116 +# build all packages containing referenced classes for this package
  10.117 +# they are nor needed to compile the package
  10.118 +references:
  10.119 +
  10.120 +
  10.121 +cleanjunk::
  10.122 +	-rm -f *.s *.s2
  10.123 +
  10.124 +clean::
  10.125 +	-rm -f *.o *.H
  10.126 +
  10.127 +clobber:: clean
  10.128 +	-rm -f *.so *.dll
  10.129 +
  10.130 +
  10.131 +# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
  10.132 +$(OUTDIR)IRBuilderTest.$(O) IRBuilderTest.$(H): IRBuilderTest.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
  10.133 +$(OUTDIR)IRTransformTest.$(O) IRTransformTest.$(H): IRTransformTest.st $(INCLUDE_TOP)/stx/goodies/sunit/TestAsserter.$(H) $(INCLUDE_TOP)/stx/goodies/sunit/TestCase.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
  10.134 +$(OUTDIR)ctu_ircompiler_tests.$(O) ctu_ircompiler_tests.$(H): ctu_ircompiler_tests.st $(INCLUDE_TOP)/stx/libbasic/LibraryDefinition.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/ProjectDefinition.$(H) $(STCHDR)
  10.135 +
  10.136 +# ENDMAKEDEPEND --- do not remove this line
  10.137 +
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/tests/Make.spec	Thu Oct 30 22:27:09 2014 +0000
    11.3 @@ -0,0 +1,66 @@
    11.4 +# $Header$
    11.5 +#
    11.6 +# DO NOT EDIT
    11.7 +# automagically generated from the projectDefinition: ctu_ircompiler_tests.
    11.8 +#
    11.9 +# Warning: once you modify this file, do not rerun
   11.10 +# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
   11.11 +#
   11.12 +# This file contains specifications which are common to all platforms.
   11.13 +#
   11.14 +
   11.15 +# Do NOT CHANGE THESE DEFINITIONS
   11.16 +# (otherwise, ST/X will have a hard time to find out the packages location from its packageID,
   11.17 +#  to find the source code of a class and to find the library for a package)
   11.18 +MODULE=ctu
   11.19 +MODULE_DIR=ircompiler/tests
   11.20 +PACKAGE=$(MODULE):$(MODULE_DIR)
   11.21 +
   11.22 +
   11.23 +# Argument(s) to the stc compiler (stc --usage).
   11.24 +#  -headerDir=. : create header files locally
   11.25 +#                (if removed, they will be created as common
   11.26 +#  -Pxxx       : defines the package
   11.27 +#  -Zxxx       : a prefix for variables within the classLib
   11.28 +#  -Dxxx       : defines passed to to CC for inline C-code
   11.29 +#  -Ixxx       : include path passed to CC for inline C-code
   11.30 +#  +optspace   : optimized for space
   11.31 +#  +optspace2  : optimized more for space
   11.32 +#  +optspace3  : optimized even more for space
   11.33 +#  +optinline  : generate inline code for some ST constructs
   11.34 +#  +inlineNew  : additionally inline new
   11.35 +#  +inlineMath : additionally inline some floatPnt math stuff
   11.36 +#
   11.37 +# ********** OPTIONAL: MODIFY the next line(s) ***
   11.38 +# STCLOCALOPTIMIZATIONS=+optinline +inlineNew
   11.39 +# STCLOCALOPTIMIZATIONS=+optspace3
   11.40 +STCLOCALOPTIMIZATIONS=+optspace3
   11.41 +
   11.42 +
   11.43 +# Argument(s) to the stc compiler (stc --usage).
   11.44 +#  -warn            : no warnings
   11.45 +#  -warnNonStandard : no warnings about ST/X extensions
   11.46 +#  -warnEOLComments : no warnings about EOL comment extension
   11.47 +#  -warnPrivacy     : no warnings about privateClass extension
   11.48 +#
   11.49 +# ********** OPTIONAL: MODIFY the next line(s) ***
   11.50 +# STCWARNINGS=-warn
   11.51 +# STCWARNINGS=-warnNonStandard
   11.52 +# STCWARNINGS=-warnEOLComments
   11.53 +STCWARNINGS=-warnNonStandard
   11.54 +
   11.55 +COMMON_CLASSES= \
   11.56 +	IRBuilderTest \
   11.57 +	IRTransformTest \
   11.58 +	ctu_ircompiler_tests \
   11.59 +
   11.60 +
   11.61 +
   11.62 +
   11.63 +COMMON_OBJS= \
   11.64 +    $(OUTDIR_SLASH)IRBuilderTest.$(O) \
   11.65 +    $(OUTDIR_SLASH)IRTransformTest.$(O) \
   11.66 +    $(OUTDIR_SLASH)ctu_ircompiler_tests.$(O) \
   11.67 +
   11.68 +
   11.69 +
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/tests/Makefile.init	Thu Oct 30 22:27:09 2014 +0000
    12.3 @@ -0,0 +1,27 @@
    12.4 +#
    12.5 +# DO NOT EDIT
    12.6 +#
    12.7 +# make uses this file (Makefile) only, if there is no
    12.8 +# file named "makefile" (lower-case m) in the same directory.
    12.9 +# My only task is to generate the real makefile and call make again.
   12.10 +# Thereafter, I am no longer used and needed.
   12.11 +#
   12.12 +# MACOSX caveat:
   12.13 +#   as filenames are not case sensitive (in a default setup),
   12.14 +#   we cannot use the above trick. Therefore, this file is now named
   12.15 +#   "Makefile.init", and you have to execute "make -f Makefile.init" to
   12.16 +#   get the initial makefile.  This is now also done by the toplevel CONFIG
   12.17 +#   script.
   12.18 +
   12.19 +.PHONY: run
   12.20 +
   12.21 +run: makefile
   12.22 +	$(MAKE) -f makefile
   12.23 +
   12.24 +#only needed for the definition of $(TOP)
   12.25 +include Make.proto
   12.26 +
   12.27 +makefile: mf
   12.28 +
   12.29 +mf:
   12.30 +	$(TOP)/rules/stmkmf
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/tests/abbrev.stc	Thu Oct 30 22:27:09 2014 +0000
    13.3 @@ -0,0 +1,6 @@
    13.4 +# automagically generated by the project definition
    13.5 +# this file is needed for stc to be able to compile modules independently.
    13.6 +# it provides information about a classes filename, category and especially namespace.
    13.7 +IRBuilderTest IRBuilderTest ctu:ircompiler/tests 'IR Compiler-Tests' 1
    13.8 +IRTransformTest IRTransformTest ctu:ircompiler/tests 'IR Compiler-Tests' 1
    13.9 +ctu_ircompiler_tests ctu_ircompiler_tests ctu:ircompiler/tests '* Projects & Packages *' 3
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/tests/bc.mak	Thu Oct 30 22:27:09 2014 +0000
    14.3 @@ -0,0 +1,88 @@
    14.4 +# $Header$
    14.5 +#
    14.6 +# DO NOT EDIT
    14.7 +# automagically generated from the projectDefinition: ctu_ircompiler_tests.
    14.8 +#
    14.9 +# Warning: once you modify this file, do not rerun
   14.10 +# stmkmp or projectDefinition-build again - otherwise, your changes are lost.
   14.11 +#
   14.12 +# Notice, that the name bc.mak is historical (from times, when only borland c was supported).
   14.13 +# This file contains make rules for the win32 platform using either borland-bcc or visual-c.
   14.14 +# It shares common definitions with the unix-make in Make.spec.
   14.15 +# The bc.mak supports the following targets:
   14.16 +#    bmake         - compile all st-files to a classLib (dll)
   14.17 +#    bmake clean   - clean all temp files
   14.18 +#    bmake clobber - clean all
   14.19 +#
   14.20 +# Historic Note:
   14.21 +#  this used to contain only rules to make with borland
   14.22 +#    (called via bmake, by "make.exe -f bc.mak")
   14.23 +#  this has changed; it is now also possible to build using microsoft visual c
   14.24 +#    (called via vcmake, by "make.exe -f bc.mak -DUSEVC")
   14.25 +#
   14.26 +TOP=..\..\..\stx
   14.27 +INCLUDE_TOP=$(TOP)\..
   14.28 +
   14.29 +
   14.30 +
   14.31 +!INCLUDE $(TOP)\rules\stdHeader_bc
   14.32 +
   14.33 +!INCLUDE Make.spec
   14.34 +
   14.35 +LIBNAME=libctu_ircompiler_tests
   14.36 +RESFILES=tests.$(RES)
   14.37 +
   14.38 +
   14.39 +
   14.40 +LOCALINCLUDES= -I$(INCLUDE_TOP)\ctu\ircompiler -I$(INCLUDE_TOP)\stx\goodies\sunit -I$(INCLUDE_TOP)\stx\libbasic
   14.41 +LOCALDEFINES=
   14.42 +
   14.43 +STCLOCALOPT=-package=$(PACKAGE) -I. $(LOCALINCLUDES) -headerDir=. $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES)  -varPrefix=$(LIBNAME)
   14.44 +LOCALLIBS=
   14.45 +
   14.46 +OBJS= $(COMMON_OBJS) $(WIN32_OBJS)
   14.47 +
   14.48 +ALL::  classLibRule
   14.49 +
   14.50 +classLibRule: $(OUTDIR) $(OUTDIR)$(LIBNAME).dll
   14.51 +
   14.52 +!INCLUDE $(TOP)\rules\stdRules_bc
   14.53 +
   14.54 +# build all mandatory prerequisite packages (containing superclasses) for this package
   14.55 +prereq:
   14.56 +	pushd ..\..\..\stx\libbasic & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
   14.57 +	pushd ..\..\..\stx\libbasic2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
   14.58 +	pushd ..\..\..\stx\libbasic3 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
   14.59 +	pushd ..\..\..\stx\libview & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
   14.60 +	pushd ..\..\..\stx\libview2 & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
   14.61 +	pushd ..\..\..\stx\goodies\sunit & $(MAKE_BAT) "CFLAGS_LOCAL=$(GLOBALDEFINES) "
   14.62 +
   14.63 +
   14.64 +
   14.65 +
   14.66 +
   14.67 +
   14.68 +
   14.69 +test: $(TOP)\goodies\builder\reports\NUL
   14.70 +	pushd $(TOP)\goodies\builder\reports & $(MAKE_BAT)
   14.71 +	$(TOP)\goodies\builder\reports\report-runner.bat -D . -r Builder::TestReport -p $(PACKAGE)
   14.72 +        
   14.73 +clean::
   14.74 +	del *.$(CSUFFIX)
   14.75 +
   14.76 +
   14.77 +# BEGINMAKEDEPEND --- do not remove this line; make depend needs it
   14.78 +$(OUTDIR)IRBuilderTest.$(O) IRBuilderTest.$(H): IRBuilderTest.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
   14.79 +$(OUTDIR)IRTransformTest.$(O) IRTransformTest.$(H): IRTransformTest.st $(INCLUDE_TOP)\stx\goodies\sunit\TestAsserter.$(H) $(INCLUDE_TOP)\stx\goodies\sunit\TestCase.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
   14.80 +$(OUTDIR)ctu_ircompiler_tests.$(O) ctu_ircompiler_tests.$(H): ctu_ircompiler_tests.st $(INCLUDE_TOP)\stx\libbasic\LibraryDefinition.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\ProjectDefinition.$(H) $(STCHDR)
   14.81 +
   14.82 +# ENDMAKEDEPEND --- do not remove this line
   14.83 +
   14.84 +# **Must be at end**
   14.85 +
   14.86 +# Enforce recompilation of package definition class if Mercurial working
   14.87 +# copy state changes. Together with --guessVersion it ensures that package
   14.88 +# definition class always contains correct binary revision string.
   14.89 +!IFDEF HGROOT
   14.90 +$(OUTDIR)ctu_ircompiler_tests.$(O): $(HGROOT)\.hg\dirstate
   14.91 +!ENDIF
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/tests/bmake.bat	Thu Oct 30 22:27:09 2014 +0000
    15.3 @@ -0,0 +1,12 @@
    15.4 +@REM -------
    15.5 +@REM make using Borland bcc32
    15.6 +@REM type bmake, and wait...
    15.7 +@REM do not edit - automatically generated from ProjectDefinition
    15.8 +@REM -------
    15.9 +@SET DEFINES=
   15.10 +@REM Kludge got Mercurial, cannot be implemented in Borland make
   15.11 +@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
   15.12 +@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
   15.13 +make.exe -N -f bc.mak  %DEFINES% %*
   15.14 +
   15.15 +
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/tests/ctu_ircompiler_tests.st	Thu Oct 30 22:27:09 2014 +0000
    16.3 @@ -0,0 +1,117 @@
    16.4 +"{ Package: 'ctu:ircompiler/tests' }"
    16.5 +
    16.6 +LibraryDefinition subclass:#ctu_ircompiler_tests
    16.7 +	instanceVariableNames:''
    16.8 +	classVariableNames:''
    16.9 +	poolDictionaries:''
   16.10 +	category:'* Projects & Packages *'
   16.11 +!
   16.12 +
   16.13 +
   16.14 +!ctu_ircompiler_tests class methodsFor:'description'!
   16.15 +
   16.16 +excludedFromPreRequisites
   16.17 +    "list packages which are to be explicitely excluded from the automatic constructed
   16.18 +     prerequisites list. If empty, everything that is found along the inheritance of any of
   16.19 +     my classes is considered to be a prerequisite package."
   16.20 +
   16.21 +    ^ #(
   16.22 +    )
   16.23 +!
   16.24 +
   16.25 +mandatoryPreRequisites
   16.26 +    "list packages which are mandatory as a prerequisite.
   16.27 +     This are packages containing superclasses of my classes and classes which
   16.28 +     are extended by myself.
   16.29 +     They are mandatory, because we need these packages as a prerequisite for loading and compiling.
   16.30 +     This method is generated automatically,
   16.31 +     by searching along the inheritance chain of all of my classes."
   16.32 +
   16.33 +    ^ #(
   16.34 +        #'stx:goodies/sunit'    "TestAsserter - superclass of IRBuilderTest"
   16.35 +        #'stx:libbasic'    "LibraryDefinition - superclass of ctu_ircompiler_tests"
   16.36 +    )
   16.37 +!
   16.38 +
   16.39 +referencedPreRequisites
   16.40 +    "list packages which are a prerequisite, because they contain
   16.41 +     classes which are referenced by my classes.
   16.42 +     We do not need these packages as a prerequisite for loading or compiling.
   16.43 +     This method is generated automatically,
   16.44 +     by searching all classes (and their packages) which are referenced by my classes."
   16.45 +
   16.46 +    ^ #(
   16.47 +        #'ctu:ircompiler'    "IRBuilder - referenced by IRBuilderTest>>testBlock_blockNesting_1"
   16.48 +    )
   16.49 +!
   16.50 +
   16.51 +subProjects
   16.52 +    "list packages which are known as subprojects.
   16.53 +     The generated makefile will enter those and make there as well.
   16.54 +     However: they are not forced to be loaded when a package is loaded;
   16.55 +     for those, redefine requiredPrerequisites."
   16.56 +
   16.57 +    ^ #(
   16.58 +    )
   16.59 +! !
   16.60 +
   16.61 +!ctu_ircompiler_tests class methodsFor:'description - contents'!
   16.62 +
   16.63 +classNamesAndAttributes
   16.64 +    "lists the classes which are to be included in the project.
   16.65 +     Each entry in the list may be: a single class-name (symbol),
   16.66 +     or an array-literal consisting of class name and attributes.
   16.67 +     Attributes are: #autoload or #<os> where os is one of win32, unix,..."
   16.68 +
   16.69 +    ^ #(
   16.70 +        "<className> or (<className> attributes...) in load order"
   16.71 +        IRBuilderTest
   16.72 +        IRTransformTest
   16.73 +        #'ctu_ircompiler_tests'
   16.74 +    )
   16.75 +!
   16.76 +
   16.77 +extensionMethodNames
   16.78 +    "list class/selector pairs of extensions.
   16.79 +     A correponding method with real names must be present in my concrete subclasses"
   16.80 +
   16.81 +    ^ #(
   16.82 +    )
   16.83 +! !
   16.84 +
   16.85 +!ctu_ircompiler_tests class methodsFor:'description - project information'!
   16.86 +
   16.87 +companyName
   16.88 +    "Returns a company string which will appear in <lib>.rc.
   16.89 +     Under win32, this is placed into the dlls file-info"
   16.90 +
   16.91 +    ^ 'My Company'
   16.92 +!
   16.93 +
   16.94 +description
   16.95 +    "Returns a description string which will appear in nt.def / bc.def"
   16.96 +
   16.97 +    ^ 'Class Library'
   16.98 +!
   16.99 +
  16.100 +legalCopyright
  16.101 +    "Returns a copyright string which will appear in <lib>.rc.
  16.102 +     Under win32, this is placed into the dlls file-info"
  16.103 +
  16.104 +    ^ 'My CopyRight or CopyLeft'
  16.105 +!
  16.106 +
  16.107 +productName
  16.108 +    "Returns a product name which will appear in <lib>.rc.
  16.109 +     Under win32, this is placed into the dlls file-info.
  16.110 +     This method is usually redefined in a concrete application definition"
  16.111 +
  16.112 +    ^ 'LibraryName'
  16.113 +! !
  16.114 +
  16.115 +!ctu_ircompiler_tests class methodsFor:'documentation'!
  16.116 +
  16.117 +version_HG
  16.118 +    ^ '$Changeset: <not expanded> $'
  16.119 +! !
  16.120 +
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/tests/lccmake.bat	Thu Oct 30 22:27:09 2014 +0000
    17.3 @@ -0,0 +1,8 @@
    17.4 +@REM -------
    17.5 +@REM make using lcc compiler
    17.6 +@REM type lccmake, and wait...
    17.7 +@REM do not edit - automatically generated from ProjectDefinition
    17.8 +@REM -------
    17.9 +make.exe -N -f bc.mak -DUSELCC=1 %*
   17.10 +
   17.11 +
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/tests/libInit.cc	Thu Oct 30 22:27:09 2014 +0000
    18.3 @@ -0,0 +1,36 @@
    18.4 +/*
    18.5 + * $Header$
    18.6 + *
    18.7 + * DO NOT EDIT
    18.8 + * automagically generated from the projectDefinition: ctu_ircompiler_tests.
    18.9 + */
   18.10 +#define __INDIRECTVMINITCALLS__
   18.11 +#include <stc.h>
   18.12 +
   18.13 +#ifdef WIN32
   18.14 +# pragma codeseg INITCODE "INITCODE"
   18.15 +#endif
   18.16 +
   18.17 +#if defined(INIT_TEXT_SECTION) || defined(DLL_EXPORT)
   18.18 +DLL_EXPORT void _libctu_ircompiler_tests_Init() INIT_TEXT_SECTION;
   18.19 +DLL_EXPORT void _libctu_ircompiler_tests_InitDefinition() INIT_TEXT_SECTION;
   18.20 +#endif
   18.21 +
   18.22 +void _libctu_ircompiler_tests_InitDefinition(pass, __pRT__, snd)
   18.23 +OBJ snd; struct __vmData__ *__pRT__; {
   18.24 +__BEGIN_PACKAGE2__("libctu_ircompiler_tests__DFN", _libctu_ircompiler_tests_InitDefinition, "ctu:ircompiler/tests");
   18.25 +_ctu_137ircompiler_137tests_Init(pass,__pRT__,snd);
   18.26 +
   18.27 +__END_PACKAGE__();
   18.28 +}
   18.29 +
   18.30 +void _libctu_ircompiler_tests_Init(pass, __pRT__, snd)
   18.31 +OBJ snd; struct __vmData__ *__pRT__; {
   18.32 +__BEGIN_PACKAGE2__("libctu_ircompiler_tests", _libctu_ircompiler_tests_Init, "ctu:ircompiler/tests");
   18.33 +_IRBuilderTest_Init(pass,__pRT__,snd);
   18.34 +_IRTransformTest_Init(pass,__pRT__,snd);
   18.35 +_ctu_137ircompiler_137tests_Init(pass,__pRT__,snd);
   18.36 +
   18.37 +
   18.38 +__END_PACKAGE__();
   18.39 +}
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/tests/mingwmake.bat	Thu Oct 30 22:27:09 2014 +0000
    19.3 @@ -0,0 +1,16 @@
    19.4 +@REM -------
    19.5 +@REM make using mingw gnu compiler
    19.6 +@REM type mingwmake, and wait...
    19.7 +@REM do not edit - automatically generated from ProjectDefinition
    19.8 +@REM -------
    19.9 +@SET DEFINES=
   19.10 +@REM Kludge got Mercurial, cannot be implemented in Borland make
   19.11 +@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
   19.12 +@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
   19.13 +
   19.14 +@pushd ..\..\..\stx\rules
   19.15 +@call find_mingw.bat
   19.16 +@popd
   19.17 +make.exe -N -f bc.mak %DEFINES% %USEMINGW_ARG% %*
   19.18 +
   19.19 +
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/tests/tests.rc	Thu Oct 30 22:27:09 2014 +0000
    20.3 @@ -0,0 +1,37 @@
    20.4 +//
    20.5 +// DO NOT EDIT
    20.6 +// automagically generated from the projectDefinition: ctu_ircompiler_tests.
    20.7 +//
    20.8 +VS_VERSION_INFO VERSIONINFO
    20.9 +  FILEVERSION     6,2,32767,32767
   20.10 +  PRODUCTVERSION  6,2,4,0
   20.11 +#if (__BORLANDC__)
   20.12 +  FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
   20.13 +  FILEFLAGS       VS_FF_PRERELEASE | VS_FF_SPECIALBUILD
   20.14 +  FILEOS          VOS_NT_WINDOWS32
   20.15 +  FILETYPE        VFT_DLL
   20.16 +  FILESUBTYPE     VS_USER_DEFINED
   20.17 +#endif
   20.18 +
   20.19 +BEGIN
   20.20 +  BLOCK "StringFileInfo"
   20.21 +  BEGIN
   20.22 +    BLOCK "040904E4"
   20.23 +    BEGIN
   20.24 +      VALUE "CompanyName", "My Company\0"
   20.25 +      VALUE "FileDescription", "Class Library (LIB)\0"
   20.26 +      VALUE "FileVersion", "6.2.32767.32767\0"
   20.27 +      VALUE "InternalName", "ctu:ircompiler/tests\0"
   20.28 +      VALUE "LegalCopyright", "My CopyRight or CopyLeft\0"
   20.29 +      VALUE "ProductName", "LibraryName\0"
   20.30 +      VALUE "ProductVersion", "6.2.4.0\0"
   20.31 +      VALUE "ProductDate", "Thu, 30 Oct 2014 22:24:51 GMT\0"
   20.32 +    END
   20.33 +
   20.34 +  END
   20.35 +
   20.36 +  BLOCK "VarFileInfo"
   20.37 +  BEGIN                               //  Language   |    Translation
   20.38 +    VALUE "Translation", 0x409, 0x4E4 // U.S. English, Windows Multilingual
   20.39 +  END
   20.40 +END
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/tests/vcmake.bat	Thu Oct 30 22:27:09 2014 +0000
    21.3 @@ -0,0 +1,20 @@
    21.4 +@REM -------
    21.5 +@REM make using Microsoft Visual C compiler
    21.6 +@REM type vcmake, and wait...
    21.7 +@REM do not edit - automatically generated from ProjectDefinition
    21.8 +@REM -------
    21.9 +
   21.10 +@if not defined VSINSTALLDIR (
   21.11 +    pushd ..\..\..\stx\rules
   21.12 +    call vcsetup.bat
   21.13 +    popd
   21.14 +)
   21.15 +@SET DEFINES=
   21.16 +@REM Kludge got Mercurial, cannot be implemented in Borland make
   21.17 +@FOR /F "tokens=*" %%i in ('hg root') do SET HGROOT=%%i
   21.18 +@IF "%HGROOT%" NEQ "" SET DEFINES=%DEFINES% "-DHGROOT=%HGROOT%"
   21.19 +make.exe -N -f bc.mak -DUSEVC=1 %DEFINES% %*
   21.20 +
   21.21 +
   21.22 +
   21.23 +