[clang] [clang][driver] Add \<executable\>/../include/c++/v1 to include path on Darwin (PR #70817)

Jon Roelofs via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 13 10:31:59 PST 2023


================
@@ -172,3 +172,20 @@
 // RUN:               --check-prefix=CHECK-LIBCXX-STDLIB-UNSPECIFIED %s
 // CHECK-LIBCXX-STDLIB-UNSPECIFIED: "-cc1"
 // CHECK-LIBCXX-STDLIB-UNSPECIFIED: "-internal-isystem" "[[SYSROOT]]/usr/include/c++/v1"
+
+// Reproduce the xPack use case; there must be no include here,
+// to select the executable folder.
+// RUN: rm -rf %t/xpacks
+// RUN: mkdir -pv %t/xpacks/.bin
+// RUN: ln -svf %clang %t/xpacks/.bin/clang
+// The build folders do not include this include; create it.
+// RUN: mkdir -pv $(dirname $(which %clang))/../include/c++/v1
----------------
jroelofs wrote:

I think it would be better to create a new temporary folder with the appropriate structure, and copy the clang binary into it, then make the symlink and FileCheck the resulting cc1 paths.

Also, I don't think `ln` will work on Windows buildbots. You may need to put this test in its own file so you can add this at the top:

```
// REQUIRES: shell
// UNSUPPORTED: system-windows
```

https://github.com/llvm/llvm-project/pull/70817


More information about the cfe-commits mailing list