1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00
llvm-mirror/test/MC/BPF/load-store-32.s
Yonghong Song 8b3e71f73b bpf: New disassembler testcases for 32-bit subregister support
This patch test disassembler output for load/store instructions when
-mattr=+alu32 specified for which we want to use "w" register format.

Also, this patch extended the existing insn-unit.s and insn-unit-32.s to
make sure disassemblers for all other instructions are not affected.

Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325993
2018-02-23 23:49:35 +00:00

26 lines
1.2 KiB
ArmAsm

# RUN: llvm-mc -triple bpfel -filetype=obj -o %t %s
# RUN: llvm-objdump -mattr=+alu32 -d -r %t | FileCheck --check-prefix=CHECK-32 %s
# RUN: llvm-objdump -d -r %t | FileCheck %s
// ======== BPF_LDX Class ========
w5 = *(u8 *)(r0 + 0) // BPF_LDX | BPF_B
w6 = *(u16 *)(r1 + 8) // BPF_LDX | BPF_H
w7 = *(u32 *)(r2 + 16) // BPF_LDX | BPF_W
// CHECK-32: 71 05 00 00 00 00 00 00 w5 = *(u8 *)(r0 + 0)
// CHECK-32: 69 16 08 00 00 00 00 00 w6 = *(u16 *)(r1 + 8)
// CHECK-32: 61 27 10 00 00 00 00 00 w7 = *(u32 *)(r2 + 16)
// CHECK: 71 05 00 00 00 00 00 00 r5 = *(u8 *)(r0 + 0)
// CHECK: 69 16 08 00 00 00 00 00 r6 = *(u16 *)(r1 + 8)
// CHECK: 61 27 10 00 00 00 00 00 r7 = *(u32 *)(r2 + 16)
// ======== BPF_STX Class ========
*(u8 *)(r0 + 0) = w7 // BPF_STX | BPF_B
*(u16 *)(r1 + 8) = w8 // BPF_STX | BPF_H
*(u32 *)(r2 + 16) = w9 // BPF_STX | BPF_W
// CHECK-32: 73 70 00 00 00 00 00 00 *(u8 *)(r0 + 0) = w7
// CHECK-32: 6b 81 08 00 00 00 00 00 *(u16 *)(r1 + 8) = w8
// CHECK-32: 63 92 10 00 00 00 00 00 *(u32 *)(r2 + 16) = w9
// CHECK: 73 70 00 00 00 00 00 00 *(u8 *)(r0 + 0) = r7
// CHECK: 6b 81 08 00 00 00 00 00 *(u16 *)(r1 + 8) = r8
// CHECK: 63 92 10 00 00 00 00 00 *(u32 *)(r2 + 16) = r9