[DAGCombiner] Add target hook function to decide folding (mul (add x, c1), c2)
[llvm-project.git] / llvm / test / MC / ELF / target-in-same-section.s
blob8e8e1e7c60783d20e1de10fe2b1b047649ff9f6e
1 ## For a target defined in the same section, create a relocation if the
2 ## symbol is not local, otherwise resolve the fixup statically.
3 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t
4 # RUN: llvm-readobj -r %t | FileCheck --check-prefix=RELOC %s
5 # RUN: llvm-objdump -d --no-show-raw-insn %t | FileCheck %s
7 # RELOC: .rela.text {
8 # RELOC-NEXT: 0x5 R_X86_64_PLT32 global 0xFFFFFFFFFFFFFFFC
9 # RELOC-NEXT: 0xA R_X86_64_PLT32 weak 0xFFFFFFFFFFFFFFFC
10 # RELOC-NEXT: 0x19 R_X86_64_PLT32 global 0xFFFFFFFFFFFFFFFC
11 # RELOC-NEXT: 0x1E R_X86_64_PLT32 weak 0xFFFFFFFFFFFFFFFC
12 # RELOC-NEXT: 0x23 R_X86_64_PLT32 ifunc 0xFFFFFFFFFFFFFFFC
13 # RELOC-NEXT: }
15 # CHECK: 0: jmp
16 # CHECK-NEXT: 2: jmp
17 # CHECK-NEXT: 4: jmp
18 # CHECK-NEXT: 9: jmp
19 # CHECK-NEXT: e: callq
20 # CHECK-NEXT: 13: callq
21 # CHECK-NEXT: 18: callq
22 # CHECK-NEXT: 1d: callq
23 # CHECK-NEXT: 22: callq
24 # CHECK-NEXT: 27: retq
26 .globl global
27 .weak weak
28 .type ifunc,@gnu_indirect_function
29 global:
30 weak:
31 local:
32 .set var,global
33 ifunc:
34 jmp var
35 jmp local
36 jmp global
37 jmp weak
39 call var
40 call local
41 call global
42 call weak
44 call ifunc
45 ret