diff -r ec41dca68283 -r ce82ecc2ca57 c1/DragonFly__C1BackendTests.st --- a/c1/DragonFly__C1BackendTests.st Wed Aug 10 22:35:23 2016 +0100 +++ b/c1/DragonFly__C1BackendTests.st Sun Aug 07 21:52:39 2016 +0100 @@ -113,6 +113,40 @@ "Created: / 24-06-2016 / 00:11:10 / Jan Vrany " "Modified: / 25-07-2016 / 19:01:27 / Jan Vrany " +! + +test_thisContext_02 + | method compiler ctx | + + method := JavaMethod new. + method numberOfArgs:0. + method numberOfVars:0. + method stackSize:0. + method setAccessFlags: JavaConstants ACC_PUBLIC. + compiler := C1CompilerBackend new. + compiler method:method. + compiler prepare. + compiler emitPrologue. + compiler emitReturn:(compiler + emitSend:#returnSenderContext + to:(compiler loadLiteral:self) + with:#()). + compiler emitEpilogue. + compiler finish. + self assert:method code notNil. + ctx := method + valueWithReceiver:self + arguments:#() + selector:testSelector. + self assert:ctx isJavaContext. + self assert:ctx receiver == self. + self assert:ctx selector == testSelector. + self assert:ctx method == method. + self assert:ctx numArgs == 0. + self assert:ctx numVars == 0. + self assert:ctx numTemps == 0. + + "Created: / 07-08-2016 / 21:53:31 / Jan Vrany " ! ! !C1BackendTests methodsFor:'tests - building blocks'!