[lldb] [compiler-rt] [flang] [llvm] [clang] [clang-tools-extra] [mlir] [Profile] Add binary profile correlation to offload profile metadata at runtime. (PR #69493)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 9 22:38:49 PST 2023


================
@@ -0,0 +1,46 @@
+// REQUIRES: linux || windows
+// Default
+// RUN: %clang -o %t.normal -fprofile-instr-generate -fcoverage-mapping -fuse-ld=lld %S/Inputs/instrprof-debug-info-correlate-main.cpp %S/Inputs/instrprof-debug-info-correlate-foo.cpp
+// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t.normal
+// RUN: llvm-profdata merge -o %t.normal.profdata %t.profraw
+// RUN: llvm-cov report --instr-profile=%t.normal.profdata %t.normal > %t.normal.report
+// RUN: llvm-cov show --instr-profile=%t.normal.profdata %t.normal > %t.normal.show
+
+// With -profile-correlate=binary flag
+// RUN: %clang -o %t-1.exe -fprofile-instr-generate -fcoverage-mapping -mllvm -profile-correlate=binary -fuse-ld=lld %S/Inputs/instrprof-debug-info-correlate-main.cpp %S/Inputs/instrprof-debug-info-correlate-foo.cpp
----------------
MaskRay wrote:

You can omit `.exe`. Otherwise, I suspect the file will be named `%t-1.exe.exe` on Windows.

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


More information about the cfe-commits mailing list