Revert "CodeGen][NewPM] Port MachineScheduler to NPM. (#125703)" (#126268)
[llvm-project.git] / llvm / test / ExecutionEngine / JITLink / x86-64 / ELF_large_pic_relocations.s
blob5db85b6bf122e2c687c98814f193bab55ba8ff90
1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent \
3 # RUN: -filetype=obj -large-code-model -o %t/elf_lg_pic_reloc.o %s
4 # RUN: llvm-jitlink -noexec \
5 # RUN: -slab-allocate 100Kb -slab-address 0xfff00000 -slab-page-size 4096 \
6 # RUN: -check %s %t/elf_lg_pic_reloc.o
8 # Test ELF large/PIC relocations.
10 .text
11 .file "testcase.c"
13 # Empty main entry point.
14 .globl main
15 .p2align 4, 0x90
16 .type main,@function
17 main:
18 retq
20 .size main, .-main
22 # Test R_X86_64_GOTPC64 handling. We want to check that the offset of the
23 # operand is the 64-bit delta to the start of the GOT.
24 # jitlink-check: decode_operand(test_gotpc64, 1) = \
25 # jitlink-check: _GLOBAL_OFFSET_TABLE_ - test_lg_pic_GOT
26 # jitlink-check: decode_operand(test_got64, 1) = \
27 # jitlink-check: got_addr(elf_lg_pic_reloc.o, named_data) - \
28 # jitlink-check: _GLOBAL_OFFSET_TABLE_
29 .globl test_lg_pic_GOT
30 .p2align 4, 0x90
31 .type test_lg_pic_GOT,@function
32 test_lg_pic_GOT:
33 .L0$pb:
34 leaq .L0$pb(%rip), %rax
36 .globl test_gotpc64
37 test_gotpc64:
38 movabsq $_GLOBAL_OFFSET_TABLE_-.L0$pb, %rcx
39 .size test_gotpc64, .-test_gotpc64
41 addq %rax, %rcx
42 .globl test_got64
43 test_got64:
44 movabsq $named_data@GOT, %rax
45 .size test_got64, .-test_got64
47 .size test_lg_pic_GOT, .-test_lg_pic_GOT
49 .data
51 .type named_data,@object
52 .p2align 3
53 named_data:
54 .quad 42
55 .size named_data, 8
57 .ident "clang version 10.0.0-4ubuntu1 "
58 .section ".note.GNU-stack","",@progbits
59 .addrsig