File: arm-wrap-personality.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 (34 lines) | stat: -rw-r--r-- 1,138 bytes parent folder | download | duplicates (14)
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
;; Wrapped symbols are marked as weak for LTO to inhibit IPO. The ARM backend
;; was previously explicitly marking the personality function as global, so if
;; we attempted to wrap the personality function, its initial binding would be
;; weak and then the ARM backend would attempt to change it to global, causing
;; an error. Verify that the ARM backend no longer does this and we can
;; successfully wrap the personality symbol.

; REQUIRES: arm

; RUN: llvm-as -o %t.bc %s
; RUN: ld.lld -shared --wrap __gxx_personality_v0 %t.bc -o %t.so
; RUN: llvm-readelf --dyn-syms %t.so | FileCheck %s

; CHECK: GLOBAL {{.*}} __wrap___gxx_personality_v0
;; This should be GLOBAL when PR52004 is fixed.
; CHECK: WEAK {{.*}} __gxx_personality_v0

target datalayout = "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "armv7-none-linux-android"

define i32 @__gxx_personality_v0(...) {
  ret i32 0
}

define void @dummy() optnone noinline personality ptr @__gxx_personality_v0 {
  invoke void @dummy() to label %cont unwind label %lpad

cont:
  ret void

lpad:
  %lp = landingpad { ptr, i32 } cleanup
  resume { ptr, i32 } %lp
}