summaryrefslogtreecommitdiffstats
path: root/llvm/test/ExecutionEngine
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-08-19 21:26:36 +0000
committerLang Hames <lhames@gmail.com>2014-08-19 21:26:36 +0000
commitdf7be5105a124233d063bfb55dfe4b80f88e0481 (patch)
tree1cc5f8e2023a466fbda9e5db564b7833daede0c9 /llvm/test/ExecutionEngine
parent35de5b8ca1e916b58e0eed685287985fc2395af6 (diff)
downloadbcm5719-llvm-df7be5105a124233d063bfb55dfe4b80f88e0481.tar.gz
bcm5719-llvm-df7be5105a124233d063bfb55dfe4b80f88e0481.zip
[MCJIT] Add an i386 RuntimeDyldMachO test case.
llvm-svn: 216024
Diffstat (limited to 'llvm/test/ExecutionEngine')
-rw-r--r--llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_i386_DynNoPIC_relocations.s45
-rw-r--r--llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s8
2 files changed, 49 insertions, 4 deletions
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_i386_DynNoPIC_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_i386_DynNoPIC_relocations.s
new file mode 100644
index 00000000000..f427b985b58
--- /dev/null
+++ b/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_i386_DynNoPIC_relocations.s
@@ -0,0 +1,45 @@
+# RUN: llvm-mc -triple=i386-apple-macosx10.4 -relocation-model=dynamic-no-pic -filetype=obj -o %T/test_i386.o %s
+# RUN: llvm-rtdyld -triple=i386-apple-macosx10.4 -verify -check=%s %/T/test_i386.o
+
+ .section __TEXT,__text,regular,pure_instructions
+ .globl bar
+ .align 4, 0x90
+bar:
+ calll tmp0$pb
+tmp0$pb:
+ popl %eax
+# Test section difference relocation to non-lazy ptr section.
+# rtdyld-check: decode_operand(inst1, 4) = x$non_lazy_ptr - tmp0$pb
+inst1:
+ movl x$non_lazy_ptr-tmp0$pb(%eax), %eax
+ movl (%eax), %ebx
+
+# Test VANILLA relocation to jump table.
+# rtdyld-check: decode_operand(inst2, 0) = bling$stub - next_pc(inst2)
+inst2:
+ calll bling$stub
+ addl %ebx, %eax
+
+# Test scattered VANILLA relocations.
+inst3:
+ movl y+4, %ecx
+ addl %ecx, %eax
+ retl
+
+ .section __IMPORT,__jump_table,symbol_stubs,pure_instructions+self_modifying_code,5
+bling$stub:
+ .indirect_symbol bling
+ .ascii "\364\364\364\364\364"
+
+ .section __IMPORT,__pointers,non_lazy_symbol_pointers
+x$non_lazy_ptr:
+ .indirect_symbol x
+ .long 0
+
+ .comm x,4,2
+ .comm bling,4,2
+
+ .globl y
+.zerofill __DATA,__common,y,8,3
+
+.subsections_via_symbols
diff --git a/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s b/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s
index 00b2df6ecc7..7a40a24d312 100644
--- a/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s
+++ b/llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86-64_PIC_relocations.s
@@ -1,5 +1,5 @@
-# RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -relocation-model=pic -filetype=obj -o %T/foo.o %s
-# RUN: llvm-rtdyld -triple=x86_64-apple-macosx10.9 -verify -check=%s %/T/foo.o
+# RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -relocation-model=pic -filetype=obj -o %T/test_x86-64.o %s
+# RUN: llvm-rtdyld -triple=x86_64-apple-macosx10.9 -verify -check=%s %/T/test_x86-64.o
# XFAIL: mips
.section __TEXT,__text,regular,pure_instructions
@@ -24,8 +24,8 @@ insn2:
# Test PC-rel GOT relocation.
# Verify both the contents of the GOT entry for y, and that the movq instruction
# references the correct GOT entry address:
-# rtdyld-check: *{8}(stub_addr(foo.o, __text, y)) = y
-# rtdyld-check: decode_operand(insn3, 4) = stub_addr(foo.o, __text, y) - next_pc(insn3)
+# rtdyld-check: *{8}(stub_addr(test_x86-64.o, __text, y)) = y
+# rtdyld-check: decode_operand(insn3, 4) = stub_addr(test_x86-64.o, __text, y) - next_pc(insn3)
insn3:
movq y@GOTPCREL(%rip), %rax
OpenPOWER on IntegriCloud