Verify Intrinsic::dbg_declare.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62526 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2009-01-19 21:00:48 +00:00
parent b76ace310a
commit 0153308abf
3 changed files with 8 additions and 10 deletions

View File

@ -1332,6 +1332,11 @@ void Verifier::visitIntrinsicFunctionCall(Intrinsic::ID ID, CallInst &CI) {
switch (ID) {
default:
break;
case Intrinsic::dbg_declare: // llvm.dbg.declare
if (Constant *C = dyn_cast<Constant>(CI.getOperand(1)))
Assert1(C && !isa<ConstantPointerNull>(C),
"invalid llvm.dbg.declare intrinsic call", &CI);
break;
case Intrinsic::memcpy:
case Intrinsic::memmove:
case Intrinsic::memset:

View File

@ -1,9 +0,0 @@
; RUN: llvm-as < %s | llc
declare void @llvm.dbg.declare({ }*, { }*)
define void @foo() {
call void @llvm.dbg.declare( { }* null, { }* null )
ret void
}

View File

@ -8,7 +8,9 @@ declare void @llvm.dbg.declare({ }*, { }*) nounwind
define i32 @isascii(i32 %_c) nounwind {
entry:
call void @llvm.dbg.declare({ }* null, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable24 to { }*))
%j = alloca i32
%0 = bitcast i32* %j to { }*
call void @llvm.dbg.declare({ }* %0, { }* bitcast (%llvm.dbg.variable.type* @llvm.dbg.variable24 to { }*))
unreachable
}