1# RUN: llvm-mc -triple riscv32 -show-encoding < %s \ 2# RUN: | FileCheck -check-prefixes=CHECK,CHECK-ALIAS %s 3# RUN: llvm-mc -triple riscv32 -show-encoding \ 4# RUN: -riscv-no-aliases <%s | FileCheck -check-prefixes=CHECK,CHECK-INST %s 5# RUN: llvm-mc -triple riscv32 -filetype=obj < %s \ 6# RUN: | llvm-objdump --triple=riscv32 --mattr=+c -d - \ 7# RUN: | FileCheck -check-prefixes=CHECK-BYTES,CHECK-ALIAS %s 8# RUN: llvm-mc -triple riscv32 -filetype=obj < %s \ 9# RUN: | llvm-objdump --triple=riscv32 --mattr=+c -d -M no-aliases - \ 10# RUN: | FileCheck -check-prefixes=CHECK-BYTES,CHECK-INST %s 11 12# RUN: llvm-mc -triple riscv64 -show-encoding < %s \ 13# RUN: | FileCheck -check-prefixes=CHECK-ALIAS %s 14# RUN: llvm-mc -triple riscv64 -show-encoding \ 15# RUN: -riscv-no-aliases <%s | FileCheck -check-prefixes=CHECK-INST %s 16# RUN: llvm-mc -triple riscv64 -filetype=obj < %s \ 17# RUN: | llvm-objdump --triple=riscv64 --mattr=+c -d - \ 18# RUN: | FileCheck -check-prefixes=CHECK-BYTES,CHECK-ALIAS %s 19# RUN: llvm-mc -triple riscv64 -filetype=obj < %s \ 20# RUN: | llvm-objdump --triple=riscv64 --mattr=+c -d -M no-aliases - \ 21# RUN: | FileCheck -check-prefixes=CHECK-BYTES,CHECK-INST %s 22 23# CHECK-BYTES: 13 85 05 00 24# CHECK-ALIAS: mv a0, a1 25# CHECK-INST: addi a0, a1, 0 26# CHECK: # encoding: [0x13,0x85,0x05,0x00] 27addi a0, a1, 0 28 29# CHECK-BYTES: 13 04 c1 3f 30# CHECK-ALIAS: addi s0, sp, 1020 31# CHECK-INST: addi s0, sp, 1020 32# CHECK: # encoding: [0x13,0x04,0xc1,0x3f] 33addi s0, sp, 1020 34 35 36# CHECK: .option rvc 37.option rvc 38# CHECK-BYTES: 2e 85 39# CHECK-ALIAS: add a0, zero, a1 40# CHECK-INST: c.mv a0, a1 41# CHECK: # encoding: [0x2e,0x85] 42addi a0, a1, 0 43 44# CHECK-BYTES: e0 1f 45# CHECK-ALIAS: addi s0, sp, 1020 46# CHECK-INST: c.addi4spn s0, sp, 1020 47# CHECK: # encoding: [0xe0,0x1f] 48addi s0, sp, 1020 49 50# CHECK: .option norvc 51.option norvc 52# CHECK-BYTES: 13 85 05 00 53# CHECK-ALIAS: mv a0, a1 54# CHECK-INST: addi a0, a1, 0 55# CHECK: # encoding: [0x13,0x85,0x05,0x00] 56addi a0, a1, 0 57 58# CHECK-BYTES: 13 04 c1 3f 59# CHECK-ALIAS: addi s0, sp, 1020 60# CHECK-INST: addi s0, sp, 1020 61# CHECK: # encoding: [0x13,0x04,0xc1,0x3f] 62addi s0, sp, 1020 63 64# CHECK: .option rvc 65.option rvc 66# CHECK-BYTES: 2e 85 67# CHECK-ALIAS: add a0, zero, a1 68# CHECK-INST: c.mv a0, a1 69# CHECK: # encoding: [0x2e,0x85] 70addi a0, a1, 0 71 72# CHECK-BYTES: e0 1f 73# CHECK-ALIAS: addi s0, sp, 1020 74# CHECK-INST: c.addi4spn s0, sp, 1020 75# CHECK: # encoding: [0xe0,0x1f] 76addi s0, sp, 1020 77 78# CHECK: .option norvc 79.option norvc 80# CHECK-BYTES: 13 85 05 00 81# CHECK-ALIAS: mv a0, a1 82# CHECK-INST: addi a0, a1, 0 83# CHECK: # encoding: [0x13,0x85,0x05,0x00] 84addi a0, a1, 0 85 86# CHECK-BYTES: 13 04 c1 3f 87# CHECK-ALIAS: addi s0, sp, 1020 88# CHECK-INST: addi s0, sp, 1020 89# CHECK: # encoding: [0x13,0x04,0xc1,0x3f] 90addi s0, sp, 1020 91