diff options
author | S. VenkataKeerthy <31350914+svkeerthy@users.noreply.github.com> | 2025-06-30 20:31:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-30 20:31:47 -0700 |
commit | 0a69c83421ac69c60eb0122201569f36272312b0 (patch) | |
tree | f06f253e3427f4be9047bb3c709647a887ecf4a7 /llvm/unittests/Analysis | |
parent | 66cc167dfa5bec4b036b3599de5f1878488dec36 (diff) | |
download | llvm-0a69c83421ac69c60eb0122201569f36272312b0.zip llvm-0a69c83421ac69c60eb0122201569f36272312b0.tar.gz llvm-0a69c83421ac69c60eb0122201569f36272312b0.tar.bz2 |
[NFC][IR2Vec] Remove unreachable code and simplify invalid mode test (#146459)
The code following `llvm_unreachable` is optimized out in Release builds. In this case, `Embedder::create` do not seem to return `nullptr` causing `CreateInvalidMode` test to break. Hence removing `llvm_unreachable`.
Diffstat (limited to 'llvm/unittests/Analysis')
-rw-r--r-- | llvm/unittests/Analysis/IR2VecTest.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/llvm/unittests/Analysis/IR2VecTest.cpp b/llvm/unittests/Analysis/IR2VecTest.cpp index 05af55b..ba0e4e2 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<IR2VecKind>(-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<IR2VecKind>(-1), *F, V); EXPECT_FALSE(static_cast<bool>(Result)); -#endif // NDEBUG } TEST(IR2VecTest, LookupVocab) { |