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

60 lines
879 B
C

// RUN: %clang_cc1 %s -emit-llvm -o -
union u_tag {
int a;
float b;
} u;
void f(void) {
u.b = 11;
}
float get_b(union u_tag *my_u) {
return my_u->b;
}
int f2( float __x ) {
union{
float __f;
unsigned int __u;
}__u;
return (int)(__u.__u >> 31);
}
typedef union { int i; int *j; } value;
int f3(value v) {
return *v.j;
}
enum E9 { one, two };
union S65 { enum E9 a; } ; union S65 s65;
void fS65(void) { enum E9 e = s65.a; }
typedef union{
unsigned char x[65536];
} q;
void qfunc(void) {q buf; unsigned char* x = buf.x;}
union RR {_Bool a : 1;} RRU;
int RRF(void) {return RRU.a;}
// PR6164
typedef union T0 { unsigned int : 0; } T0;
T0 t0;
union { int large_bitfield: 31; char c } u2;
struct dt_t_s {
union {
long long u : 56;
} __attribute__((packed));
};
struct {
struct {
struct {
struct dt_t_s t;
};
};
} a;