Files
RedBear-OS/local/recipes/dev/libclc/source/lld/test/MachO/sectalign.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

43 lines
1.7 KiB
ArmAsm

# REQUIRES: x86
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
# RUN: not %lld -dylib -o %t %t.o -sectalign __TEXT __text asdf 2>&1 \
# RUN: | FileCheck --check-prefix=NONUM -DNUM=asdf %s
# RUN: not %lld -dylib -o %t %t.o -sectalign __TEXT __text 0x0X4 2>&1 \
# RUN: | FileCheck --check-prefix=NONUM -DNUM=0x0X4 %s
# NONUM: error: -sectalign: failed to parse '[[NUM]]' as number
# RUN: not %lld -dylib -o %t %t.o -sectalign __TEXT __text 16 2>&1 \
# RUN: | FileCheck --check-prefix=NOPOW -DNUM=16 %s
# RUN: not %lld -dylib -o %t %t.o -sectalign __TEXT __text 0x16 2>&1 \
# RUN: | FileCheck --check-prefix=NOPOW -DNUM=0x16 %s
# RUN: not %lld -dylib -o %t %t.o -sectalign __TEXT __text 0 2>&1 \
# RUN: | FileCheck --check-prefix=NOPOW -DNUM=0 %s
# NOPOW: error: -sectalign: '[[NUM]]' (in base 16) not a power of two
## __DATA_CONST tests that the flag applies to names after section renaming.
# RUN: %lld -dylib -o %t %t.o -sectalign __TEXT __text 20 \
# RUN: -sectalign __DATA_CONST __const 0x40
# RUN: llvm-readobj --section-headers %t \
# RUN: | FileCheck -DSECT=__text -DSEG=__TEXT -DALIGN=5 %s
# RUN: llvm-readobj --section-headers %t \
# RUN: | FileCheck -DSECT=__const -DSEG=__DATA_CONST -DALIGN=6 %s
# RUN: %lld -dylib -o %t %t.o -rename_section __TEXT __text __TxT __foo \
# RUN: -sectalign __TxT __foo 0x40
# RUN: llvm-readobj --section-headers %t \
# RUN: | FileCheck -DSECT=__foo -DSEG=__TxT -DALIGN=6 %s
# CHECK: Name: [[SECT]]
# CHECK-NEXT: Segment: [[SEG]]
# CHECK-NEXT: Address:
# CHECK-NEXT: Size:
# CHECK-NEXT: Offset:
# CHECK-NEXT: Alignment: [[ALIGN]]
.section __TEXT,__text
.space 1
.section __DATA,__const
.space 1