[clang] Update remaining tests for usage of CLANG_RESOURCE_DIR (PR #202475)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 12 20:17:15 PDT 2026
https://github.com/dyung updated https://github.com/llvm/llvm-project/pull/202475
>From 0d682c92de9f30de85a4f25f5f64d66060ae3a8a Mon Sep 17 00:00:00 2001
From: Douglas Yung <douglas.yung at sony.com>
Date: Sun, 10 May 2026 10:25:21 -0700
Subject: [PATCH 01/10] Fix test clang/test/Driver/hexagon-toolchain-picolibc.c
when using CLANG_RESOURCE_DIR.
---
clang/test/Driver/hexagon-toolchain-picolibc.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/clang/test/Driver/hexagon-toolchain-picolibc.c b/clang/test/Driver/hexagon-toolchain-picolibc.c
index 8282a4da81636..77295c4347810 100644
--- a/clang/test/Driver/hexagon-toolchain-picolibc.c
+++ b/clang/test/Driver/hexagon-toolchain-picolibc.c
@@ -4,14 +4,14 @@
// Test standard include paths
// -----------------------------------------------------------------------------
// RUN: %clang -### --target=hexagon-none-elf --cstdlib=picolibc \
-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-C-INCLUDES %s
-// CHECK-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{/|\\\\}}clang{{/|\\\\}}{{[0-9]+}}{{/|\\\\}}include"
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-C-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
+// CHECK-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "[[RESOURCE_DIR]]/include"
// CHECK-C-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-none-elf{{/|\\\\}}include"
// RUN: %clangxx -### --target=hexagon-none-elf --cstdlib=picolibc \
-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-CXX-INCLUDES %s
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-CXX-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
// CHECK-CXX-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-none-elf{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
-// CHECK-CXX-INCLUDES: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{/|\\\\}}clang{{/|\\\\}}{{[0-9]+}}{{/|\\\\}}include"
+// CHECK-CXX-INCLUDES: "-internal-isystem" "[[RESOURCE_DIR]]/include"
// CHECK-CXX-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-none-elf{{/|\\\\}}include"
// -----------------------------------------------------------------------------
// Passing start files for Picolibc
@@ -128,14 +128,14 @@
// Test standard include paths for H2
// -----------------------------------------------------------------------------
// RUN: %clang -### --target=hexagon-h2-elf --cstdlib=picolibc \
-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-H2-C-INCLUDES %s
-// CHECK-H2-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{/|\\\\}}clang{{/|\\\\}}{{[0-9]+}}{{/|\\\\}}include"
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-H2-C-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
+// CHECK-H2-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "[[RESOURCE_DIR]]/include"
// CHECK-H2-C-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-h2-elf{{/|\\\\}}include"
// RUN: %clangxx -### --target=hexagon-h2-elf --cstdlib=picolibc \
-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-H2-CXX-INCLUDES %s
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-H2-CXX-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
// CHECK-H2-CXX-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-h2-elf{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
-// CHECK-H2-CXX-INCLUDES: "-internal-isystem" "{{.*}}{{/|\\\\}}lib{{/|\\\\}}clang{{/|\\\\}}{{[0-9]+}}{{/|\\\\}}include"
+// CHECK-H2-CXX-INCLUDES: "-internal-isystem" "[[RESOURCE_DIR]]/include"
// CHECK-H2-CXX-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-h2-elf{{/|\\\\}}include"
// -----------------------------------------------------------------------------
>From 7adcc906fa48a8ba6200cd0c8f62faf567642166 Mon Sep 17 00:00:00 2001
From: Douglas Yung <douglas.yung at sony.com>
Date: Sun, 10 May 2026 10:25:50 -0700
Subject: [PATCH 02/10] Fix test clang/test/Driver/hip-include-path.hip when
using CLANG_RESOURCE_DIR.
---
clang/test/Driver/hip-include-path.hip | 32 +++++++++++++-------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/clang/test/Driver/hip-include-path.hip b/clang/test/Driver/hip-include-path.hip
index 3c7384ab98354..726da8915fa68 100644
--- a/clang/test/Driver/hip-include-path.hip
+++ b/clang/test/Driver/hip-include-path.hip
@@ -2,50 +2,50 @@
// RUN: %clang -c -### --target=x86_64-unknown-linux-gnu --cuda-gpu-arch=gfx900 \
// RUN: -std=c++11 --rocm-path=%S/Inputs/rocm -nogpulib %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,CLANG,HIP %s
+// RUN: | FileCheck -check-prefixes=COMMON,CLANG,HIP -DRESOURCE_DIR=%clang-resource-dir %s
// RUN: %clang -c -### --target=x86_64-unknown-linux-gnu --cuda-gpu-arch=gfx900 \
// RUN: -std=c++11 --rocm-path=%S/Inputs/rocm -nobuiltininc -nogpulib %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,NOCLANG,HIP %s
+// RUN: | FileCheck -check-prefixes=COMMON,NOCLANG,HIP -DRESOURCE_DIR=%clang-resource-dir %s
// RUN: %clang -c -### --target=x86_64-unknown-linux-gnu --cuda-gpu-arch=gfx900 \
// RUN: -std=c++11 --rocm-path=%S/Inputs/rocm -nogpuinc -nogpulib %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,CLANG,NOHIP %s
+// RUN: | FileCheck -check-prefixes=COMMON,CLANG,NOHIP -DRESOURCE_DIR=%clang-resource-dir %s
// RUN: %clang -c -### --target=x86_64-unknown-linux-gnu --cuda-gpu-arch=gfx900 \
// RUN: -std=c++11 --rocm-path=%S/Inputs/rocm --no-offload-inc -nogpulib --offload-inc %s 2>&1 \
-// RUN: | FileCheck -check-prefixes=COMMON,CLANG,HIP %s
+// RUN: | FileCheck -check-prefixes=COMMON,CLANG,HIP -DRESOURCE_DIR=%clang-resource-dir %s
// COMMON-LABEL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
-// CLANG-SAME: "-internal-isystem" "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include/cuda_wrappers"
-// NOCLANG-NOT: "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include/cuda_wrappers"
+// CLANG-SAME: "-internal-isystem" "[[RESOURCE_DIR]]/include/cuda_wrappers"
+// NOCLANG-NOT: "[[RESOURCE_DIR]]/include/cuda_wrappers"
// HIP-SAME: "-idirafter" "{{[^"]*}}Inputs/rocm/include"
// HIP-SAME: "-include" "__clang_hip_runtime_wrapper.h"
// NOHIP-NOT: "-include" "__clang_hip_runtime_wrapper.h"
// skip check of standard C++ include path
-// CLANG-SAME: "-internal-isystem" "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include"
-// NOCLANG-NOT: "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include"
+// CLANG-SAME: "-internal-isystem" "[[RESOURCE_DIR]]/include"
+// NOCLANG-NOT: [[RESOURCE_DIR]]/include"
// NOHIP-NOT: "{{.*}}Inputs/rocm/include"
// COMMON-LABEL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
-// CLANG-SAME: "-internal-isystem" "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include/cuda_wrappers"
-// NOCLANG-NOT: "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include/cuda_wrappers"
+// CLANG-SAME: "-internal-isystem" "[[RESOURCE_DIR]]/include/cuda_wrappers"
+// NOCLANG-NOT: "[[RESOURCE_DIR]]/include/cuda_wrappers"
// HIP-SAME: "-idirafter" "{{[^"]*}}Inputs/rocm/include"
// HIP-SAME: "-include" "__clang_hip_runtime_wrapper.h"
// NOHIP-NOT: "-include" "__clang_hip_runtime_wrapper.h"
// skip check of standard C++ include path
-// CLANG-SAME: "-internal-isystem" "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include"
-// NOCLANG-NOT: "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include"
+// CLANG-SAME: "-internal-isystem" "[[RESOURCE_DIR]]/include"
+// NOCLANG-NOT: "[[RESOURCE_DIR]]/include"
// NOHIP-NOT: "{{.*}}Inputs/rocm/include"
// RUN: %clang -c -### --target=x86_64-unknown-linux-gnu --cuda-gpu-arch=gfx900 \
// RUN: -std=c++11 --rocm-path=%S/Inputs/rocm -nogpulib %s 2>&1 \
-// RUN: --hip-version=3.5 | FileCheck -check-prefixes=ROCM35 %s
+// RUN: --hip-version=3.5 | FileCheck -check-prefixes=ROCM35 -DRESOURCE_DIR=%clang-resource-dir %s
// ROCM35-LABEL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
-// ROCM35-NOT: "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include/cuda_wrappers"
-// ROCM35-SAME: "-internal-isystem" "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}"
+// ROCM35-NOT: "[[RESOURCE_DIR]]/include/cuda_wrappers"
+// ROCM35-SAME: "-internal-isystem" "[[RESOURCE_DIR]]"
// ROCM35-SAME: "-idirafter" "{{[^"]*}}Inputs/rocm/include"
// ROCM35-NOT: "-include" "__clang_hip_runtime_wrapper.h"
// skip check of standard C++ include path
-// ROCM35-SAME: "-internal-isystem" "{{[^"]*}}/lib{{[^"]*}}/clang/{{[^"]*}}/include"
+// ROCM35-SAME: "-internal-isystem" "[[RESOURCE_DIR]]/include"
>From c81f31bdcfe0e6c85c85648627149195c222ca25 Mon Sep 17 00:00:00 2001
From: Douglas Yung <douglas.yung at sony.com>
Date: Sun, 10 May 2026 10:26:07 -0700
Subject: [PATCH 03/10] Fix test clang/test/Preprocessor/iwithprefix.c when
using CLANG_RESOURCE_DIR.
---
clang/test/Preprocessor/iwithprefix.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/clang/test/Preprocessor/iwithprefix.c b/clang/test/Preprocessor/iwithprefix.c
index 70d2abcd374ca..1eba5e3ed8134 100644
--- a/clang/test/Preprocessor/iwithprefix.c
+++ b/clang/test/Preprocessor/iwithprefix.c
@@ -5,10 +5,10 @@
// RUN: %clang_cc1 -triple x86_64-unknown-unknown \
// RUN: -iprefix %t.tmps/ -iwithprefix second \
// RUN: -isystem %t.tmps/first -v %s 2> %t.out
-// RUN: FileCheck %s < %t.out
+// RUN: FileCheck %s -DRESOURCE_DIR=%clang-resource-dir < %t.out
// CHECK: #include <...> search starts here:
// CHECK: {{.*}}.tmps/first
-// CHECK: {{/|\\}}clang{{/|\\}}{{[.0-9]+}}{{/|\\}}include
+// CHECK: [[RESOURCE_DIR]]{{[\/]}}include
// CHECK: {{.*}}.tmps/second
// CHECK-NOT: {{.*}}.tmps
>From 55b837bd43c1a53a5e32f63210d6c66579c6d7b5 Mon Sep 17 00:00:00 2001
From: Douglas Yung <douglas.yung at sony.com>
Date: Tue, 9 Jun 2026 11:55:27 -0400
Subject: [PATCH 04/10] Fix missing ".
---
clang/test/Driver/hip-include-path.hip | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/test/Driver/hip-include-path.hip b/clang/test/Driver/hip-include-path.hip
index 726da8915fa68..55acfc5e2b915 100644
--- a/clang/test/Driver/hip-include-path.hip
+++ b/clang/test/Driver/hip-include-path.hip
@@ -24,7 +24,7 @@
// NOHIP-NOT: "-include" "__clang_hip_runtime_wrapper.h"
// skip check of standard C++ include path
// CLANG-SAME: "-internal-isystem" "[[RESOURCE_DIR]]/include"
-// NOCLANG-NOT: [[RESOURCE_DIR]]/include"
+// NOCLANG-NOT: "[[RESOURCE_DIR]]/include"
// NOHIP-NOT: "{{.*}}Inputs/rocm/include"
// COMMON-LABEL: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
>From 3a43323cd5bbdca5bc2224f3aacf0b272fbcda6b Mon Sep 17 00:00:00 2001
From: Douglas Yung <douglas.yung at sony.com>
Date: Tue, 9 Jun 2026 11:57:44 -0400
Subject: [PATCH 05/10] Put original path separator regex back.
---
clang/test/Preprocessor/iwithprefix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/test/Preprocessor/iwithprefix.c b/clang/test/Preprocessor/iwithprefix.c
index 1eba5e3ed8134..9c3d565785aed 100644
--- a/clang/test/Preprocessor/iwithprefix.c
+++ b/clang/test/Preprocessor/iwithprefix.c
@@ -9,6 +9,6 @@
// CHECK: #include <...> search starts here:
// CHECK: {{.*}}.tmps/first
-// CHECK: [[RESOURCE_DIR]]{{[\/]}}include
+// CHECK: [[RESOURCE_DIR]]{{/|\\}}include
// CHECK: {{.*}}.tmps/second
// CHECK-NOT: {{.*}}.tmps
>From 19da05829adff20677e730370f5a8b4678e78643 Mon Sep 17 00:00:00 2001
From: Douglas Yung <douglas.yung at sony.com>
Date: Tue, 9 Jun 2026 19:08:24 -0400
Subject: [PATCH 06/10] Modify test to accept either / or \ path separators.
---
clang/test/Driver/hexagon-toolchain-picolibc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/clang/test/Driver/hexagon-toolchain-picolibc.c b/clang/test/Driver/hexagon-toolchain-picolibc.c
index 77295c4347810..7a50c52faf430 100644
--- a/clang/test/Driver/hexagon-toolchain-picolibc.c
+++ b/clang/test/Driver/hexagon-toolchain-picolibc.c
@@ -5,13 +5,13 @@
// -----------------------------------------------------------------------------
// RUN: %clang -### --target=hexagon-none-elf --cstdlib=picolibc \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-C-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
-// CHECK-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "[[RESOURCE_DIR]]/include"
+// CHECK-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\}}include"
// CHECK-C-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-none-elf{{/|\\\\}}include"
// RUN: %clangxx -### --target=hexagon-none-elf --cstdlib=picolibc \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-CXX-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
// CHECK-CXX-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-none-elf{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
-// CHECK-CXX-INCLUDES: "-internal-isystem" "[[RESOURCE_DIR]]/include"
+// CHECK-CXX-INCLUDES: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\}}include"
// CHECK-CXX-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-none-elf{{/|\\\\}}include"
// -----------------------------------------------------------------------------
// Passing start files for Picolibc
@@ -129,13 +129,13 @@
// -----------------------------------------------------------------------------
// RUN: %clang -### --target=hexagon-h2-elf --cstdlib=picolibc \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-H2-C-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
-// CHECK-H2-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "[[RESOURCE_DIR]]/include"
+// CHECK-H2-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\}}include"
// CHECK-H2-C-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-h2-elf{{/|\\\\}}include"
// RUN: %clangxx -### --target=hexagon-h2-elf --cstdlib=picolibc \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-H2-CXX-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
// CHECK-H2-CXX-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-h2-elf{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
-// CHECK-H2-CXX-INCLUDES: "-internal-isystem" "[[RESOURCE_DIR]]/include"
+// CHECK-H2-CXX-INCLUDES: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\}}include"
// CHECK-H2-CXX-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-h2-elf{{/|\\\\}}include"
// -----------------------------------------------------------------------------
>From 77419ee5a110fd28844251376a35984b65847779 Mon Sep 17 00:00:00 2001
From: Douglas Yung <douglas.yung at sony.com>
Date: Wed, 10 Jun 2026 13:30:30 -0400
Subject: [PATCH 07/10] Attempt to fix windows path separators again.
---
clang/test/Driver/hexagon-toolchain-picolibc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/clang/test/Driver/hexagon-toolchain-picolibc.c b/clang/test/Driver/hexagon-toolchain-picolibc.c
index 7a50c52faf430..6b6ef51df5cd3 100644
--- a/clang/test/Driver/hexagon-toolchain-picolibc.c
+++ b/clang/test/Driver/hexagon-toolchain-picolibc.c
@@ -5,13 +5,13 @@
// -----------------------------------------------------------------------------
// RUN: %clang -### --target=hexagon-none-elf --cstdlib=picolibc \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-C-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
-// CHECK-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\}}include"
+// CHECK-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
// CHECK-C-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-none-elf{{/|\\\\}}include"
// RUN: %clangxx -### --target=hexagon-none-elf --cstdlib=picolibc \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-CXX-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
// CHECK-CXX-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-none-elf{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
-// CHECK-CXX-INCLUDES: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\}}include"
+// CHECK-CXX-INCLUDES: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
// CHECK-CXX-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-none-elf{{/|\\\\}}include"
// -----------------------------------------------------------------------------
// Passing start files for Picolibc
@@ -129,13 +129,13 @@
// -----------------------------------------------------------------------------
// RUN: %clang -### --target=hexagon-h2-elf --cstdlib=picolibc \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-H2-C-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
-// CHECK-H2-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\}}include"
+// CHECK-H2-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
// CHECK-H2-C-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-h2-elf{{/|\\\\}}include"
// RUN: %clangxx -### --target=hexagon-h2-elf --cstdlib=picolibc \
// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-H2-CXX-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
// CHECK-H2-CXX-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-h2-elf{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
-// CHECK-H2-CXX-INCLUDES: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\}}include"
+// CHECK-H2-CXX-INCLUDES: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
// CHECK-H2-CXX-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-h2-elf{{/|\\\\}}include"
// -----------------------------------------------------------------------------
>From 80971264e3a6420a5bd75cecd8eaafc60c3db4f9 Mon Sep 17 00:00:00 2001
From: Douglas Yung <douglas.yung at sony.com>
Date: Fri, 12 Jun 2026 17:33:25 -0400
Subject: [PATCH 08/10] Add escaping for path separators when running on
Windows.
---
clang/test/lit.cfg.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index fbf92e500975f..18889147ca565 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -425,6 +425,8 @@ def calculate_arch_features(arch_string):
clang_resource_dir = subprocess.run(
[config.clang, "-print-resource-dir"], stdout=subprocess.PIPE, text=True
).stdout.rstrip()
+ if platform.system() is "Windows":
+ clang_resource_dir = clang_resource_dir.replace('\\', '\\\\')
config.substitutions.append(("%clang-resource-dir", clang_resource_dir))
# Check if we should allow outputs to console.
>From f05ec84b45887fe215916f104b4052f122c30571 Mon Sep 17 00:00:00 2001
From: Douglas Yung <douglas.yung at sony.com>
Date: Fri, 12 Jun 2026 22:25:00 -0400
Subject: [PATCH 09/10] Revert "Add escaping for path separators when running
on Windows."
This reverts commit 80971264e3a6420a5bd75cecd8eaafc60c3db4f9.
---
clang/test/lit.cfg.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index 18889147ca565..fbf92e500975f 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -425,8 +425,6 @@ def calculate_arch_features(arch_string):
clang_resource_dir = subprocess.run(
[config.clang, "-print-resource-dir"], stdout=subprocess.PIPE, text=True
).stdout.rstrip()
- if platform.system() is "Windows":
- clang_resource_dir = clang_resource_dir.replace('\\', '\\\\')
config.substitutions.append(("%clang-resource-dir", clang_resource_dir))
# Check if we should allow outputs to console.
>From 2b80592d3c633564bbae28a221a5c4381348c338 Mon Sep 17 00:00:00 2001
From: Douglas Yung <douglas.yung at sony.com>
Date: Fri, 12 Jun 2026 23:16:44 -0400
Subject: [PATCH 10/10] Try another approach to fix the test on Windows.
---
clang/test/Driver/hexagon-toolchain-picolibc.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/clang/test/Driver/hexagon-toolchain-picolibc.c b/clang/test/Driver/hexagon-toolchain-picolibc.c
index 6b6ef51df5cd3..5d56ae8ff56ed 100644
--- a/clang/test/Driver/hexagon-toolchain-picolibc.c
+++ b/clang/test/Driver/hexagon-toolchain-picolibc.c
@@ -1,15 +1,19 @@
// REQUIRES: hexagon-registered-target
+// Escape the value of clang-resource-dir if needed (mainly on Windows)
+// RUN: rm -rf %t && mkdir %t
+// RUN: echo %clang-resource-dir | tr -d '\n' | sed 's/\\/\\\\/g' > %t/resource-dir
+
// -----------------------------------------------------------------------------
// Test standard include paths
// -----------------------------------------------------------------------------
// RUN: %clang -### --target=hexagon-none-elf --cstdlib=picolibc \
-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-C-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-C-INCLUDES -DRESOURCE_DIR="%{readfile:%t/resource-dir}" %s
// CHECK-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
// CHECK-C-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-none-elf{{/|\\\\}}include"
// RUN: %clangxx -### --target=hexagon-none-elf --cstdlib=picolibc \
-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-CXX-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-CXX-INCLUDES -DRESOURCE_DIR="%{readfile:%t/resource-dir}" %s
// CHECK-CXX-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-none-elf{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
// CHECK-CXX-INCLUDES: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
// CHECK-CXX-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-none-elf{{/|\\\\}}include"
@@ -128,12 +132,12 @@
// Test standard include paths for H2
// -----------------------------------------------------------------------------
// RUN: %clang -### --target=hexagon-h2-elf --cstdlib=picolibc \
-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-H2-C-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-H2-C-INCLUDES -DRESOURCE_DIR="%{readfile:%t/resource-dir}" %s
// CHECK-H2-C-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
// CHECK-H2-C-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-h2-elf{{/|\\\\}}include"
// RUN: %clangxx -### --target=hexagon-h2-elf --cstdlib=picolibc \
-// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-H2-CXX-INCLUDES -DRESOURCE_DIR=%clang-resource-dir %s
+// RUN: -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin %s 2>&1 | FileCheck -check-prefix=CHECK-H2-CXX-INCLUDES -DRESOURCE_DIR="%{readfile:%t/resource-dir}" %s
// CHECK-H2-CXX-INCLUDES: "-cc1" {{.*}} "-internal-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-h2-elf{{/|\\\\}}include{{/|\\\\}}c++{{/|\\\\}}v1"
// CHECK-H2-CXX-INCLUDES: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
// CHECK-H2-CXX-INCLUDES: "-internal-externc-isystem" "{{.*}}{{/|\\\\}}Inputs{{/|\\\\}}hexagon_tree{{/|\\\\}}Tools{{/|\\\\}}bin{{/|\\\\}}..{{/|\\\\}}target{{/|\\\\}}picolibc{{/|\\\\}}hexagon-unknown-h2-elf{{/|\\\\}}include"
More information about the cfe-commits
mailing list