cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
40 lines
1.6 KiB
C
40 lines
1.6 KiB
C
// RUN: %clang_pgogen -mllvm -pgo-function-entry-coverage %s -o %t.out
|
|
// RUN: env LLVM_PROFILE_FILE=%t.profraw %run %t.out
|
|
// RUN: llvm-profdata merge -o %t.profdata %t.profraw
|
|
// RUN: llvm-profdata show --covered %t.profdata | FileCheck %s --implicit-check-not goo
|
|
|
|
// We deliberately merge the raw profile twice to test that internal counts can
|
|
// grow larger than one. Technically, accumulating coverage values is different
|
|
// than accumulating counts, but this helps discriminate cold functions from hot
|
|
// functions when the number of raw profiles is large.
|
|
// RUN: llvm-profdata merge -o %t2.profdata %t.profraw %t.profraw
|
|
// RUN: llvm-profdata show %t2.profdata | FileCheck %s --check-prefix=COUNTS
|
|
|
|
// RUN: %clang_cspgogen -O1 -mllvm -pgo-function-entry-coverage %s -o %t.cs.out
|
|
// RUN: env LLVM_PROFILE_FILE=%t.csprofraw %run %t.cs.out
|
|
// RUN: llvm-profdata merge -o %t.csprofdata %t.csprofraw
|
|
// RUN: llvm-profdata show --covered %t.csprofdata --showcs | FileCheck %s --implicit-check-not goo
|
|
// RUN: llvm-profdata merge -o %t2.csprofdata %t.csprofraw %t.csprofraw
|
|
// RUN: llvm-profdata show --showcs %t2.csprofdata | FileCheck %s --check-prefix=COUNTS
|
|
|
|
void markUsed(int a) {
|
|
volatile int g;
|
|
g = a;
|
|
}
|
|
|
|
__attribute__((noinline)) int foo(int i) { return 4 * i + 1; }
|
|
__attribute__((noinline)) int bar(int i) { return 4 * i + 2; }
|
|
__attribute__((noinline)) int goo(int i) { return 4 * i + 3; }
|
|
|
|
int main(int argc, char *argv[]) {
|
|
markUsed(foo(5));
|
|
markUsed(argc ? bar(6) : goo(7));
|
|
return 0;
|
|
}
|
|
|
|
// CHECK-DAG: main
|
|
// CHECK-DAG: foo
|
|
// CHECK-DAG: bar
|
|
|
|
// COUNTS: Maximum function count: 2
|