[llvm] 05eeb60 - [RGT] RPCUtilsTest, replace un-executed EXPECT with unreachable

Paul Robinson via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 17 07:38:14 PDT 2021


Author: Paul Robinson
Date: 2021-03-17T07:37:21-07:00
New Revision: 05eeb6077a13aaa5118d6a3f291952710ed84142

URL: https://github.com/llvm/llvm-project/commit/05eeb6077a13aaa5118d6a3f291952710ed84142
DIFF: https://github.com/llvm/llvm-project/commit/05eeb6077a13aaa5118d6a3f291952710ed84142.diff

LOG: [RGT] RPCUtilsTest, replace un-executed EXPECT with unreachable

Unreachable code should be self-documented as unreachable.

Found by the Rotten Green Tests project.

Differential Revision: https://reviews.llvm.org/D98518

Added: 
    

Modified: 
    llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
index 1ad13e8b4e20..0f5cb14fec37 100644
--- a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
@@ -871,8 +871,7 @@ TEST(DummyRPC, TestRemoveHandler) {
 
   Server.addHandler<DummyRPCAPI::VoidBool>(
     [](bool B) {
-      EXPECT_EQ(B, true)
-        << "Server void(bool) received unexpected result";
+      llvm_unreachable("Server void(bool) received unexpected result");
     });
 
   Server.removeHandler<DummyRPCAPI::VoidBool>();
@@ -884,8 +883,7 @@ TEST(DummyRPC, TestClearHandlers) {
 
   Server.addHandler<DummyRPCAPI::VoidBool>(
     [](bool B) {
-      EXPECT_EQ(B, true)
-        << "Server void(bool) received unexpected result";
+      llvm_unreachable("Server void(bool) received unexpected result");
     });
 
   Server.clearHandlers();


        


More information about the llvm-commits mailing list