[compiler-rt] cd861ad - [InstrProf] Fix debug-info-correlate test
Ellis Hoag via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 11 09:20:23 PDT 2023
Author: Ellis Hoag
Date: 2023-08-11T09:20:19-07:00
New Revision: cd861ad0f94dafa628829eae806d8847dbd43661
URL: https://github.com/llvm/llvm-project/commit/cd861ad0f94dafa628829eae806d8847dbd43661
DIFF: https://github.com/llvm/llvm-project/commit/cd861ad0f94dafa628829eae806d8847dbd43661.diff
LOG: [InstrProf] Fix debug-info-correlate test
The `llvm-profdata show` command is not sufficient to check that two
profiles are identical because it doesn't show the counter values. Add
the flags `--all-functions --counts` so that counter values are checked.
This was changed in https://reviews.llvm.org/D135929 but I failed to
remember that counter values were not printed by default.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D157665
Added:
Modified:
compiler-rt/test/profile/Darwin/instrprof-debug-info-correlate.c
compiler-rt/test/profile/Linux/instrprof-debug-info-correlate.c
Removed:
################################################################################
diff --git a/compiler-rt/test/profile/Darwin/instrprof-debug-info-correlate.c b/compiler-rt/test/profile/Darwin/instrprof-debug-info-correlate.c
index 5d877ae0d037a0..325e27503f3530 100644
--- a/compiler-rt/test/profile/Darwin/instrprof-debug-info-correlate.c
+++ b/compiler-rt/test/profile/Darwin/instrprof-debug-info-correlate.c
@@ -7,7 +7,7 @@
// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t.normal
// RUN: llvm-profdata merge -o %t.normal.profdata %t.profraw
-// RUN:
diff %t.normal.profdata %t.profdata
+// RUN:
diff <(llvm-profdata show --all-functions --counts %t.normal.profdata) <(llvm-profdata show --all-functions --counts %t.profdata)
// RUN: %clang_pgogen -o %t.cov -g -mllvm --debug-info-correlate -mllvm -pgo-function-entry-coverage -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instrprof-debug-info-correlate-foo.cpp
// RUN: env LLVM_PROFILE_FILE=%t.cov.proflite %run %t.cov
@@ -17,4 +17,4 @@
// RUN: env LLVM_PROFILE_FILE=%t.cov.profraw %run %t.cov.normal
// RUN: llvm-profdata merge -o %t.cov.normal.profdata %t.cov.profraw
-// RUN:
diff %t.cov.normal.profdata %t.cov.profdata
+// RUN:
diff <(llvm-profdata show --all-functions --counts %t.cov.normal.profdata) <(llvm-profdata show --all-functions --counts %t.cov.profdata)
diff --git a/compiler-rt/test/profile/Linux/instrprof-debug-info-correlate.c b/compiler-rt/test/profile/Linux/instrprof-debug-info-correlate.c
index e40d1bee692a5c..259592598efe45 100644
--- a/compiler-rt/test/profile/Linux/instrprof-debug-info-correlate.c
+++ b/compiler-rt/test/profile/Linux/instrprof-debug-info-correlate.c
@@ -7,13 +7,13 @@
// RUN: env LLVM_PROFILE_FILE=%t.d4.proflite %run %t.d4
// RUN: llvm-profdata merge -o %t.d4.profdata --debug-info=%t.d4 %t.d4.proflite
-// RUN:
diff <(llvm-profdata show %t.normal.profdata) <(llvm-profdata show %t.d4.profdata)
+// RUN:
diff <(llvm-profdata show --all-functions --counts %t.normal.profdata) <(llvm-profdata show --all-functions --counts %t.d4.profdata)
// RUN: %clang_pgogen -o %t -g -mllvm --debug-info-correlate -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instrprof-debug-info-correlate-foo.cpp
// RUN: env LLVM_PROFILE_FILE=%t.proflite %run %t
// RUN: llvm-profdata merge -o %t.profdata --debug-info=%t %t.proflite
-// RUN:
diff <(llvm-profdata show %t.normal.profdata) <(llvm-profdata show %t.profdata)
+// RUN:
diff <(llvm-profdata show --all-functions --counts %t.normal.profdata) <(llvm-profdata show --all-functions --counts %t.profdata)
// RUN: %clang_pgogen -o %t.cov -g -mllvm --debug-info-correlate -mllvm -pgo-function-entry-coverage -mllvm --disable-vp=true %S/../Inputs/instrprof-debug-info-correlate-main.cpp %S/../Inputs/instrprof-debug-info-correlate-foo.cpp
// RUN: env LLVM_PROFILE_FILE=%t.cov.proflite %run %t.cov
@@ -23,4 +23,4 @@
// RUN: env LLVM_PROFILE_FILE=%t.cov.profraw %run %t.cov.normal
// RUN: llvm-profdata merge -o %t.cov.normal.profdata %t.cov.profraw
-// RUN:
diff <(llvm-profdata show %t.cov.normal.profdata) <(llvm-profdata show %t.cov.profdata)
+// RUN:
diff <(llvm-profdata show --all-functions --counts %t.cov.normal.profdata) <(llvm-profdata show --all-functions --counts %t.cov.profdata)
More information about the llvm-commits
mailing list