diff --git a/llvm/lib/Analysis/IR2Vec.cpp b/llvm/lib/Analysis/IR2Vec.cpp index 47ad2fa139c4..895b3de58a54 100644 --- a/llvm/lib/Analysis/IR2Vec.cpp +++ b/llvm/lib/Analysis/IR2Vec.cpp @@ -129,7 +129,6 @@ std::unique_ptr Embedder::create(IR2VecKind Mode, const Function &F, case IR2VecKind::Symbolic: return std::make_unique(F, Vocabulary); } - llvm_unreachable("Unknown IR2Vec kind"); return nullptr; } diff --git a/llvm/unittests/Analysis/IR2VecTest.cpp b/llvm/unittests/Analysis/IR2VecTest.cpp index 05af55b59323..ba0e4e2825ec 100644 --- a/llvm/unittests/Analysis/IR2VecTest.cpp +++ b/llvm/unittests/Analysis/IR2VecTest.cpp @@ -228,16 +228,9 @@ TEST(IR2VecTest, CreateInvalidMode) { FunctionType *FTy = FunctionType::get(Type::getVoidTy(Ctx), false); Function *F = Function::Create(FTy, Function::ExternalLinkage, "f", M); -// static_cast an invalid int to IR2VecKind -#ifndef NDEBUG -#if GTEST_HAS_DEATH_TEST - EXPECT_DEATH(Embedder::create(static_cast(-1), *F, V), - "Unknown IR2Vec kind"); -#endif // GTEST_HAS_DEATH_TEST -#else + // static_cast an invalid int to IR2VecKind auto Result = Embedder::create(static_cast(-1), *F, V); EXPECT_FALSE(static_cast(Result)); -#endif // NDEBUG } TEST(IR2VecTest, LookupVocab) {