1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00
llvm-mirror/test/Other/extract-linkonce.ll
Rafael Espindola 524e7f35de Add a fixed version of r195470 back.
The fix is simply to use CurI instead of I when handling aliases to
avoid accessing a invalid iterator.

original message:

Convert linkonce* to weak* instead of strong.

Also refactor the logic into a helper function. This is an important improve
on mingw where the linker complains about mixed weak and strong symbols.
Converting to weak ensures that the symbol is not dropped, but keeps in a
comdat, making the linker happy.

llvm-svn: 195477
2013-11-22 17:58:12 +00:00

25 lines
547 B
LLVM

; 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 i32* @foo() {
; CHECK-NEXT: ret i32* @bar
; CHECK-NEXT: }
; DELETE: @bar = weak global i32 42
; DELETE: declare i32* @foo()
@bar = linkonce global i32 42
define linkonce i32* @foo() {
ret i32* @bar
}
define void @g() {
call i32* @foo()
ret void
}