Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. # See LICENSE for license details.
  2.  
  3. #*****************************************************************************
  4. # yourinst.S
  5. #-----------------------------------------------------------------------------
  6. #
  7. # This is the most basic self checking test. If your simulator does not
  8. # pass thiss then there is little chance that it will pass any of the
  9. # more complicated self checking tests.
  10. #
  11.  
  12. #include "riscv_test.h"
  13. #include "test_macros.h"
  14.  
  15. #define TEST_STRCHR( testnum, result, init, chr ) \
  16. TEST_CASE( testnum, x1, result, \
  17. li x1, MASK_XLEN(init); \
  18. li x2, MASK_XLEN(0xDEADBEEF); \
  19.  
  20. li x6, MASK_XLEN(99); \
  21. sw x6, x2 \
  22.  
  23. li x6, MASK_XLEN(97) \
  24. sw x6, 4(x2) \
  25.  
  26. li x6, MASK_XLEN(116) \
  27. sw x6, 8(x2) \
  28.  
  29. li x6, MASK_XLEN(97) \
  30. sw x6, 12(x2) \
  31.  
  32. li x6, MASK_XLEN(0) \
  33. sw x6, 16(x2) \
  34.  
  35. li x3, MASK_XLEN(chr); \
  36. .word 0x3100EB)
  37.  
  38. RVTEST_RV64U
  39. RVTEST_CODE_BEGIN
  40.  
  41. # FIXME: Add your tests here
  42. # See the tests in movn.S for examples
  43.  
  44. // TEST_STRCHR
  45. TEST_STRCHR(2, 0xDEADBEEF + 4, 0, 'a')
  46. TEST_PASSFAIL
  47.  
  48. RVTEST_CODE_END
  49. 1,1 Top
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement