diff options
-rw-r--r-- | llvm/lib/IR/Globals.cpp | 1 | ||||
-rw-r--r-- | llvm/test/Linker/dllstorage-a.ll | 4 | ||||
-rw-r--r-- | llvm/test/Linker/dllstorage-b.ll | 3 |
3 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp index 4d8b9cef544..a70ea0f37b9 100644 --- a/llvm/lib/IR/Globals.cpp +++ b/llvm/lib/IR/Globals.cpp @@ -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/llvm/test/Linker/dllstorage-a.ll b/llvm/test/Linker/dllstorage-a.ll new file mode 100644 index 00000000000..91b98184f8b --- /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 00000000000..4c7dbcd19bd --- /dev/null +++ b/llvm/test/Linker/dllstorage-b.ll @@ -0,0 +1,3 @@ +; RUN: true + +@foo = dllexport global i32 42 |