Files
RedBear-OS/local/recipes/dev/libclc/source/clang/test/CodeGen/struct-x86-darwin.c
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

71 lines
2.4 KiB
C

// RUN: %clang_cc1 %s -emit-llvm -o /dev/null -triple=i686-apple-darwin9 -fdump-record-layouts-simple | FileCheck %s
// Test struct layout for x86-darwin target
struct STest1 {int x; short y[4]; double z; } st1;
struct STest2 {short a,b; int c,d; } st2;
struct STest3 {char a; short b; int c; } st3;
// Bitfields
struct STestB1 {char a; char b:2; } stb1;
struct STestB2 {char a; char b:5; char c:4; } stb2;
struct STestB3 {char a; char b:2; } stb3;
struct STestB4 {char a; short b:2; char c; } stb4;
struct STestB5 {char a; short b:10; char c; } stb5;
struct STestB6 {int a:1; char b; int c:13; } stb6;
// Packed struct STestP1 {char a; short b; int c; } __attribute__((__packed__)) stp1;
// CHECK-LABEL: LLVMType:%struct.STest1 =
// CHECK-SAME: type { i32, [4 x i16], double }
// CHECK: BitFields:[
// CHECK-NEXT: ]>
// CHECK-LABEL: LLVMType:%struct.STest2 =
// CHECK-SAME: type { i16, i16, i32, i32 }
// CHECK: BitFields:[
// CHECK-NEXT: ]>
// CHECK-LABEL: LLVMType:%struct.STest3 =
// CHECK-SAME: type { i8, i16, i32 }
// CHECK: BitFields:[
// CHECK-NEXT: ]>
// CHECK-LABEL: LLVMType:%struct.STestB1 =
// CHECK-SAME: type { i8, i8 }
// CHECK: BitFields:[
// CHECK-NEXT: <CGBitFieldInfo Offset:0 Size:2 IsSigned:1 StorageSize:8 StorageOffset:1
// CHECK-NEXT: ]>
// CHECK-LABEL: LLVMType:%struct.STestB2 =
// CHECK-SAME: type <{ i8, i16 }>
// CHECK: BitFields:[
// CHECK-NEXT: <CGBitFieldInfo Offset:0 Size:5 IsSigned:1 StorageSize:16 StorageOffset:1
// CHECK-NEXT: <CGBitFieldInfo Offset:8 Size:4 IsSigned:1 StorageSize:16 StorageOffset:1
// CHECK-NEXT: ]>
// CHECK-LABEL: LLVMType:%struct.STestB3 =
// CHECK-SAME: type { i8, i8 }
// CHECK: BitFields:[
// CHECK-NEXT: <CGBitFieldInfo Offset:0 Size:2 IsSigned:1 StorageSize:8 StorageOffset:1
// CHECK-NEXT: ]>
// CHECK-LABEL: LLVMType:%struct.STestB4 =
// CHECK-SAME: type { i8, i8, i8, i8 }
// CHECK: BitFields:[
// CHECK-NEXT: <CGBitFieldInfo Offset:0 Size:2 IsSigned:1 StorageSize:8 StorageOffset:1
// CHECK-NEXT: ]>
// CHECK-LABEL: LLVMType:%struct.STestB5 =
// CHECK-SAME: type { i8, i16, i8 }
// CHECK: BitFields:[
// CHECK-NEXT: <CGBitFieldInfo Offset:0 Size:10 IsSigned:1 StorageSize:16 StorageOffset:2
// CHECK-NEXT: ]>
// CHECK-LABEL: LLVMType:%struct.STestB6 =
// CHECK-SAME: type { i8, i8, i16 }
// CHECK: BitFields:[
// CHECK-NEXT: <CGBitFieldInfo Offset:0 Size:1 IsSigned:1 StorageSize:8 StorageOffset:0
// CHECK-NEXT: <CGBitFieldInfo Offset:0 Size:13 IsSigned:1 StorageSize:16 StorageOffset:2
// CHECK-NEXT: ]>