From 25dc6c8a08d1c41a6224dea2f50d85c8c8ed54c5 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 3 Mar 2015 05:39:27 +0000 Subject: [PATCH] Cleanup after r230934 per Dave's suggestions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231056 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/LLParser.cpp | 7 ++++--- test/Assembler/getelementptr_invalid_ptr.ll | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index de566b6cdfc..925af4e17e1 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -5460,11 +5460,12 @@ int LLParser::ParseGetElementPtr(Instruction *&Inst, PerFunctionState &PFS) { return true; Type *PtrTy = Ptr->getType(); - if (!isa(PtrTy)) - return Error(Loc, "pointer type is not valid"); if (VectorType *VT = dyn_cast(PtrTy)) PtrTy = VT->getElementType(); - if (Ty != cast(PtrTy)->getElementType()) + SequentialType *SeqPtrTy = dyn_cast(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"); diff --git a/test/Assembler/getelementptr_invalid_ptr.ll b/test/Assembler/getelementptr_invalid_ptr.ll index 8296dd37a0a..ff12debc1bc 100644 --- a/test/Assembler/getelementptr_invalid_ptr.ll +++ b/test/Assembler/getelementptr_invalid_ptr.ll @@ -1,5 +1,4 @@ -; 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 -- 2.34.1