added test for exception handling (only returnTop)
authorkarpij1
Tue, 28 Apr 2009 15:03:39 +0000
changeset 15 4daeb5471d43
parent 14 9369d251b3ed
child 16 f325defc9c7e
added test for exception handling (only returnTop)
IRBuilderTest.st
--- a/IRBuilderTest.st	Tue Apr 28 11:23:26 2009 +0000
+++ b/IRBuilderTest.st	Tue Apr 28 15:03:39 2009 +0000
@@ -834,6 +834,42 @@
     "Created: / 28-04-2009 / 13:10:13 / karpij1 <karpij1@fel.cvut.cz>"
 !
 
+testBlock_exteptionHandler_noRemoteReturn
+    |aCompiledMethod irBuilder|
+
+    irBuilder := (IRBuilder new)
+                numRargs:1;
+                addTemps:#( #self);
+               pushBlockUsingBuilder:[:builder | 
+                        builder
+                            numRargs:0;  
+                            pushLiteral: 1;
+                            pushLiteral: 0;
+                            send: #/;
+                            pushLiteral: false;
+                            returnTop
+                    ];
+                pushLiteralVariable: #Error;
+                pushBlockUsingBuilder:[:builder|
+                    builder
+                        numRargs:0;
+                        pushLiteral: true;
+                        returnTop];
+                send: #on:do:;
+                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:39:01 / karpij1 <karpij1@fel.cvut.cz>"
+!
+
 testBlock_methodTempVar
     |aCompiledMethod irBuilder|