[Clang] Fix failing test on windows and add TODO for gpu headers
authorJoseph Huber <jhuber6@vols.utk.edu>
Mon, 3 Apr 2023 21:53:41 +0000 (16:53 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Mon, 3 Apr 2023 21:54:22 +0000 (16:54 -0500)
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.

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

index a17db9b..6523883 100644 (file)
@@ -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");
index c8f772f..9437d3e 100644 (file)
@@ -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"