aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-12-14 16:38:23 +0000
committerNick Clifton <nickc@redhat.com>2009-12-14 16:38:23 +0000
commitab8e2090b6435823d50b29b7a255140ba6ea673f (patch)
treefd2a35f2fa357aa6f8946ad0d232153df08b6e01 /gas
parent874f57650c1c8be126f9f637fc6cd09af7b3ade8 (diff)
downloadgdb-ab8e2090b6435823d50b29b7a255140ba6ea673f.zip
gdb-ab8e2090b6435823d50b29b7a255140ba6ea673f.tar.gz
gdb-ab8e2090b6435823d50b29b7a255140ba6ea673f.tar.bz2
PR binutils/10924
* arm-dis.c (arm_opcodes): Specify %R in cases where using r15 results in unpredictable behaviour. (print_insn_arm): Handle %R. * gas/arm/unpredictable.s: New test case - checks the disassembly of instructions with unpredictable behaviour. * gas/arm/unpredictable.d: New file - expected disassembly.
Diffstat (limited to 'gas')
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/arm/unpredictable.d68
-rw-r--r--gas/testsuite/gas/arm/unpredictable.s94
3 files changed, 169 insertions, 0 deletions
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 97983b2..e8b4372 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2009-12-14 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/10924
+ * gas/arm/unpredictable.s: New test case - checks the disassembly
+ of instructions with unpredictable behaviour.
+ * gas/arm/unpredictable.d: New file - expected disassembly.
+
2009-12-11 Quentin Neill <quentin.neill@amd.com>
* gas/i386/fma4.d: Add test cases.
diff --git a/gas/testsuite/gas/arm/unpredictable.d b/gas/testsuite/gas/arm/unpredictable.d
new file mode 100644
index 0000000..4b7e801
--- /dev/null
+++ b/gas/testsuite/gas/arm/unpredictable.d
@@ -0,0 +1,68 @@
+# name: Upredictable Instructions
+# objdump: -D --prefix-addresses --show-raw-insn
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0+000 <[^>]+> [^<]+<UNPREDICTABLE>
+0+004 <[^>]+> [^<]+<UNPREDICTABLE>
+0+008 <[^>]+> [^<]+<UNPREDICTABLE>
+0+00c <[^>]+> [^<]+<UNPREDICTABLE>
+0+010 <[^>]+> [^<]+<UNPREDICTABLE>
+0+014 <[^>]+> [^<]+<UNPREDICTABLE>
+0+018 <[^>]+> [^<]+<UNPREDICTABLE>
+0+01c <[^>]+> [^<]+<UNPREDICTABLE>
+0+020 <[^>]+> [^<]+<UNPREDICTABLE>
+0+024 <[^>]+> [^<]+<UNPREDICTABLE>
+0+028 <[^>]+> [^<]+<UNPREDICTABLE>
+0+02c <[^>]+> [^<]+<UNPREDICTABLE>
+0+030 <[^>]+> [^<]+<UNPREDICTABLE>
+0+034 <[^>]+> [^<]+<UNPREDICTABLE>
+0+038 <[^>]+> [^<]+<UNPREDICTABLE>
+0+03c <[^>]+> [^<]+<UNPREDICTABLE>
+0+040 <[^>]+> [^<]+<UNPREDICTABLE>
+0+044 <[^>]+> [^<]+<UNPREDICTABLE>
+0+048 <[^>]+> [^<]+<UNPREDICTABLE>
+0+04c <[^>]+> [^<]+<UNPREDICTABLE>
+0+050 <[^>]+> [^<]+<UNPREDICTABLE>
+0+054 <[^>]+> [^<]+<UNPREDICTABLE>
+0+058 <[^>]+> [^<]+<UNPREDICTABLE>
+0+05c <[^>]+> [^<]+<UNPREDICTABLE>
+0+060 <[^>]+> [^<]+<UNPREDICTABLE>
+0+064 <[^>]+> [^<]+<UNPREDICTABLE>
+0+068 <[^>]+> [^<]+<UNPREDICTABLE>
+0+06c <[^>]+> [^<]+<UNPREDICTABLE>
+0+070 <[^>]+> [^<]+<UNPREDICTABLE>
+0+074 <[^>]+> [^<]+<UNPREDICTABLE>
+0+078 <[^>]+> [^<]+<UNPREDICTABLE>
+0+07c <[^>]+> [^<]+<UNPREDICTABLE>
+0+080 <[^>]+> [^<]+<UNPREDICTABLE>
+0+084 <[^>]+> [^<]+<UNPREDICTABLE>
+0+088 <[^>]+> [^<]+<UNPREDICTABLE>
+0+08c <[^>]+> [^<]+<UNPREDICTABLE>
+0+090 <[^>]+> [^<]+<UNPREDICTABLE>
+0+094 <[^>]+> [^<]+<UNPREDICTABLE>
+0+098 <[^>]+> [^<]+<UNPREDICTABLE>
+0+09c <[^>]+> [^<]+<UNPREDICTABLE>
+0+0a0 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0a4 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0a8 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0ac <[^>]+> [^<]+<UNPREDICTABLE>
+0+0b0 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0b4 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0b8 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0bc <[^>]+> [^<]+<UNPREDICTABLE>
+0+0c0 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0c4 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0c8 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0cc <[^>]+> [^<]+<UNPREDICTABLE>
+0+0d0 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0d4 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0d8 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0dc <[^>]+> [^<]+<UNPREDICTABLE>
+0+0e0 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0e4 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0e8 <[^>]+> [^<]+<UNPREDICTABLE>
+0+0ec <[^>]+> [^<]+<UNPREDICTABLE>
+#pass
+
diff --git a/gas/testsuite/gas/arm/unpredictable.s b/gas/testsuite/gas/arm/unpredictable.s
new file mode 100644
index 0000000..36cfce9
--- /dev/null
+++ b/gas/testsuite/gas/arm/unpredictable.s
@@ -0,0 +1,94 @@
+ .text
+ .global upredictable
+unpredictable:
+ .word 0x004f00b1 @ strheq r0, [pc], #-1
+ .word 0x005fffff @ ldrsheq pc, [pc], #-255
+ .word 0x007fffff @ ldrsheq pc, [pc, #-255]!
+ .word 0x00cf00b0 @ strheq r0, [pc], #0
+ .word 0x00df00b0 @ ldrheq r0, [pc], #0
+ .word 0x00dfffff @ ldrsheq pc, [pc], #255
+ .word 0x00ffffff @ ldrsheq pc, [pc, #255]
+ .word 0x0000f0b0 @ strheq pc, [r0], -r0
+ .word 0x000ff0be @ strheq pc, [pc], -lr
+ .word 0xe16fff10 @ clz pc, r0
+ .word 0xe16f0f1f @ clz r0, r15
+
+ .word 0xe99f0001 @ ldmib r15, { r0 }
+ .word 0xe9910000 @ ldmib r1, { }
+ .word 0xe89f0002 @ ldmia pc, { r1 }
+ .word 0xe93f0004 @ ldmdb r15!, { r2 }
+ .word 0xe83f0008 @ ldmda pc!, { r3 }
+
+ ldrb pc, [r0, r1]
+ ldrbt pc, [r0], r1
+ ldrh pc, [r0, r1]
+ ldrsb pc, [r0, r1]
+ ldrsb pc, [r0], -r0
+ ldrsh pc, [r0, r1]
+ ldrt pc, [r0], r1
+
+ .word 0xe020f291 @ mla r0, r1, r2, pc
+ .word 0xe0202f91 @ mla r0, r1, pc, r2
+ .word 0xe020219f @ mla r0, pc, r1, r2
+ .word 0xe02f2190 @ mla pc, r0, r1, r2
+ @ .word 0xe0202190 @ mla r0, r0, r1, r2
+
+ mrs pc, cpsr
+
+ mul r0, r1, pc
+ .word 0xe001009f @ mul r0, pc, r1
+ .word 0xe00f0091 @ mul pc, r1, r0
+ @ .word 0xe0010091 @ mul r1, r1, r0
+
+ .word 0xe0e21f93 @ smlal r1, r2, r3, pc
+ .word 0xe0e2149f @ smlal r1, r2, pc, r4
+ .word 0xe0ef1493 @ smlal r1, pc, r3, r4
+ .word 0xe0e2f493 @ smlal pc, r2, r3, r4
+ @ .word 0xe0e11493 @ smlal r1, r1, r3, r4
+ @ .word 0xe0e21492 @ smlal r1, r2, r2, r4
+ @ .word 0xe0e21491 @ smlal r1, r2, r1, r4
+
+ .word 0xe0c21f93 @ smull r1, r2, r3, pc
+ .word 0xe0c2149f @ smull r1, r2, pc, r4
+ .word 0xe0cf1493 @ smull r1, pc, r3, r4
+ .word 0xe0c2f493 @ smull pc, r2, r3, r4
+ @ .word 0xe0c11493 @ smull r1, r1, r3, r4
+ @ .word 0xe0c21492 @ smull r1, r2, r2, r4
+ @ .word 0xe0c21491 @ smull r1, r2, r1, r4
+
+ .word 0xe98f0004 @ stmib r15, { r2 }
+ .word 0xe88f0008 @ stmia r15, { r3 }
+ .word 0xe92f0010 @ stmdb r15!, { r4 }
+ .word 0xe82f0020 @ stmda r15!, { r5 }
+
+ strb pc, [r0, r1]
+ strbt pc, [r0], r1
+ strh pc, [r0, r1]
+
+ .word 0xe103f092 @ swp r15, r2, [r3]
+ .word 0xe103109f @ swp r1, r15, [r3]
+ .word 0xe10f1092 @ swp r1, r2, [r15]
+ @ .word 0xe1031093 @ swp r1, r3, [r3]
+ @ .word 0xe1033092 @ swp r3, r2, [r3]
+
+ .word 0xe143f092 @ swpb r15, r2, [r3]
+ .word 0xe143109f @ swpb r1, r15, [r3]
+ .word 0xe14f1092 @ swpb r1, r2, [r15]
+ @ .word 0xe1431093 @ swpb r1, r3, [r3]
+ @ .word 0xe1433092 @ swpb r3, r2, [r3]
+
+ .word 0xe0a21f93 @ umlal r1, r2, r3, r15
+ .word 0xe0a2149f @ umlal r1, r2, r15, r4
+ .word 0xe0af1493 @ umlal r1, r15, r3, r4
+ .word 0xe0a2f493 @ umlal r15, r2, r3, r4
+ @ .word 0xe0a11493 @ umlal r1, r1, r3, r4
+ @ .word 0xe0a21491 @ umlal r1, r2, r1, r4
+ @ .word 0xe0a21492 @ umlal r1, r2, r2, r4
+
+ .word 0xe0821f93 @ umull r1, r2, r3, r15
+ .word 0xe082149f @ umull r1, r2, r15, r4
+ .word 0xe08f1493 @ umull r1, r15, r3, r4
+ .word 0xe082f493 @ umull r15, r2, r3, r4
+ @ .word 0xe0811493 @ umull r1, r1, r3, r4
+ @ .word 0xe0821491 @ umull r1, r2, r1, r4
+ @ .word 0xe0821492 @ umull r1, r2, r2, r4