summaryrefslogtreecommitdiff
path: root/test/Other/extract-linkonce.ll
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-11-22 16:14:30 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-11-22 16:14:30 +0000
commita6c0249619351b8cfa54a9e85eb3a3f1421bb315 (patch)
tree43a6e058eeb9b72c9da5beed9e2ff4d5131e7485 /test/Other/extract-linkonce.ll
parenta24e7f7d8cc7f1e4e1582cb2f3ef9748d92fd7e4 (diff)
downloadllvm-a6c0249619351b8cfa54a9e85eb3a3f1421bb315.tar.gz
Convert linkonce* to weak* instead of strong.
Also refactor the logic into a helper function. This is an important improvement 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195470 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Other/extract-linkonce.ll')
-rw-r--r--test/Other/extract-linkonce.ll11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/Other/extract-linkonce.ll b/test/Other/extract-linkonce.ll
index 31fbf3ac4632..4c6b6b76a4ab 100644
--- a/test/Other/extract-linkonce.ll
+++ b/test/Other/extract-linkonce.ll
@@ -1,15 +1,16 @@
; RUN: llvm-extract -func foo -S < %s | FileCheck %s
; RUN: llvm-extract -delete -func foo -S < %s | FileCheck --check-prefix=DELETE %s
-; Test that we don't convert weak_odr to external definitions.
+; Test that linkonce definitions are mapped to weak so that they are not
+; dropped.
-; CHECK: @bar = external hidden global i32
-; CHECK: define hidden i32* @foo() {
+; CHECK: @bar = external global i32
+; CHECK: define weak i32* @foo() {
; CHECK-NEXT: ret i32* @bar
; CHECK-NEXT: }
-; DELETE: @bar = hidden global i32 42
-; DELETE: declare hidden i32* @foo()
+; DELETE: @bar = weak global i32 42
+; DELETE: declare i32* @foo()
@bar = linkonce global i32 42