@@ -1605,7 +1605,7 @@ contract MIPS_Test is CommonTest {
16051605        assertEq (postState, outputState (expect), "unexpected post state " );
16061606    }
16071607
1608-     function test_fcntl_succeeds   () external  {
1608+     function test_fcntl_getfl_succeeds   () external  {
16091609        uint32  insn =  0x0000000c ; // syscall 
16101610        (MIPS.State memory  state , bytes  memory  proof ) =  constructMIPSState (0 , insn, 0x4 , 0 );
16111611        state.registers[2 ] =  4055 ; // fcntl syscall 
@@ -1631,6 +1631,25 @@ contract MIPS_Test is CommonTest {
16311631        assertEq (postState, outputState (expect), "unexpected post state " );
16321632    }
16331633
1634+     function test_fcntl_getfd_succeeds  () external  {
1635+         uint32  insn =  0x0000000c ; // syscall 
1636+         (MIPS.State memory  state , bytes  memory  proof ) =  constructMIPSState (0 , insn, 0x4 , 0 );
1637+         state.registers[2 ] =  4055 ; // fcntl syscall 
1638+         state.registers[4 ] =  0x0 ; // a0 
1639+         state.registers[5 ] =  0x1 ; // a1 
1640+ 
1641+         MIPS.State memory  expect;
1642+         expect.memRoot =  state.memRoot;
1643+         expect.pc =  state.nextPC;
1644+         expect.nextPC =  state.nextPC +  4 ;
1645+         expect.step =  state.step +  1 ;
1646+         expect.registers[2 ] =  0 ;
1647+         expect.registers[5 ] =  state.registers[5 ];
1648+ 
1649+         bytes32  postState =  mips.step (encodeState (state), proof, 0 );
1650+         assertEq (postState, outputState (expect), "unexpected post state " );
1651+     }
1652+ 
16341653    function test_prestate_exited_succeeds  () external  {
16351654        uint32  insn =  0x0000000c ; // syscall 
16361655        (MIPS.State memory  state , bytes  memory  proof ) =  constructMIPSState (0 , insn, 0x4 , 0 );
0 commit comments