diff options
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/lib/IR/Verifier.cpp | 7 | ||||
| -rw-r--r-- | llvm/test/Feature/comdat.ll | 3 | ||||
| -rw-r--r-- | llvm/test/Verifier/comdat2.ll | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 314bad36b15..ec7ae3a77a7 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -605,11 +605,10 @@ void Verifier::visitComdat(const Comdat &C) { Assert1(GV, "comdat selection kind requires a global value with the same name", &C); - // The Module is invalid if the GlobalValue has local linkage. Allowing - // otherwise opens us up to seeing the underling global value get renamed if - // collisions occur. + // The Module is invalid if the GlobalValue has private linkage. Entities + // with private linkage don't have entries in the symbol table. if (GV) - Assert1(!GV->hasLocalLinkage(), "comdat global value has local linkage", + Assert1(!GV->hasPrivateLinkage(), "comdat global value has private linkage", GV); } diff --git a/llvm/test/Feature/comdat.ll b/llvm/test/Feature/comdat.ll index 05fb87c648e..1e878bb71cd 100644 --- a/llvm/test/Feature/comdat.ll +++ b/llvm/test/Feature/comdat.ll @@ -16,3 +16,6 @@ define void @f() comdat $f { ret void } ; CHECK: define void @f() comdat $f + +$i = comdat largest +@i = internal global i32 0, comdat $i diff --git a/llvm/test/Verifier/comdat2.ll b/llvm/test/Verifier/comdat2.ll index 23b6cee0950..d78030c12af 100644 --- a/llvm/test/Verifier/comdat2.ll +++ b/llvm/test/Verifier/comdat2.ll @@ -2,4 +2,4 @@ $v = comdat any @v = private global i32 0, comdat $v -; CHECK: comdat global value has local linkage +; CHECK: comdat global value has private linkage |

