Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / llvm / test / ExecutionEngine / JITLink / x86-64 / COFF_small_pic_relocations.s
blob38f4fb11ba01223d55552e1f2299ab8886345d72
1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=x86_64-windows-msvc -relax-relocations=false \
3 # RUN: -position-independent -filetype=obj -o %t/coff_sm_reloc.o %s
4 # RUN: llvm-jitlink -noexec \
5 # RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
6 # RUN: -abs external_data=0xdeadbeef \
7 # RUN: -check %s %t/coff_sm_reloc.o
9 .text
11 .def main;
12 .scl 2;
13 .type 32;
14 .endef
15 .globl main
16 .p2align 4, 0x90
17 main:
18 retq
20 # Check a IMAGE_REL_AMD64_REL32 relocation to local function symbol.
21 # jitlink-check: decode_operand(test_rel32_func, 0) = named_func - next_pc(test_rel32_func)
22 .def test_rel32_func;
23 .scl 2;
24 .type 32;
25 .endef
26 .globl test_rel32_func
27 .p2align 4, 0x90
28 test_rel32_func:
29 callq named_func
31 # Check a IMAGE_REL_AMD64_REL32 relocation to local data symbol.
32 # jitlink-check: decode_operand(test_rel32_data, 4) = named_data - next_pc(test_rel32_data)
33 .def test_rel32_data;
34 .scl 2;
35 .type 32;
36 .endef
37 .globl test_rel32_data
38 .p2align 4, 0x90
39 test_rel32_data:
40 leaq named_data(%rip), %rax
42 # Check IMAGE_REL_AMD64_ADDR64 sets address of symbol to the fixup position.
43 # jitlink-check: *{8}(test_addr64) = named_data
44 .text
45 .def named_func;
46 .scl 2;
47 .type 32;
48 .endef
49 .globl test_addr64
50 .p2align 4, 0x90
51 test_addr64:
52 .quad named_data
54 # Local named data/func that is used in conjunction with other test cases
55 .text
56 .def named_func;
57 .scl 2;
58 .type 32;
59 .endef
60 .globl named_func
61 .p2align 4, 0x90
62 named_func:
63 retq
65 .data
66 .p2align 3
67 named_data:
68 .quad 53