|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_mc_test_checks.py UTC_ARGS: --llvm-mc-binary bin/llvm-mc --version 5 |
| 2 | +# RUN: llvm-mc -triple riscv32 -mattr=+c -assemble -riscv-no-aliases -show-encoding < %s | FileCheck %s --check-prefix=ENABLED |
| 3 | +# RUN: llvm-mc -triple riscv32 -mattr=+c -assemble -riscv-no-aliases -show-encoding -riscv-disable-inline-asm-compress < %s | FileCheck %s --check-prefix=DISABLED |
| 4 | + |
| 5 | + addi sp, sp, -16 |
| 6 | +// ENABLED: c.addi sp, -16 # encoding: [0x41,0x11] |
| 7 | +// DISABLED: addi sp, sp, -16 # encoding: [0x13,0x01,0x01,0xff] |
| 8 | + sw ra, 12(sp) |
| 9 | +// ENABLED: c.swsp ra, 12(sp) # encoding: [0x06,0xc6] |
| 10 | +// DISABLED: sw ra, 12(sp) # encoding: [0x23,0x26,0x11,0x00] |
| 11 | + sw s0, 8(sp) |
| 12 | +// ENABLED: c.swsp s0, 8(sp) # encoding: [0x22,0xc4] |
| 13 | +// DISABLED: sw s0, 8(sp) # encoding: [0x23,0x24,0x81,0x00] |
| 14 | + addi s0, sp, 16 |
| 15 | +// ENABLED: c.addi4spn s0, sp, 16 # encoding: [0x00,0x08] |
| 16 | +// DISABLED: addi s0, sp, 16 # encoding: [0x13,0x04,0x01,0x01] |
| 17 | + li a0, 0 |
| 18 | +// ENABLED: c.li a0, 0 # encoding: [0x01,0x45] |
| 19 | +// DISABLED: addi a0, zero, 0 # encoding: [0x13,0x05,0x00,0x00] |
| 20 | + sw a0, -12(s0) |
| 21 | +// ENABLED: sw a0, -12(s0) # encoding: [0x23,0x2a,0xa4,0xfe] |
| 22 | +// DISABLED: sw a0, -12(s0) # encoding: [0x23,0x2a,0xa4,0xfe] |
| 23 | + lw ra, 12(sp) |
| 24 | +// ENABLED: c.lwsp ra, 12(sp) # encoding: [0xb2,0x40] |
| 25 | +// DISABLED: lw ra, 12(sp) # encoding: [0x83,0x20,0xc1,0x00] |
| 26 | + lw s0, 8(sp) |
| 27 | +// ENABLED: c.lwsp s0, 8(sp) # encoding: [0x22,0x44] |
| 28 | +// DISABLED: lw s0, 8(sp) # encoding: [0x03,0x24,0x81,0x00] |
| 29 | + addi sp, sp, 16 |
| 30 | +// ENABLED: c.addi sp, 16 # encoding: [0x41,0x01] |
| 31 | +// DISABLED: addi sp, sp, 16 # encoding: [0x13,0x01,0x01,0x01] |
| 32 | + ret |
| 33 | +// ENABLED: c.jr ra # encoding: [0x82,0x80] |
| 34 | +// DISABLED: jalr zero, 0(ra) # encoding: [0x67,0x80,0x00,0x00] |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
0 commit comments