return true;
Type *PtrTy = Ptr->getType();
- if (!isa<SequentialType>(PtrTy))
- return Error(Loc, "pointer type is not valid");
if (VectorType *VT = dyn_cast<VectorType>(PtrTy))
PtrTy = VT->getElementType();
- if (Ty != cast<SequentialType>(PtrTy)->getElementType())
+ SequentialType *SeqPtrTy = dyn_cast<SequentialType>(PtrTy);
+ if (!SeqPtrTy)
+ return Error(Loc, "pointer type is not valid");
+ if (Ty != SeqPtrTy->getElementType())
return Error(ExplicitTypeLoc,
"explicit pointee type doesn't match operand's pointee type");
-; RUN: not llvm-as < %s >/dev/null 2> %t
-; RUN: FileCheck %s < %t
+; RUN: not llvm-as < %s 2>&1 | FileCheck %s
; Test the case of an invalid pointer type on a GEP
; CHECK: pointer type is not valid