From: Rafael Espindola Date: Thu, 13 Feb 2014 05:11:35 +0000 (+0000) Subject: Copy dll storage in copyAttributes. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=17c9169bbd335429ba9af5bf2637e92f79075abd;p=oota-llvm.git Copy dll storage in copyAttributes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201295 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/IR/Globals.cpp b/lib/IR/Globals.cpp index 4d8b9cef544..a70ea0f37b9 100644 --- a/lib/IR/Globals.cpp +++ b/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/test/Linker/dllstorage-a.ll b/test/Linker/dllstorage-a.ll new file mode 100644 index 00000000000..91b98184f8b --- /dev/null +++ b/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/test/Linker/dllstorage-b.ll b/test/Linker/dllstorage-b.ll new file mode 100644 index 00000000000..4c7dbcd19bd --- /dev/null +++ b/test/Linker/dllstorage-b.ll @@ -0,0 +1,3 @@ +; RUN: true + +@foo = dllexport global i32 42