summaryrefslogtreecommitdiff
path: root/test/Other
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-11-22 17:58:12 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-11-22 17:58:12 +0000
commit4799cdb81ef26645292d7183cdcd81946d76353c (patch)
tree34cbf940ac47e52027684dd5fcd64585eb9815be /test/Other
parent089443891249760b2a81b5f9da1503290a35d13f (diff)
downloadllvm-4799cdb81ef26645292d7183cdcd81946d76353c.tar.gz
llvm-4799cdb81ef26645292d7183cdcd81946d76353c.tar.bz2
llvm-4799cdb81ef26645292d7183cdcd81946d76353c.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195477 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Other')
-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 31fbf3ac46..4c6b6b76a4 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