summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2019-09-06 19:21:59 +0000
committerLang Hames <lhames@gmail.com>2019-09-06 19:21:59 +0000
commitc1105111b39384b959edee9c91ae543d57a5a795 (patch)
tree86f75e254baa5aef8f9ddfbaba349ff0098f1700 /llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
parent335676ee62167c021c17b90489b49c1015116556 (diff)
downloadbcm5719-llvm-c1105111b39384b959edee9c91ae543d57a5a795.tar.gz
bcm5719-llvm-c1105111b39384b959edee9c91ae543d57a5a795.zip
[ORC] Make sure RPC channel-send is called in blocking calls and responses.
ORC-RPC batches calls by default, and the channel's send method must be called to transfer any buffered calls to the remote. The call to send was missing on responses and blocking calls in the SingleThreadedRPCEndpoint. This patch adds the necessary calls and modifies the RPC unit test to check for them. llvm-svn: 371245
Diffstat (limited to 'llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp')
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
index 1f7c88d93d0..8e4c5330d90 100644
--- a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
@@ -214,6 +214,17 @@ TEST(DummyRPC, TestCallAsyncVoidBool) {
EXPECT_FALSE(!!Err) << "Client failed to handle response from void(bool)";
}
+ // The client should have made two calls to send: One implicit call to
+ // negotiate the VoidBool function key, and a second to make the VoidBool
+ // call.
+ EXPECT_EQ(Channels.first->SendCalls, 2U)
+ << "Expected one send call to have been made by client";
+
+ // The server should have made two calls to send: One to send the response to
+ // the negotiate call, and another to send the response to the VoidBool call.
+ EXPECT_EQ(Channels.second->SendCalls, 2U)
+ << "Expected two send calls to have been made by server";
+
ServerThread.join();
}
OpenPOWER on IntegriCloud