aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2017-01-24 06:13:47 +0000
committerLang Hames <lhames@gmail.com>2017-01-24 06:13:47 +0000
commit0a70023c73d0d4cac696878878c0bdfb5e77ec6a (patch)
tree5c5b1d1e3bd96d2800c7da03a3f70cd80d164b33 /llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
parent3ca38564cb27828417f1f4a478e26ad820fc2a3f (diff)
downloadllvm-0a70023c73d0d4cac696878878c0bdfb5e77ec6a.zip
llvm-0a70023c73d0d4cac696878878c0bdfb5e77ec6a.tar.gz
llvm-0a70023c73d0d4cac696878878c0bdfb5e77ec6a.tar.bz2
[Orc][RPC] Refactor ParallelCallGroup to decouple it from RPCEndpoint.
This refactor allows parallel calls to be made via an arbitrary async call dispatcher. In particular, this allows ParallelCallGroup to be used with derived RPC classes that expose custom async RPC call operations. llvm-svn: 292891
Diffstat (limited to 'llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp')
-rw-r--r--llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
index 9abf401..d21a4ac 100644
--- a/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/RPCUtilsTest.cpp
@@ -405,10 +405,11 @@ TEST(DummyRPC, TestParallelCallGroup) {
{
int A, B, C;
- ParallelCallGroup<DummyRPCEndpoint> PCG(Client);
+ ParallelCallGroup PCG;
{
- auto Err = PCG.appendCall<DummyRPCAPI::IntInt>(
+ auto Err = PCG.call(
+ rpcAsyncDispatch<DummyRPCAPI::IntInt>(Client),
[&A](Expected<int> Result) {
EXPECT_TRUE(!!Result) << "Async int(int) response handler failed";
A = *Result;
@@ -418,7 +419,8 @@ TEST(DummyRPC, TestParallelCallGroup) {
}
{
- auto Err = PCG.appendCall<DummyRPCAPI::IntInt>(
+ auto Err = PCG.call(
+ rpcAsyncDispatch<DummyRPCAPI::IntInt>(Client),
[&B](Expected<int> Result) {
EXPECT_TRUE(!!Result) << "Async int(int) response handler failed";
B = *Result;
@@ -428,7 +430,8 @@ TEST(DummyRPC, TestParallelCallGroup) {
}
{
- auto Err = PCG.appendCall<DummyRPCAPI::IntInt>(
+ auto Err = PCG.call(
+ rpcAsyncDispatch<DummyRPCAPI::IntInt>(Client),
[&C](Expected<int> Result) {
EXPECT_TRUE(!!Result) << "Async int(int) response handler failed";
C = *Result;
@@ -443,10 +446,7 @@ TEST(DummyRPC, TestParallelCallGroup) {
EXPECT_FALSE(!!Err) << "Client failed to handle response from void(bool)";
}
- {
- auto Err = PCG.wait();
- EXPECT_FALSE(!!Err) << "Third parallel call failed for int(int)";
- }
+ PCG.wait();
EXPECT_EQ(A, 2) << "First parallel call returned bogus result";
EXPECT_EQ(B, 4) << "Second parallel call returned bogus result";