[PATCH] [llvm-mc] Fix bad sign extension on callw immediate
Matthew Barney
m4b.github.io at gmail.com
Thu May 7 12:47:52 PDT 2015
I added the unit tests as a separate commit; I was unsure what the protocol is in this case. Just in case, I've added the same diff in this comment.
diff --git a/test/MC/Disassembler/X86/x86-32.txt b/test/MC/Disassembler/X86/x86-32.txt
index 830b830..aaf9e5b 100644
- a/test/MC/Disassembler/X86/x86-32.txt
+++ b/test/MC/Disassembler/X86/x86-32.txt
@@ -54,6 +54,12 @@
1. CHECK: calll -1234 0xe8 0x2e 0xfb 0xff 0xff
+# CHECK: callw -1
+0x66 0xe8 0xff 0xff
+
+# CHECK: callw 32767
+0x66 0xe8 0xff 0x7f
+
1. CHECK: lfence 0x0f 0xae 0xe8
diff --git a/test/MC/Disassembler/X86/x86-64.txt b/test/MC/Disassembler/X86/x86-64.txt
index f000d15..3088619 100644
- a/test/MC/Disassembler/X86/x86-64.txt
+++ b/test/MC/Disassembler/X86/x86-64.txt
@@ -301,3 +301,9 @@
1. CHECK: movq %rax, 1515870810 0x67, 0x48 0xa3 0x5a 0x5a 0x5a 0x5a
+
+# CHECK: callq -32769
+0xe8 0xff 0x7f 0xff 0xff
+
+# CHECK: callq 32767
+0xe8 0xff 0x7f 0x00 0x00
REPOSITORY
rL LLVM
http://reviews.llvm.org/D9514
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list