Also verify llvm.compiler_used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180020 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2013-04-22 15:16:51 +00:00
parent cde25b435a
commit 97bf57d488
2 changed files with 8 additions and 1 deletions

View File

@ -449,7 +449,8 @@ void Verifier::visitGlobalVariable(GlobalVariable &GV) {
}
}
if (GV.hasName() && (GV.getName() == "llvm.used")) {
if (GV.hasName() && (GV.getName() == "llvm.used" ||
GV.getName() == "llvm.compiler_used")) {
Assert1(!GV.hasInitializer() || GV.hasAppendingLinkage(),
"invalid linkage for intrinsic global variable", &GV);
Type *GVType = GV.getType()->getElementType();

View File

@ -0,0 +1,6 @@
; RUN: not llvm-as < %s -o /dev/null 2>&1 | FileCheck %s
@llvm.compiler_used = appending global [1 x i32] [i32 0], section "llvm.metadata"
; CHECK: wrong type for intrinsic global variable
; CHECK-NEXT: [1 x i32]* @llvm.compiler_used