blob: 4c6b6b76a4abf10f43c1b885eb5ace45c8110b83 [file] [log] [blame]
Lang Hames30be8a32013-03-04 22:40:44 +00001; RUN: llvm-extract -func foo -S < %s | FileCheck %s
2; RUN: llvm-extract -delete -func foo -S < %s | FileCheck --check-prefix=DELETE %s
3
Rafael Espindola65979922013-11-22 17:58:12 +00004; Test that linkonce definitions are mapped to weak so that they are not
5; dropped.
Lang Hames30be8a32013-03-04 22:40:44 +00006
Rafael Espindola65979922013-11-22 17:58:12 +00007; CHECK: @bar = external global i32
8; CHECK: define weak i32* @foo() {
Lang Hames30be8a32013-03-04 22:40:44 +00009; CHECK-NEXT: ret i32* @bar
10; CHECK-NEXT: }
11
Rafael Espindola65979922013-11-22 17:58:12 +000012; DELETE: @bar = weak global i32 42
13; DELETE: declare i32* @foo()
Lang Hames30be8a32013-03-04 22:40:44 +000014
15@bar = linkonce global i32 42
16
17define linkonce i32* @foo() {
18 ret i32* @bar
19}
20
21define void @g() {
22 call i32* @foo()
23 ret void
24}