testcase demonstrating invalid push order when working with blocks
authorkarpij1
Tue, 28 Apr 2009 11:23:26 +0000
changeset 14 9369d251b3ed
parent 13 c7503f2d7d36
child 15 4daeb5471d43
testcase demonstrating invalid push order when working with blocks
IRBuilderTest.st
--- a/IRBuilderTest.st	Sun Apr 26 11:22:39 2009 +0000
+++ b/IRBuilderTest.st	Tue Apr 28 11:23:26 2009 +0000
@@ -797,6 +797,43 @@
     "Created: / 30-03-2009 / 23:03:48 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
+testBlock_exteptionHandler
+    |aCompiledMethod irBuilder|
+
+    irBuilder := (IRBuilder new)
+                numRargs:1;
+                addTemps:#( #self);
+               pushBlockUsingBuilder:[:builder | 
+                        builder
+                            numRargs:0;  
+                            pushLiteral: 1;
+                            pushLiteral: 0;
+                            send: #/;
+                            pushLiteral: false;
+                            remoteReturn
+                    ];
+                pushLiteralVariable: #Error;
+                pushBlockUsingBuilder:[:builder|
+                    builder
+                        numRargs:0;
+                        pushLiteral: true;
+                        remoteReturn];
+                send: #on:do:;
+                pushLiteral: false;
+                returnTop;
+                ir.
+    "
+        irBuilder ir
+    "
+
+    aCompiledMethod := irBuilder compiledCode.
+    self assert:(aCompiledMethod isKindOf:CompiledMethod).
+    self assert:((aCompiledMethod valueWithReceiver:1 arguments:#()) = true).
+
+    "Modified: / 01-04-2009 / 19:43:52 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Created: / 28-04-2009 / 13:10:13 / karpij1 <karpij1@fel.cvut.cz>"
+!
+
 testBlock_methodTempVar
     |aCompiledMethod irBuilder|