bolt/deps/llvm-18.1.8/llvm/test/tools/llvm-extract/extract-linkonce.ll

25 lines
541 B
LLVM
Raw Normal View History

2025-02-14 19:21:04 +01:00
; RUN: llvm-extract -func foo -S < %s | FileCheck %s
; RUN: llvm-extract -delete -func foo -S < %s | FileCheck --check-prefix=DELETE %s
; Test that linkonce definitions are mapped to weak so that they are not
; dropped.
; CHECK: @bar = external global i32
; CHECK: define weak ptr @foo() {
; CHECK-NEXT: ret ptr @bar
; CHECK-NEXT: }
; DELETE: @bar = weak global i32 42
; DELETE: declare ptr @foo()
@bar = linkonce global i32 42
define linkonce ptr @foo() {
ret ptr @bar
}
define void @g() {
call ptr @foo()
ret void
}