aboutsummaryrefslogtreecommitdiff
path: root/libc/startup
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2023-03-17 14:06:53 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2023-03-20 13:16:58 -0500
commit6bd4d717d577b88e83a92ea865bb96dd5df45936 (patch)
tree59f35bdbb6a0ee7f47b3cacbb78cc8504855fe70 /libc/startup
parentd1e00b6f136ec71a4c95a7eb4fd81ec0ab547962 (diff)
downloadllvm-6bd4d717d577b88e83a92ea865bb96dd5df45936.zip
llvm-6bd4d717d577b88e83a92ea865bb96dd5df45936.tar.gz
llvm-6bd4d717d577b88e83a92ea865bb96dd5df45936.tar.bz2
[libc] Add environment variables to GPU libc test for AMDGPU
This patch performs the same operation to copy over the `argv` array to the `envp` array. This allows the GPU tests to use environment variables. Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D146322
Diffstat (limited to 'libc/startup')
-rw-r--r--libc/startup/gpu/amdgpu/start.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libc/startup/gpu/amdgpu/start.cpp b/libc/startup/gpu/amdgpu/start.cpp
index cc30982..9915dff 100644
--- a/libc/startup/gpu/amdgpu/start.cpp
+++ b/libc/startup/gpu/amdgpu/start.cpp
@@ -8,11 +8,12 @@
#include "src/__support/RPC/rpc_client.h"
-extern "C" int main(int argc, char **argv);
+extern "C" int main(int argc, char **argv, char **envp);
extern "C" [[gnu::visibility("protected"), clang::amdgpu_kernel]] void
-_start(int argc, char **argv, int *ret, void *in, void *out, void *buffer) {
+_start(int argc, char **argv, char **envp, int *ret, void *in, void *out,
+ void *buffer) {
__llvm_libc::rpc::client.reset(in, out, buffer);
- __atomic_fetch_or(ret, main(argc, argv), __ATOMIC_RELAXED);
+ __atomic_fetch_or(ret, main(argc, argv, envp), __ATOMIC_RELAXED);
}