Ejemplo n.º 1
0
 public void CreateDelegateTest()
 {
     var CpuThreadState = new CpuThreadState();
     var CompilerState = new CompilerState();
     CpuThreadState.r1 = 1000000000000000000;
     CompilerState.SaveGpr(0, () =>
     {
         CompilerState.LoadGpr(1);
         CompilerState.LoadImm(999);
         CompilerState.Emit(OpCodes.Add);
     });
     CompilerState.Ret();
     CompilerState.CreateDelegate()(CpuThreadState);
     Assert.AreEqual(1000000000000000999, CpuThreadState.r0);
 }