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).
59 lines
2.1 KiB
C++
59 lines
2.1 KiB
C++
// RUN: rm -rf %t && mkdir %t
|
|
// RUN: mkdir -p %t/ctudir
|
|
// RUN: %clang_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
|
// RUN: -emit-pch -o %t/ctudir/ctu-onego-indirect-other.cpp.ast %S/Inputs/ctu-onego-indirect-other.cpp
|
|
// RUN: cp %S/Inputs/ctu-onego-indirect-other.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt
|
|
|
|
int bar();
|
|
|
|
// Here we have a foreign function `bar` that is imported when we analyze
|
|
// `adirectbaruser`. During the subsequent toplevel analysis of `baruser` we
|
|
// should bifurcate on the call of `bar`.
|
|
|
|
//Ensure the order of the toplevel analyzed functions.
|
|
// RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
|
// RUN: -analyzer-checker=core,debug.ExprInspection \
|
|
// RUN: -analyzer-config eagerly-assume=false \
|
|
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
|
|
// RUN: -analyzer-config ctu-dir=%t/ctudir \
|
|
// RUN: -analyzer-display-progress \
|
|
// RUN: -analyzer-inlining-mode=all \
|
|
// RUN: -analyzer-config ctu-phase1-inlining=none \
|
|
// RUN: -analyzer-config ctu-max-nodes-pct=100 \
|
|
// RUN: -analyzer-config ctu-max-nodes-min=1000 2>&1 %s | FileCheck %s
|
|
// CHECK: ANALYZE (Path, Inline_Regular):{{.*}}adirectbaruser(int)
|
|
// CHECK: ANALYZE (Path, Inline_Regular):{{.*}}baruser(int)
|
|
|
|
// RUN: %clang_analyze_cc1 -std=c++14 -triple x86_64-pc-linux-gnu \
|
|
// RUN: -analyzer-checker=core,debug.ExprInspection \
|
|
// RUN: -analyzer-config eagerly-assume=false \
|
|
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \
|
|
// RUN: -analyzer-config ctu-dir=%t/ctudir \
|
|
// RUN: -analyzer-display-progress \
|
|
// RUN: -analyzer-inlining-mode=all \
|
|
// RUN: -analyzer-config ctu-phase1-inlining=none \
|
|
// RUN: -verify %s \
|
|
// RUN: -analyzer-config ctu-max-nodes-pct=100 \
|
|
// RUN: -analyzer-config ctu-max-nodes-min=1000
|
|
|
|
|
|
void other(); // Defined in the other TU.
|
|
|
|
void clang_analyzer_eval(int);
|
|
|
|
void baruser(int x) {
|
|
if (x == 1)
|
|
return;
|
|
int y = bar();
|
|
clang_analyzer_eval(y == 0); // expected-warning{{TRUE}}
|
|
// expected-warning@-1{{UNKNOWN}}
|
|
other();
|
|
}
|
|
|
|
void adirectbaruser(int) {
|
|
int y = bar();
|
|
(void)y;
|
|
baruser(1);
|
|
}
|
|
|