Suppress a test on win32 for now, llvm/test/ExecutionEngine/RuntimeDyld/X86/MachO_x86...
[oota-llvm.git] / test / ExecutionEngine / RuntimeDyld / X86 / MachO_x86-64_PIC_relocations.s
1 # RUN: llvm-mc -triple=x86_64-apple-macosx10.9 -relocation-model=pic -filetype=obj -o %T/foo.o %s
2 # RUN: sed "s,<filename>,%/T/foo.o,g" %s > %T/foo.s
3 # RUN: llvm-rtdyld -triple=x86_64-apple-macosx10.9 -verify -check=%T/foo.s %T/foo.o
4
5 # FIXME: Fix searching StubMap with '/' and '\\' on Win32.
6 # REQUIRES: shell
7
8         .section        __TEXT,__text,regular,pure_instructions
9         .globl  foo
10         .align  4, 0x90
11 foo:
12         retq
13
14         .globl  main
15         .align  4, 0x90
16 main:
17 # Test PC-rel branch.
18 # rtdyld-check: decode_operand(insn1, 0) = foo - next_pc(insn1)
19 insn1:
20         callq   foo
21
22 # Test PC-rel signed.
23 # rtdyld-check: decode_operand(insn2, 4) = x - next_pc(insn2)
24 insn2:
25         movl    x(%rip), %eax
26
27 # Test PC-rel GOT relocation.
28 # Verify both the contents of the GOT entry for y, and that the movq instruction
29 # references the correct GOT entry address:
30 # rtdyld-check: *{8}(stub_addr(<filename>, __text, y)) = y
31 # rtdyld-check: decode_operand(insn3, 4) = stub_addr(<filename>, __text, y) - next_pc(insn3)
32 insn3:
33         movq    y@GOTPCREL(%rip), %rax
34
35         movl    $0, %eax
36         retq
37
38         .comm   y,4,2
39
40         .section        __DATA,__data
41         .globl  x
42         .align  2
43 x:
44         .long   5
45
46 .subsections_via_symbols