Files
RedBear-OS/local/recipes/dev/libclc/source/clang/test/CodeGenOpenCLCXX/addrspace-references.clcpp
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

34 lines
1.2 KiB
Plaintext

//RUN: %clang_cc1 %s -triple spir -emit-llvm -o - -O0 | FileCheck %s
typedef short short2 __attribute__((ext_vector_type(2)));
int bar(const unsigned int &i);
class C {
public:
void bar(const short2 &);
};
// CHECK-LABEL: define{{.*}} spir_func void @_Z6scalarv()
void scalar() {
// The generic addr space reference parameter object will be bound
// to a temporary value allocated in private addr space. We need an
// addrspacecast before passing the value to the function.
// CHECK: [[REF:%.*]] = alloca i32
// CHECK: store i32 1, ptr [[REF]]
// CHECK: [[REG:%[.a-z0-9]+]] ={{.*}} addrspacecast ptr [[REF]] to ptr addrspace(4)
// CHECK: call spir_func noundef i32 @_Z3barRU3AS4Kj(ptr addrspace(4) noundef align 4 dereferenceable(4) [[REG]])
bar(1);
}
// Test list initialization
// CHECK-LABEL: define{{.*}} spir_func void @_Z4listv()
void list() {
C c1;
// CHECK: [[REF:%.*]] = alloca <2 x i16>
// CHECK: store <2 x i16> <i16 1, i16 2>, ptr [[REF]]
// CHECK: [[REG:%[.a-z0-9]+]] = addrspacecast ptr [[REF]] to ptr addrspace(4)
// CHECK: call {{.*}}void @_ZNU3AS41C3barERU3AS4KDv2_s(ptr addrspace(4) {{.*}}, ptr addrspace(4){{.*}} [[REG]])
c1.bar({1, 2});
}