Files
RedBear-OS/local/recipes/dev/libclc/source/bolt/test/AArch64/inline-small-function-2.s
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

48 lines
1.2 KiB
ArmAsm

## This test checks that inline is properly handled by BOLT on aarch64.
# REQUIRES: system-linux
# RUN: llvm-mc -filetype=obj -triple aarch64-unknown-unknown %s -o %t.o
# RUN: %clang %cflags -O0 %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt --inline-small-functions --print-inline --print-only=test \
# RUN: %t.exe -o %t.bolt | FileCheck %s
#CHECK: BOLT-INFO: inlined 0 calls at 1 call sites in 2 iteration(s). Change in binary size: 4 bytes.
#CHECK: Binary Function "test" after inlining {
#CHECK-NOT: bl indirect
#CHECK: add w0, w1, w0
#CHECK-NEXT: blr x2
.text
.globl indirect
.type indirect,@function
indirect:
add w0, w1, w0
br x2
.size indirect, .-indirect
.globl test
.type test,@function
test:
stp x29, x30, [sp, #-32]!
stp x20, x19, [sp, #16]
mov x29, sp
mov w19, w1
mov w20, w0
bl indirect
add w8, w19, w20
cmp w0, #0
csinc w0, w8, wzr, eq
ldp x20, x19, [sp, #16]
ldp x29, x30, [sp], #32
ret
.size test, .-test
.globl main
.type main,@function
main:
mov w0, wzr
ret
.size main, .-main