[llvm] c15ae0a - [RISCV][NFC] Add RV64Zbs invalid tests

Ben Shi via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 26 18:42:44 PDT 2022


Author: Ping Deng
Date: 2022-04-27T09:42:32+08:00
New Revision: c15ae0a37dda4a776d974dbe5360707163e34bda

URL: https://github.com/llvm/llvm-project/commit/c15ae0a37dda4a776d974dbe5360707163e34bda
DIFF: https://github.com/llvm/llvm-project/commit/c15ae0a37dda4a776d974dbe5360707163e34bda.diff

LOG: [RISCV][NFC] Add RV64Zbs invalid tests

Add a new test rv64zbs-invalid.s along with the aleady
existing rv32zbs-invalid.s.

Reviewed By: craig.topper, asb

Differential Revision: https://reviews.llvm.org/D124428

Added: 
    llvm/test/MC/RISCV/rv64zbs-invalid.s

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/MC/RISCV/rv64zbs-invalid.s b/llvm/test/MC/RISCV/rv64zbs-invalid.s
new file mode 100644
index 0000000000000..2fa40ffc90c33
--- /dev/null
+++ b/llvm/test/MC/RISCV/rv64zbs-invalid.s
@@ -0,0 +1,30 @@
+# RUN: not llvm-mc -triple riscv64 -mattr=+zbs < %s 2>&1 | FileCheck %s
+
+# Too few operands
+bclr t0, t1 # CHECK: :[[@LINE]]:1: error: too few operands for instruction
+# Too few operands
+bset t0, t1 # CHECK: :[[@LINE]]:1: error: too few operands for instruction
+# Too few operands
+binv t0, t1 # CHECK: :[[@LINE]]:1: error: too few operands for instruction
+# Too few operands
+bext t0, t1 # CHECK: :[[@LINE]]:1: error: too few operands for instruction
+# Too few operands
+bclri t0, t1 # CHECK: :[[@LINE]]:1: error: too few operands for instruction
+# Immediate operand out of range
+bclri t0, t1, 64 # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 63]
+bclri t0, t1, -1 # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 63]
+# Too few operands
+bseti t0, t1 # CHECK: :[[@LINE]]:1: error: too few operands for instruction
+# Immediate operand out of range
+bseti t0, t1, 64 # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 63]
+bseti t0, t1, -1 # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 63]
+# Too few operands
+binvi t0, t1 # CHECK: :[[@LINE]]:1: error: too few operands for instruction
+# Immediate operand out of range
+binvi t0, t1, 64 # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 63]
+binvi t0, t1, -1 # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 63]
+# Too few operands
+bexti t0, t1 # CHECK: :[[@LINE]]:1: error: too few operands for instruction
+# Immediate operand out of range
+bexti t0, t1, 64 # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 63]
+bexti t0, t1, -1 # CHECK: :[[@LINE]]:15: error: immediate must be an integer in the range [0, 63]


        


More information about the llvm-commits mailing list