summaryrefslogtreecommitdiff
path: root/test/MC/X86
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2014-01-30 22:20:41 +0000
committerDavid Woodhouse <dwmw2@infradead.org>2014-01-30 22:20:41 +0000
commit93f81d9b33bf5f01c113b1558962a5112b987092 (patch)
treef657e60d87fa49884d00e5c89594aead726a3863 /test/MC/X86
parentfe7fa28084172f73aa0a29a65bf09152dc47a3ac (diff)
[x86] Fix signed relocations for i64i32imm operands
These should end up (in ELF) as R_X86_64_32S relocs, not R_X86_64_32. Kill the horrid and incomplete special case and FIXME in EncodeInstruction() and set things up so it can infer the signedness from the ImmType just like it can the size and whether it's PC-relative. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200495 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/X86')
-rw-r--r--test/MC/X86/x86_64-signed-reloc.s16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/MC/X86/x86_64-signed-reloc.s b/test/MC/X86/x86_64-signed-reloc.s
new file mode 100644
index 00000000000..e8a2720df1d
--- /dev/null
+++ b/test/MC/X86/x86_64-signed-reloc.s
@@ -0,0 +1,16 @@
+// RUN: llvm-mc -triple x86_64-linux-gnu -filetype=obj %s | llvm-readobj -r | FileCheck %s
+
+
+ // CHECK: Relocations [
+ // CHECK-NEXT: Section ({{[0-9]+}}) .rela.text {
+
+pushq $foo // CHECK-NEXT: R_X86_64_32S
+addq $foo, %rax // CHECK-NEXT: R_X86_64_32S
+andq $foo, %rax // CHECK-NEXT: R_X86_64_32S
+movq $foo, %rax // CHECK-NEXT: R_X86_64_32S
+bextr $foo, (%edi), %eax // CHECK-NEXT: R_X86_64_32
+bextr $foo, (%rdi), %rax // CHECK-NEXT: R_X86_64_32S
+imul $foo, %rax // CHECK-NEXT: R_X86_64_32S
+
+ // CHECK-NEXT: }
+ // CHECK-NEXT: ]