[ORC] Add std::tuple support to SimplePackedSerialization.
[llvm-project.git] / llvm / test / ExecutionEngine / JITLink / X86 / ELF_x86-64_got_plt_optimizations.s
blobd74c56a533af1170b99f94c0ff5366227e676b46
1 # RUN: rm -rf %t && mkdir -p %t
2 # RUN: llvm-mc -triple=x86_64-unknown-linux -position-independent -filetype=obj \
3 # RUN: -o %t/elf_sm_pic_reloc.o %s
4 # RUN: llvm-jitlink -noexec -slab-allocate 100Kb -slab-address 0xfff00000 \
5 # RUN: -define-abs extern_in_range32=0xffe00000 \
6 # RUN: -check %s %t/elf_sm_pic_reloc.o
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 optimization of transforming "call *foo@GOTPCREL(%rip)" to "addr call foo"
23 # We need check both the target address and the instruction opcodes
24 # jitlink-check: decode_operand(test_call_gotpcrelx, 0)[31:0] = extern_in_range32
25 # jitlink-check: *{1}test_call_gotpcrelx = 0x67
26 # jitlink-check: *{1}test_call_gotpcrelx+1 = 0xe8
27 .globl test_call_gotpcrelx
28 .p2align 4, 0x90
29 .type test_call_gotpcrelx,@function
30 test_call_gotpcrelx:
31 call *extern_in_range32@GOTPCREL(%rip)
33 .size test_call_gotpcrelx, .-test_call_gotpcrelx
36 # Test optimization of transforming "jmp *foo@GOTPCREL(%rip)" to "jmp foo ; nop"
37 # We need check both the target address and the instruction opcodes
38 # jitlink-check: decode_operand(test_call_gotpcrelx, 0)[31:0] = extern_in_range32
39 # jitlink-check: *{1}test_jmp_gotpcrelx = 0xe9
40 # jitlink-check: *{1}test_jmp_gotpcrelx+5 = 0x90
41 .globl test_jmp_gotpcrelx
42 .p2align 4, 0x90
43 .type test_jmp_gotpcrelx,@function
44 test_jmp_gotpcrelx:
45 jmp *extern_in_range32@GOTPCREL(%rip)
47 .size test_jmp_gotpcrelx, .-test_jmp_gotpcrelx
49 # Check R_X86_64_PLT32 handling with a call to an external. This produces a
50 # Branch32ToStub edge, because externals are not defined locally. During
51 # resolution, the target turns out to be in-range from the callsite and so the
52 # edge is relaxed in post-allocation optimization.
54 # jitlink-check: decode_operand(test_call_extern, 0) = \
55 # jitlink-check: extern_in_range32 - next_pc(test_call_extern)
56 .globl test_call_extern
57 .p2align 4, 0x90
58 .type test_call_extern,@function
59 test_call_extern:
60 callq extern_in_range32@plt
62 .size test_call_extern, .-test_call_extern