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).
60 lines
2.8 KiB
C++
60 lines
2.8 KiB
C++
int fizzbuzz(int x, bool y) {
|
|
return x + y;
|
|
}
|
|
|
|
// C++ but not uses parentheses in the '-analyze-function' option.
|
|
//
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core \
|
|
// RUN: -analyze-function='missing_fn' -x c++ \
|
|
// RUN: -triple x86_64-pc-linux-gnu 2>&1 %s \
|
|
// RUN: | FileCheck %s -check-prefix=CHECK-CXX
|
|
//
|
|
// CHECK-CXX: Every top-level function was skipped.
|
|
// CHECK-CXX-NEXT: Pass the -analyzer-display-progress for tracking which functions are analyzed.
|
|
// CHECK-CXX-NEXT: For analyzing C++ code you need to pass the function parameter list: -analyze-function="foobar(int, _Bool)"
|
|
|
|
// C but uses parentheses in the '-analyze-function' option.
|
|
//
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core \
|
|
// RUN: -analyze-function='missing_fn()' -x c -Dbool=_Bool \
|
|
// RUN: -triple x86_64-pc-linux-gnu 2>&1 %s \
|
|
// RUN: | FileCheck %s -check-prefix=CHECK-C
|
|
//
|
|
// CHECK-C: Every top-level function was skipped.
|
|
// CHECK-C-NEXT: Pass the -analyzer-display-progress for tracking which functions are analyzed.
|
|
// CHECK-C-NEXT: For analyzing C code you shouldn't pass the function parameter list, only the name of the function: -analyze-function=foobar
|
|
|
|
// The user passed the '-analyzer-display-progress' option, we don't need to advocate it.
|
|
//
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core \
|
|
// RUN: -analyze-function=missing_fn \
|
|
// RUN: -analyzer-display-progress -x c -Dbool=_Bool \
|
|
// RUN: -triple x86_64-pc-linux-gnu 2>&1 %s \
|
|
// RUN: | FileCheck %s -check-prefix=CHECK-DONT-ADVOCATE-DISPLAY-PROGRESS
|
|
//
|
|
// CHECK-DONT-ADVOCATE-DISPLAY-PROGRESS: Every top-level function was skipped.
|
|
// CHECK-DONT-ADVOCATE-DISPLAY-PROGRESS-NOT: Pass the -analyzer-display-progress
|
|
|
|
// The user passed the '-analyze-function' option but that doesn't mach to any declaration.
|
|
//
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core \
|
|
// RUN: -analyze-function='missing_fn()' -x c++ \
|
|
// RUN: -triple x86_64-pc-linux-gnu 2>&1 %s \
|
|
// RUN: | FileCheck %s -check-prefix=CHECK-ADVOCATE-DISPLAY-PROGRESS
|
|
//
|
|
// CHECK-ADVOCATE-DISPLAY-PROGRESS: Every top-level function was skipped.
|
|
// CHECK-ADVOCATE-DISPLAY-PROGRESS-NEXT: Pass the -analyzer-display-progress for tracking which functions are analyzed.
|
|
// CHECK-ADVOCATE-DISPLAY-PROGRESS-NOT: For analyzing
|
|
|
|
// Same as the previous but syntax mode only.
|
|
// FIXME: This should have empty standard output.
|
|
//
|
|
// RUN: %clang_analyze_cc1 -analyzer-checker=core -analyzer-config ipa=none \
|
|
// RUN: -analyze-function='fizzbuzz(int, _Bool)' -x c++ \
|
|
// RUN: -triple x86_64-pc-linux-gnu 2>&1 %s \
|
|
// RUN: | FileCheck %s -check-prefix=CHECK-EMPTY3 --allow-empty
|
|
//
|
|
// FIXME: This should have empty standard output.
|
|
// CHECK-EMPTY3: Every top-level function was skipped.
|
|
// CHECK-EMPTY3-NEXT: Pass the -analyzer-display-progress for tracking which functions are analyzed.
|