[clang] d78ceeb - [Clang] Fix failing test on windows and add TODO for gpu headers

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 3 14:54:32 PDT 2023


Author: Joseph Huber
Date: 2023-04-03T16:54:22-05:00
New Revision: d78ceeba986b5ebe83f935175e584c346a52b8a3

URL: https://github.com/llvm/llvm-project/commit/d78ceeba986b5ebe83f935175e584c346a52b8a3
DIFF: https://github.com/llvm/llvm-project/commit/d78ceeba986b5ebe83f935175e584c346a52b8a3.diff

LOG: [Clang] Fix failing test on windows and add TODO for gpu headers

Summary:
This test failed because of the path separators on Windows. Also this
was a good excuse to add an extra TODO that @tra wanted.

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Clang.cpp
    clang/test/Driver/gpu-libc-headers.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index a17db9b9ceb7..65238830a57b 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -1166,8 +1166,9 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA,
        getToolChain().getTriple().isAMDGCN())) {
 
       // Add include/gpu-none-libc/* to our system include path. This lets us use
-      // GPU-specific system headers first. These headers should be made to be
-      // compatible with the host environment's headers.
+      // GPU-specific system headers first. 
+      // TODO: We need to find a way to make these headers compatible with the
+      // host environment.
       SmallString<128> P(llvm::sys::path::parent_path(D.InstalledDir));
       llvm::sys::path::append(P, "include");
       llvm::sys::path::append(P, "gpu-none-llvm");

diff  --git a/clang/test/Driver/gpu-libc-headers.c b/clang/test/Driver/gpu-libc-headers.c
index c8f772f102d0..9437d3ed39a9 100644
--- a/clang/test/Driver/gpu-libc-headers.c
+++ b/clang/test/Driver/gpu-libc-headers.c
@@ -11,7 +11,7 @@
 // RUN:     FileCheck %s --check-prefix=CHECK-HEADERS
 // RUN:   %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx1030 -nogpulib --sysroot=./ %s 2>&1 | \
 // RUN:     FileCheck %s --check-prefix=CHECK-HEADERS
-// CHECK-HEADERS: "-cc1"{{.*}}"-c-isystem" "{{.*}}include/gpu-none-llvm"{{.*}}"-isysroot" "./"
+// CHECK-HEADERS: "-cc1"{{.*}}"-c-isystem" "{{.*}}include{{.*}}gpu-none-llvm"{{.*}}"-isysroot" "./"
 
 // RUN:   %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx1030 -nogpulib \
 // RUN:     -nogpuinc %s 2>&1 | FileCheck %s --check-prefix=CHECK-HEADERS-DISABLED
@@ -19,4 +19,4 @@
 // RUN:     -nostdinc %s 2>&1 | FileCheck %s --check-prefix=CHECK-HEADERS-DISABLED
 // RUN:   %clang -### --target=amdgcn-amd-amdhsa -mcpu=gfx1030 -nogpulib \
 // RUN:     -nobuiltininc %s 2>&1 | FileCheck %s --check-prefix=CHECK-HEADERS-DISABLED
-// CHECK-HEADERS-DISABLED-NOT: "-cc1"{{.*}}"-c-isystem" "{{.*}}include/gpu-none-llvm"
+// CHECK-HEADERS-DISABLED-NOT: "-cc1"{{.*}}"-c-isystem" "{{.*}}include{{.*}}gpu-none-llvm"


        


More information about the cfe-commits mailing list