[clang] [llvm] [Darwin][Clang][PGO] Pass CSPGO related flags to ld when using libLTO.dylib (PR #195020)
Henry Jiang via cfe-commits
cfe-commits at lists.llvm.org
Fri May 1 11:07:55 PDT 2026
================
@@ -0,0 +1,21 @@
+; REQUIRES: aarch64-registered-target
+;
+; RUN: llvm-profdata merge %S/Inputs/cspgo-noncs.proftext -o %t.profdata
+; RUN: opt -module-summary %s -o %t.o
+; RUN: llvm-lto -thinlto-action=optimize \
+; RUN: -cs-profile-generate -cs-profile-path=%t.profdata \
----------------
mustartt wrote:
Thanks for taking a look.
> Is there a way to write a test to make sure the generated path is correctly applied?
On the `-cs-profile-generate`, there really isn't a good way to test that the path is applied correctly. But we can verify that `-cs-profile-path` is correctly forwarded implicitly when using `-fcs-profile-use`. So I think testing it here should be sufficient for this use case.
> Also it will be good to have a test for profile-use as well.
Added a `-fcs-profile-use` test case for thinlto.
https://github.com/llvm/llvm-project/pull/195020
More information about the cfe-commits
mailing list