diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-11-10 18:41:59 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-11-10 18:41:59 +0000 |
| commit | 75b809c9b634d9843a6f17ce02c2b35dedc7ca7c (patch) | |
| tree | 18f6978a0dd66bb2ecd1764507144ae199dc3326 | |
| parent | 0c981bd7df705511866e908efb4da61ce40a8aaa (diff) | |
| download | bcm5719-llvm-75b809c9b634d9843a6f17ce02c2b35dedc7ca7c.tar.gz bcm5719-llvm-75b809c9b634d9843a6f17ce02c2b35dedc7ca7c.zip | |
Copy externally_initialized in GlobalVariable::copyAttributesFrom.
Patch by Kevin Frei!
llvm-svn: 221620
| -rw-r--r-- | llvm/lib/IR/Globals.cpp | 1 | ||||
| -rw-r--r-- | llvm/test/Linker/lto-attributes.ll | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/IR/Globals.cpp b/llvm/lib/IR/Globals.cpp index cecd999657e..e181d623b85 100644 --- a/llvm/lib/IR/Globals.cpp +++ b/llvm/lib/IR/Globals.cpp @@ -246,6 +246,7 @@ void GlobalVariable::copyAttributesFrom(const GlobalValue *Src) { GlobalObject::copyAttributesFrom(Src); const GlobalVariable *SrcVar = cast<GlobalVariable>(Src); setThreadLocalMode(SrcVar->getThreadLocalMode()); + setExternallyInitialized(SrcVar->isExternallyInitialized()); } diff --git a/llvm/test/Linker/lto-attributes.ll b/llvm/test/Linker/lto-attributes.ll new file mode 100644 index 00000000000..0dc78ad159b --- /dev/null +++ b/llvm/test/Linker/lto-attributes.ll @@ -0,0 +1,7 @@ +; RUN: llvm-link -S %s -o - | FileCheck %s + +; CHECK: @foo = private externally_initialized global i8* null +@foo = private externally_initialized global i8* null +; CHECK: @array = appending global [7 x i8] c"abcdefg", align 1 +@array = appending global [7 x i8] c"abcdefg", align 1 + |

