[llvm-branch-commits] [misexpect] Support diagnostics from frontend profile data (PR #96524)

Ellis Hoag via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jul 31 12:04:17 PDT 2024


================
@@ -0,0 +1,44 @@
+// Test that missing-annotations detects branches that are hot, but not annotated
+
+// test diagnostics are issued when profiling data mis-matches annotations
+// RUN: llvm-profdata merge %S/Inputs/missing-annotations-branch.proftext -o %t.profdata
+// RUN: %clang_cc1 %s -O2 -o - -emit-llvm -fprofile-instrument-use-path=%t.profdata -verify -mllvm -pgo-missing-annotations -Rpass=missing-annotations
+
+// Ensure we emit an error when we don't use pgo with tolerance threshold
+// RUN: %clang_cc1 %s -O2 -o - -emit-llvm  -fdiagnostics-misexpect-tolerance=10 -mllvm -pgo-missing-annotations -debug-info-kind=line-tables-only 2>&1 | FileCheck -check-prefix=NOPGO %s
+
+// Test -fdiagnostics-misexpect-tolerance=  requires pgo profile
+// NOPGO: '-fdiagnostics-misexpect-tolerance=' requires profile-guided optimization information
----------------
ellishg wrote:

If there is only one FileCheck, I would prefer to use the default `CHECK` prefix.

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


More information about the llvm-branch-commits mailing list