Skip to content

Commit 130a4c5

Browse files
committed
fixup! Add new assembler/disassembler test files
1 parent f22a5cd commit 130a4c5

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

llvm/test/MC/RISCV/xsifive-invalid.s

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# RUN: not llvm-mc -triple riscv32 < %s 2>&1 | FileCheck %s
2+
# RUN: not llvm-mc -triple riscv64 < %s 2>&1 | FileCheck %s
3+
4+
cflush.d.l1 x0 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'XSiFivecflushdlone' (SiFive cflush.d.l1 Instruction){{$}}
5+
6+
cflush.d.l1 x7 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'XSiFivecflushdlone' (SiFive cflush.d.l1 Instruction){{$}}
7+
8+
cdiscard.d.l1 x0 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'XSiFivecdiscarddlone' (SiFive cdiscard.d.l1 Instruction){{$}}
9+
10+
cdiscard.d.l1 x7 # CHECK: :[[@LINE]]:1: error: instruction requires the following: 'XSiFivecdiscarddlone' (SiFive cdiscard.d.l1 Instruction){{$}}

llvm/test/MC/RISCV/xsifive-valid.s

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# RUN: llvm-mc %s -triple=riscv32 -mattr=+xsifivecdiscarddlone,+xsifivecflushdlone -riscv-no-aliases -show-encoding \
2+
# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s
3+
# RUN: llvm-mc %s -triple=riscv64 -mattr=+xsifivecdiscarddlone,+xsifivecflushdlone -riscv-no-aliases -show-encoding \
4+
# RUN: | FileCheck -check-prefixes=CHECK-ENC,CHECK-INST %s
5+
# RUN: llvm-mc -filetype=obj -triple riscv32 -mattr=+xsifivecdiscarddlone,+xsifivecflushdlone < %s \
6+
# RUN: | llvm-objdump --mattr=+xsifivecdiscarddlone,+xsifivecflushdlone -M no-aliases -d - \
7+
# RUN: | FileCheck -check-prefix=CHECK-INST %s
8+
# RUN: llvm-mc -filetype=obj -triple riscv64 -mattr=+xsifivecdiscarddlone,+xsifivecflushdlone < %s \
9+
# RUN: | llvm-objdump --mattr=+xsifivecdiscarddlone,+xsifivecflushdlone -M no-aliases -d - \
10+
# RUN: | FileCheck -check-prefix=CHECK-INST %s
11+
12+
# CHECK-INST: cflush.d.l1 zero
13+
# CHECK-ENC: encoding: [0x73,0x00,0x00,0xfc]
14+
cflush.d.l1 x0
15+
16+
# CHECK-INST: cflush.d.l1 t2
17+
# CHECK-ENC: encoding: [0x73,0x80,0x03,0xfc]
18+
cflush.d.l1 x7
19+
20+
# CHECK-INST: cdiscard.d.l1 zero
21+
# CHECK-ENC: encoding: [0x73,0x00,0x20,0xfc]
22+
cdiscard.d.l1 x0
23+
24+
# CHECK-INST: cdiscard.d.l1 t2
25+
# CHECK-ENC: encoding: [0x73,0x80,0x23,0xfc]
26+
cdiscard.d.l1 x7

0 commit comments

Comments
 (0)