summaryrefslogtreecommitdiff
path: root/libc/utils
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2023-04-14 09:24:00 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2023-04-19 20:02:32 -0500
commit0bd564a259e1647343e3137abe6b618d7ad09c18 (patch)
treea3aaf1812f47d912fe363c570425f5797d6c8f00 /libc/utils
parentd0ff5e40308ee33936bfcc131f33adb4066b946f (diff)
downloadllvm-0bd564a259e1647343e3137abe6b618d7ad09c18.tar.gz
[libc] Add a test to directly stimulate the RPC interface
Currently, the RPC interface with the loader is only tested if the other tests fail. This test adds a direct test that runs a simple integer increment over the RPC handshake 10000 times. Depends on https://reviews.llvm.org/D148288 Reviewed By: lntue Differential Revision: https://reviews.llvm.org/D148342
Diffstat (limited to 'libc/utils')
-rw-r--r--libc/utils/gpu/loader/Server.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/utils/gpu/loader/Server.h b/libc/utils/gpu/loader/Server.h
index 12565b0489ee..af432fcfe1fb 100644
--- a/libc/utils/gpu/loader/Server.h
+++ b/libc/utils/gpu/loader/Server.h
@@ -42,6 +42,12 @@ void handle_server() {
});
break;
}
+ case __llvm_libc::rpc::Opcode::TEST_INCREMENT: {
+ port->recv_and_send([](__llvm_libc::rpc::Buffer *buffer) {
+ reinterpret_cast<uint64_t *>(buffer->data)[0] += 1;
+ });
+ break;
+ }
default:
port->recv([](__llvm_libc::rpc::Buffer *) { /* no-op */ });
return;