File: ifunc-asm.ll

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (70 lines) | stat: -rw-r--r-- 2,853 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
; RUN: llc -mtriple=arm64-unknown-linux-gnu %s -o - | FileCheck %s --check-prefixes=ELF
; RUN: llc -mtriple=arm64-apple-darwin %s -o - | FileCheck %s --check-prefix=MACHO
; RUN: llc -mtriple=arm64-apple-darwin %s -global-isel -o - | FileCheck %s --check-prefix=MACHO

define internal ptr @the_resolver() {
entry:
  ret ptr null
}
; ELF:             .type the_resolver,@function
; ELF-NEXT:    the_resolver:

; MACHO:           .p2align 2
; MACHO-NEXT:  _the_resolver:


@global_ifunc = ifunc i32 (i32), ptr @the_resolver
; ELF:             .globl global_ifunc
; ELF-NEXT:        .type global_ifunc,@gnu_indirect_function
; ELF-NEXT:        .set global_ifunc, the_resolver

; MACHO:           .section __DATA,__data
; MACHO-NEXT:      .p2align 3, 0x0
; MACHO-NEXT:  _global_ifunc.lazy_pointer:
; MACHO-NEXT:      .quad _global_ifunc.stub_helper

; MACHO:           .section __TEXT,__text,regular,pure_instructions
; MACHO-NEXT:      .globl _global_ifunc
; MACHO-NEXT:      .p2align 2
; MACHO-NEXT:  _global_ifunc:
; MACHO-NEXT:      adrp    x16, _global_ifunc.lazy_pointer@GOTPAGE
; MACHO-NEXT:      ldr     x16, [x16, _global_ifunc.lazy_pointer@GOTPAGEOFF]
; MACHO-NEXT:      ldr     x16, [x16]
; MACHO-NEXT:      br      x16
; MACHO-NEXT:      .p2align        2
; MACHO-NEXT:  _global_ifunc.stub_helper:
; MACHO-NEXT:      stp     x29, x30, [sp, #-16]!
; MACHO-NEXT:      mov     x29, sp
; MACHO-NEXT:      stp     x1, x0, [sp, #-16]!
; MACHO-NEXT:      stp     x3, x2, [sp, #-16]!
; MACHO-NEXT:      stp     x5, x4, [sp, #-16]!
; MACHO-NEXT:      stp     x7, x6, [sp, #-16]!
; MACHO-NEXT:      stp     d1, d0, [sp, #-16]!
; MACHO-NEXT:      stp     d3, d2, [sp, #-16]!
; MACHO-NEXT:      stp     d5, d4, [sp, #-16]!
; MACHO-NEXT:      stp     d7, d6, [sp, #-16]!
; MACHO-NEXT:      bl      _the_resolver
; MACHO-NEXT:      adrp    x16, _global_ifunc.lazy_pointer@GOTPAGE
; MACHO-NEXT:      ldr     x16, [x16, _global_ifunc.lazy_pointer@GOTPAGEOFF]
; MACHO-NEXT:      str     x0, [x16]
; MACHO-NEXT:      add     x16, x0, #0
; MACHO-NEXT:      ldp     d7, d6, [sp], #16
; MACHO-NEXT:      ldp     d5, d4, [sp], #16
; MACHO-NEXT:      ldp     d3, d2, [sp], #16
; MACHO-NEXT:      ldp     d1, d0, [sp], #16
; MACHO-NEXT:      ldp     x7, x6, [sp], #16
; MACHO-NEXT:      ldp     x5, x4, [sp], #16
; MACHO-NEXT:      ldp     x3, x2, [sp], #16
; MACHO-NEXT:      ldp     x1, x0, [sp], #16
; MACHO-NEXT:      ldp     x29, x30, [sp], #16
; MACHO-NEXT:      br      x16


@weak_ifunc = weak ifunc i32 (i32), ptr @the_resolver
; ELF:             .type weak_ifunc,@gnu_indirect_function
; MACHO-NOT:       .weak_reference _weak_ifunc.lazy_pointer
; MACHO:       _weak_ifunc.lazy_pointer:
; MACHO:           .weak_reference _weak_ifunc
; MACHO:       _weak_ifunc:
; MACHO-NOT:       .weak_reference _weak_ifunc.stub_helper
; MACHO:       _weak_ifunc.stub_helper: