aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/Disassembler
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2011-04-07 19:28:58 +0000
committerJohnny Chen <johnny.chen@apple.com>2011-04-07 19:28:58 +0000
commit22dc4d9f59213c51cefe4fe237030c91d92d388b (patch)
treee6f812e2186990d7344211b39c091931c4e2647e /test/MC/Disassembler
parent8dbda0b51b7a7a7b4fb16a34b421a658cb86f9f3 (diff)
downloadexternal_llvm-22dc4d9f59213c51cefe4fe237030c91d92d388b.zip
external_llvm-22dc4d9f59213c51cefe4fe237030c91d92d388b.tar.gz
external_llvm-22dc4d9f59213c51cefe4fe237030c91d92d388b.tar.bz2
Add sanity checking for invalid register encodings for signed/unsigned extend instructions.
Add some test cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129098 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/Disassembler')
-rw-r--r--test/MC/Disassembler/ARM/arm-tests.txt6
-rw-r--r--test/MC/Disassembler/ARM/invalid-SXTB-arm.txt11
2 files changed, 17 insertions, 0 deletions
diff --git a/test/MC/Disassembler/ARM/arm-tests.txt b/test/MC/Disassembler/ARM/arm-tests.txt
index a044b0d..3bed28e 100644
--- a/test/MC/Disassembler/ARM/arm-tests.txt
+++ b/test/MC/Disassembler/ARM/arm-tests.txt
@@ -248,3 +248,9 @@
# CHECK: lsl r3, r2, r1
0x12 0x31 0xa0 0xe1
+
+# CHECK: sxtab r9, r8, r5
+0x75 0x90 0xa8 0xe6
+
+# CHECK: sxtb r9, r5, ror #8
+0x75 0x94 0xaf 0xe6
diff --git a/test/MC/Disassembler/ARM/invalid-SXTB-arm.txt b/test/MC/Disassembler/ARM/invalid-SXTB-arm.txt
new file mode 100644
index 0000000..4ec681d
--- /dev/null
+++ b/test/MC/Disassembler/ARM/invalid-SXTB-arm.txt
@@ -0,0 +1,11 @@
+# RUN: llvm-mc --disassemble %s -triple=arm-apple-darwin9 |& grep {invalid instruction encoding}
+
+# Opcode=390 Name=SXTBr_rot Format=ARM_FORMAT_EXTFRM(14)
+# 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
+# -------------------------------------------------------------------------------------------------
+# | 1: 1: 1: 0| 0: 1: 1: 0| 1: 0: 1: 0| 1: 1: 1: 1| 1: 1: 1: 1| 0: 1: 0: 0| 0: 1: 1: 1| 0: 1: 0: 1|
+# -------------------------------------------------------------------------------------------------
+#
+# A8.6.223 SXTB
+# if d == 15 || m == 15 then UNPREDICTABLE;
+0x75 0xf4 0xaf 0xe6