summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorKevin Enderby <enderby@apple.com>2012-12-05 18:13:19 +0000
committerKevin Enderby <enderby@apple.com>2012-12-05 18:13:19 +0000
commit168ffb36a5e14049aea7c0e2ca7e8cfc4a3f7a7d (patch)
tree96e0d745d9d51111aad75ed4868c7db668c82571 /llvm/test
parent86975ce3fb8b0cb7f1370663ecf26f9ebed49119 (diff)
downloadbcm5719-llvm-168ffb36a5e14049aea7c0e2ca7e8cfc4a3f7a7d.tar.gz
bcm5719-llvm-168ffb36a5e14049aea7c0e2ca7e8cfc4a3f7a7d.zip
Added a option to the disassembler to print immediates as hex.
This is for the lldb team so most of but not all of the values are to be printed as hex with this option. Some small values like the scale in an X86 address were requested to printed in decimal without the leading 0x. There may be some tweaks need to places that may still be in decimal that they want in hex. Specially for arm. I made my best guess. Any tweaks from here should be simple. I also did the best I know now with help from the C++ gurus creating the cleanest formatImm() utility function and containing the changes. But if someone has a better idea to make something cleaner I'm all ears and game for changing the implementation. rdar://8109283 llvm-svn: 169393
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/MC/Disassembler/ARM/hex-immediates.txt5
-rw-r--r--llvm/test/MC/Disassembler/X86/hex-immediates.txt10
2 files changed, 15 insertions, 0 deletions
diff --git a/llvm/test/MC/Disassembler/ARM/hex-immediates.txt b/llvm/test/MC/Disassembler/ARM/hex-immediates.txt
new file mode 100644
index 00000000000..2634d7ed336
--- /dev/null
+++ b/llvm/test/MC/Disassembler/ARM/hex-immediates.txt
@@ -0,0 +1,5 @@
+# RUN: llvm-mc -triple=thumbv7-apple-darwin -mcpu=cortex-a8 -hdis < %s | FileCheck %s
+# CHECK: ldr r4, [pc, #0x20]
+0x08 0x4c
+# CHECK: sub sp, #0x84
+0xa1 0xb0
diff --git a/llvm/test/MC/Disassembler/X86/hex-immediates.txt b/llvm/test/MC/Disassembler/X86/hex-immediates.txt
new file mode 100644
index 00000000000..80d24487ee7
--- /dev/null
+++ b/llvm/test/MC/Disassembler/X86/hex-immediates.txt
@@ -0,0 +1,10 @@
+# RUN: llvm-mc --hdis %s -triple=x86_64-apple-darwin9 2>&1 | FileCheck %s
+
+# CHECK: movabsq $0x7fffffffffffffff, %rcx
+0x48 0xb9 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0x7f
+# CHECK: leaq 0x3e2(%rip), %rdi
+0x48 0x8d 0x3d 0xe2 0x03 0x00 0x00
+# CHECK: subq $0x40, %rsp
+0x48 0x83 0xec 0x40
+# CHECK: leal (,%r14,4), %eax
+0x42 0x8d 0x04 0xb5 0x00 0x00 0x00 0x00
OpenPOWER on IntegriCloud