[MCJIT] Make MCJIT honor symbol visibility settings when populating the global
[oota-llvm.git] / test / ExecutionEngine / RuntimeDyld / X86 / MachO_i386_DynNoPIC_relocations.s
1 # RUN: llvm-mc -triple=i386-apple-macosx10.4 -relocation-model=dynamic-no-pic -filetype=obj -o %T/test_i386.o %s
2 # RUN: llvm-rtdyld -triple=i386-apple-macosx10.4 -verify -check=%s %/T/test_i386.o
3
4         .section        __TEXT,__text,regular,pure_instructions
5         .globl  bar
6         .align  4, 0x90
7 bar:
8         calll   tmp0$pb
9         .globl  tmp0$pb
10 tmp0$pb:
11         popl    %eax
12 # Test section difference relocation to non-lazy ptr section.
13 # rtdyld-check: decode_operand(inst1, 4) = x$non_lazy_ptr - tmp0$pb
14         .globl  inst1
15 inst1:
16         movl    x$non_lazy_ptr-tmp0$pb(%eax), %eax
17         movl    (%eax), %ebx
18
19 # Test VANILLA relocation to jump table.
20 # rtdyld-check: decode_operand(inst2, 0) = bling$stub - next_pc(inst2)
21         .globl  inst2
22 inst2:
23         calll   bling$stub
24         addl    %ebx, %eax
25
26 # Test scattered VANILLA relocations.
27 inst3:
28         movl    y+4, %ecx
29         addl    %ecx, %eax
30         retl
31
32         .section        __IMPORT,__jump_table,symbol_stubs,pure_instructions+self_modifying_code,5
33         .globl  bling$stub
34 bling$stub:
35         .indirect_symbol        bling
36         .ascii  "\364\364\364\364\364"
37
38         .section        __IMPORT,__pointers,non_lazy_symbol_pointers
39         .globl  x$non_lazy_ptr
40 x$non_lazy_ptr:
41         .indirect_symbol        x
42         .long   0
43
44         .comm   x,4,2
45         .comm   bling,4,2
46
47         .globl  y
48 .zerofill __DATA,__common,y,8,3
49
50 .subsections_via_symbols