Files
RedBear-OS/local/recipes/dev/libclc/source/llvm/test/Verifier/invalid-statepoint.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

28 lines
1.3 KiB
LLVM

; RUN: not opt -passes=verify 2>&1 < %s | FileCheck %s
declare zeroext i1 @return0i1()
; Function Attrs: nounwind
declare token @llvm.experimental.gc.statepoint.p0(i64, i32, ptr, i32, i32, ...) #0
; Function Attrs: nounwind
declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32) #0
; CHECK: gc.statepoint callee argument must have elementtype attribute
define ptr addrspace(1) @missing_elementtype(ptr addrspace(1) %dparam) gc "statepoint-example" {
%a00 = load i32, ptr addrspace(1) %dparam
%to0 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr @return0i1, i32 9, i32 0, i2 0) ["gc-live" (ptr addrspace(1) %dparam)]
%relocate = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %to0, i32 0, i32 0)
ret ptr addrspace(1) %relocate
}
; CHECK: gc.statepoint mismatch in number of call args
define ptr addrspace(1) @num_args_mismatch(ptr addrspace(1) %dparam) gc "statepoint-example" {
%a00 = load i32, ptr addrspace(1) %dparam
%to0 = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i1 ()) @return0i1, i32 9, i32 0, i2 0) ["gc-live" (ptr addrspace(1) %dparam)]
%relocate = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %to0, i32 0, i32 0)
ret ptr addrspace(1) %relocate
}
attributes #0 = { nounwind }