forked from OSchip/llvm-project
[msan] Change linkage type of __msan_track_origins.
LinkOnceODRLinkage globals may be removed in GlobalOpt if not used in the current module. llvm-svn: 169377
This commit is contained in:
parent
c446aa039a
commit
474cb3b3b5
|
@ -244,7 +244,7 @@ bool MemorySanitizer::doInitialization(Module &M) {
|
|||
appendToGlobalCtors(M, cast<Function>(M.getOrInsertFunction(
|
||||
"__msan_init", IRB.getVoidTy(), NULL)), 0);
|
||||
|
||||
new GlobalVariable(M, IRB.getInt32Ty(), true, GlobalValue::LinkOnceODRLinkage,
|
||||
new GlobalVariable(M, IRB.getInt32Ty(), true, GlobalValue::WeakODRLinkage,
|
||||
IRB.getInt32(ClTrackOrigins), "__msan_track_origins");
|
||||
|
||||
// Create the callback.
|
||||
|
|
|
@ -4,6 +4,9 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
|
|||
; Check the presence of __msan_init
|
||||
; CHECK: @llvm.global_ctors {{.*}} @__msan_init
|
||||
|
||||
; Check the presence and the linkage type of __msan_track_origins
|
||||
; CHECK: @__msan_track_origins = weak_odr constant i32 0
|
||||
|
||||
; load followed by cmp: check that we load the shadow and call __msan_warning.
|
||||
define void @LoadAndCmp(i32* nocapture %a) nounwind uwtable {
|
||||
entry:
|
||||
|
|
Loading…
Reference in New Issue