Files
RedBear-OS/local/recipes/dev/libclc/source/clang/test/Profile/branch-logical-mixed.cpp
T
vasilito cb424d7448 build: static patch-sanity linter (shift-left the malformed-patch class)
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).
2026-08-01 05:13:02 +03:00

67 lines
2.4 KiB
C++

// Test to ensure instrumentation of logical operator RHS True/False counters
// are being instrumented for branch coverage
// RUN: %clang_cc1 -triple %itanium_abi_triple -std=c++11 -main-file-name branch-logical-mixed.cpp %s -o - -emit-llvm -fprofile-instrument=clang | FileCheck -allow-deprecated-dag-overlap %s
// CHECK: @[[FUNC:__profc__Z4funcv]] = {{.*}} global [61 x i64] zeroinitializer
// CHECK-LABEL: @_Z4funcv()
bool func() {
bool bt0 = true;
bool bt1 = true;
bool bt2 = true;
bool bt3 = true;
bool bt4 = true;
bool bt5 = true;
bool bf0 = false;
bool bf1 = false;
bool bf2 = false;
bool bf3 = false;
bool bf4 = false;
bool bf5 = false;
bool a = bt0 &&
bf0 && // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 10
bt1 && // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 8
bf1 && // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 6
bt2 && // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 4
bf2; // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 2
bool b = bt0 ||
bf0 || // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 20
bt1 || // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 18
bf1 || // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 16
bt2 || // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 14
bf2; // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 12
bool c = (bt0 &&
bf0) || // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 27
(bt1 &&
bf1) || // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 29
(bt2 &&
bf2) || // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 31
(bt3 &&
bf3) || // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 33
(bt4 &&
bf4) || // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 35
(bf5 &&
bf5); // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 37
bool d = (bt0 ||
bf0) && // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 44
(bt1 ||
bf1) && // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 46
(bt2 ||
bf2) && // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 48
(bt3 ||
bf3) && // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 50
(bt4 ||
bf4) && // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 52
(bt5 ||
bf5); // CHECK: store {{.*}} @[[FUNC]], i32 0, i32 54
return a && b && c && d;
}