test_cases:
  -
    input:
      bytes: [ 0x00, 0x10, 0x00, 0x00 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ld %r0, [%r0,0]"

  -
    input:
      bytes: [ 0x00, 0x10, 0x00, 0x01 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ldh %r0, [%r0,0]"

  -
    input:
      bytes: [ 0x00, 0x10, 0x80, 0x00 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ldb %r0, [%r0,0]"

  -
    input:
      bytes: [ 0x0c, 0x10, 0x01, 0x00 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ld %r1, [%r0,12]"

  -
    input:
      bytes: [ 0xf4, 0x13, 0x0e, 0xb0 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ld %r14, [%fp,-12]"

  -
    input:
      bytes: [ 0xf4, 0x10, 0x03, 0x80 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ld %r3, [%r0,-12]"

  -
    input:
      bytes: [ 0xf4, 0x10, 0x00, 0x00 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ld %r0, [%r0,244]"

  -
    input:
      bytes: [ 0xf4, 0x10, 0x00, 0x80 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ld %r0, [%r0,-12]"

  -
    input:
      bytes: [ 0x00, 0x11, 0x43, 0x01 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ldh.x %r3, [%r1,0]"

  -
    input:
      bytes: [ 0x02, 0x11, 0x42, 0x01 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ldh.x %r2, [%r1,2]"

  -
    input:
      bytes: [ 0x7c, 0x13, 0x42, 0xb1 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ldh.x %r2, [%fp,-132]"

  -
    input:
      bytes: [ 0x30, 0x20, 0x80, 0x0f, 0x00, 0x00, 0x00, 0xfa ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ld %r0, [%r0,64000]"

  -
    input:
      bytes: [ 0x00, 0x16, 0x06, 0x70, 0x00, 0x00, 0xb0, 0xf9 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ld %r6, [63920]"

  -
    input:
      bytes: [ 0x23, 0x1c, 0x82, 0x30 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "stb %r2, [%sp,35]"

  -
    input:
      bytes: [ 0x00, 0x1e, 0xc0, 0x71, 0x00, 0x00, 0xb0, 0xf9 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "st %r7, [63920]"

  -
    input:
      bytes: [ 0x01, 0x10, 0x81, 0x04 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ldb.ab %r1, [%r0,1]"

  -
    input:
      bytes: [ 0x01, 0x18, 0x92, 0x00 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "stb.ab %r2, [%r0,1]"

  -
    input:
      bytes: [ 0x0C, 0x10, 0x03, 0x05 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ldh.ab %r3, [%r0,12]"

  -
    input:
      bytes: [ 0x12, 0x18, 0x14, 0x01 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "sth.ab %r4, [%r0,18]"

  -
    input:
      bytes: [ 0x80, 0x12, 0x05, 0x04 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ld.ab %r5, [%r2,128]"

  -
    input:
      bytes: [ 0x40, 0x1A, 0x90, 0x01 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "st.ab %r6, [%r2,64]"

  -
    input:
      bytes: [ 0x01, 0x10, 0x87, 0x02 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ldb.aw %r7, [%r0,1]"

  -
    input:
      bytes: [ 0x01, 0x18, 0x0A, 0x02 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "stb.aw %r8, [%r0,1]"

  -
    input:
      bytes: [ 0x0C, 0x10, 0x03, 0x03 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ldh.aw %r3, [%r0,12]"

  -
    input:
      bytes: [ 0x12, 0x18, 0xCC, 0x00 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "sth.aw %r3, [%r0,18]"

  -
    input:
      bytes: [ 0x80, 0x12, 0x06, 0x02 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ld.aw %r6, [%r2,128]"

  -
    input:
      bytes: [ 0x40, 0x1A, 0x88, 0x01 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "st.aw %r6, [%r2,64]"

  -
    input:
      bytes: [ 0x08, 0x10, 0xC0, 0x1A ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "ldb.x.di.aw %r0, [%r8,8]"

  -
    input:
      bytes: [ 0x40, 0x19, 0x32, 0x10 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "stb.di.ab %r0, [%r9,64]"

  -
    input:
      bytes: [ 0x6a, 0x20, 0x40, 0x08 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "lr %r0, [33]"

  -
    input:
      bytes: [ 0x6a, 0x27, 0x40, 0x08 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "lr %r7, [33]"

  -
    input:
      bytes: [ 0x6a, 0x27, 0x40, 0x18 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "lr %r15, [33]"

  -
    input:
      bytes: [ 0x6a, 0x26, 0x40, 0x28 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "lr %r22, [33]"

  -
    input:
      bytes: [ 0xaa, 0x20, 0x60, 0x08 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "lr %r0, [-33]"

  -
    input:
      bytes: [ 0xaa, 0x20, 0x41, 0x08 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "lr %r0, [97]"

  -
    input:
      bytes: [ 0xaa, 0x20, 0x61, 0x08 ]
      arch: "CS_ARCH_ARC"
      options: [ "CS_MODE_LITTLE_ENDIAN" ]
    expected:
      insns:
        -
          asm_text: "lr %r0, [-97]"
