Copy dll storage in copyAttributes.

llvm-svn: 201295
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp
index 4d8b9ce..a70ea0f 100644
--- a/llvm/lib/IR/Globals.cpp
+++ b/llvm/lib/IR/Globals.cpp
@@ -53,6 +53,7 @@
   setSection(Src->getSection());
   setVisibility(Src->getVisibility());
   setUnnamedAddr(Src->hasUnnamedAddr());
+  setDLLStorageClass(Src->getDLLStorageClass());
 }
 
 void GlobalValue::setAlignment(unsigned Align) {
diff --git a/llvm/test/Linker/dllstorage-a.ll b/llvm/test/Linker/dllstorage-a.ll
new file mode 100644
index 0000000..91b9818
--- /dev/null
+++ b/llvm/test/Linker/dllstorage-a.ll
@@ -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/llvm/test/Linker/dllstorage-b.ll b/llvm/test/Linker/dllstorage-b.ll
new file mode 100644
index 0000000..4c7dbcd
--- /dev/null
+++ b/llvm/test/Linker/dllstorage-b.ll
@@ -0,0 +1,3 @@
+; RUN: true
+
+@foo = dllexport global i32 42