From 6bd4d717d577b88e83a92ea865bb96dd5df45936 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Fri, 17 Mar 2023 14:06:53 -0500 Subject: [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 --- libc/startup/gpu/amdgpu/start.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libc/startup') 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); } -- cgit v1.1