Copy dll storage in copyAttributes.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 13 Feb 2014 05:11:35 +0000 (05:11 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 13 Feb 2014 05:11:35 +0000 (05:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201295 91177308-0d34-0410-b5e6-96231b3b80d8

lib/IR/Globals.cpp
test/Linker/dllstorage-a.ll [new file with mode: 0644]
test/Linker/dllstorage-b.ll [new file with mode: 0644]

index 4d8b9cef544aa70096339b4a7d1536fd63fec05c..a70ea0f37b904a22e861d7c5f0a74ecc2736e515 100644 (file)
@@ -53,6 +53,7 @@ void GlobalValue::copyAttributesFrom(const GlobalValue *Src) {
   setSection(Src->getSection());
   setVisibility(Src->getVisibility());
   setUnnamedAddr(Src->hasUnnamedAddr());
+  setDLLStorageClass(Src->getDLLStorageClass());
 }
 
 void GlobalValue::setAlignment(unsigned Align) {
diff --git a/test/Linker/dllstorage-a.ll b/test/Linker/dllstorage-a.ll
new file mode 100644 (file)
index 0000000..91b9818
--- /dev/null
@@ -0,0 +1,4 @@
+; RUN: llvm-link %s %p/dllstorage-b.ll -S -o - | FileCheck %s
+@foo = external global i32
+
+; CHECK: @foo = dllexport global i32 42
diff --git a/test/Linker/dllstorage-b.ll b/test/Linker/dllstorage-b.ll
new file mode 100644 (file)
index 0000000..4c7dbcd
--- /dev/null
@@ -0,0 +1,3 @@
+; RUN: true
+
+@foo = dllexport global i32 42