--- a/IRBuilderTest.st Tue Mar 23 13:38:08 2010 +0000
+++ b/IRBuilderTest.st Wed Mar 24 07:50:55 2010 +0000
@@ -788,7 +788,7 @@
returnTop
];
pushLiteral: 22;
- send:#value;
+ send:#value:;
returnTop;
ir.
"
@@ -800,6 +800,52 @@
self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = 22).
"Created: / 11-05-2009 / 23:04:13 / Jan Vrany <vranyj1@fel.cvut.cz>"
+ "Modified: / 23-03-2010 / 21:47:41 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+testBlock_blockNesting_2
+ |aCompiledMethod irBuilder|
+
+ irBuilder := (IRBuilder new)
+ numRargs:1;
+ addTemps:#( #self );
+ pushBlockUsingBuilder:[:builder |
+ builder
+ numRargs:1;
+ addTemps:#( #barg1 );
+ pushBlockUsingBuilder:[:builder|
+ builder
+ numRargs: 1;
+ addTemps: #( #barg2 );
+ pushTemp: #barg2;
+ returnTop
+ ];
+ pushTemp: #barg1;
+ send: #value:;
+ pushBlockUsingBuilder:[:builder|
+ builder
+ numRargs: 1;
+ addTemps: #( #barg2 );
+ pushLiteral: -1;
+ returnTop
+ ];
+ pushTemp: #barg1;
+ send: #value:;
+ returnTop
+ ];
+ pushLiteral: 22;
+ send:#value:;
+ returnTop;
+ ir.
+ "
+ irBuilder ir
+ "
+
+ aCompiledMethod := irBuilder compiledCode.
+ self assert:(aCompiledMethod isKindOf:CompiledMethod).
+ self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = -1).
+
+ "Created: / 23-03-2010 / 21:43:49 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!
testBlock_blockTempArg