Files
RedBear-OS/local/recipes/dev/libclc/source/llvm/test/Feature/cfgstructures.ll
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

54 lines
1.2 KiB
LLVM

; RUN: llvm-as < %s | llvm-dis > %t1.ll
; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
; RUN: diff %t1.ll %t2.ll
;; This is an irreducible flow graph
define void @irreducible(i1 %cond) {
br i1 %cond, label %X, label %Y
X: ; preds = %Y, %0
br label %Y
Y: ; preds = %X, %0
br label %X
}
;; This is a pair of loops that share the same header
define void @sharedheader(i1 %cond) {
br label %A
A: ; preds = %Y, %X, %0
br i1 %cond, label %X, label %Y
X: ; preds = %A
br label %A
Y: ; preds = %A
br label %A
}
;; This is a simple nested loop
define void @nested(i1 %cond1, i1 %cond2, i1 %cond3) {
br label %Loop1
Loop1: ; preds = %L2Exit, %0
br label %Loop2
Loop2: ; preds = %L3Exit, %Loop1
br label %Loop3
Loop3: ; preds = %Loop3, %Loop2
br i1 %cond3, label %Loop3, label %L3Exit
L3Exit: ; preds = %Loop3
br i1 %cond2, label %Loop2, label %L2Exit
L2Exit: ; preds = %L3Exit
br i1 %cond1, label %Loop1, label %L1Exit
L1Exit: ; preds = %L2Exit
ret void
}