cb424d7448
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).
82 lines
3.3 KiB
Plaintext
82 lines
3.3 KiB
Plaintext
// RUN: %clang_cc1 -triple amdgcn -fcuda-is-device \
|
|
// RUN: -emit-llvm -o - -x hip %s \
|
|
// RUN: | FileCheck -check-prefixes=DEV,NORDC %s
|
|
// RUN: %clang_cc1 -triple amdgcn -fcuda-is-device \
|
|
// RUN: -fgpu-rdc -cuid=abc -emit-llvm -o - -x hip %s \
|
|
// RUN: | FileCheck -check-prefixes=DEV,RDC %s
|
|
// RUN: %clang_cc1 -triple x86_64-unknown-gnu-linux \
|
|
// RUN: -emit-llvm -o - -x hip %s \
|
|
// RUN: | FileCheck -check-prefixes=HOST,NORDC-H %s
|
|
// RUN: %clang_cc1 -triple x86_64-unknown-gnu-linux \
|
|
// RUN: -fgpu-rdc -cuid=abc -emit-llvm -o - -x hip %s \
|
|
// RUN: | FileCheck -check-prefixes=HOST,RDC-H %s
|
|
// RUN: %clang_cc1 -triple nvptx -fcuda-is-device \
|
|
// RUN: -fgpu-rdc -cuid=abc -emit-llvm -o - %s \
|
|
// RUN: | FileCheck -check-prefixes=CUDA %s
|
|
|
|
#include "Inputs/cuda.h"
|
|
|
|
// DEV-DAG: @v1 = addrspace(1) externally_initialized global i32 0
|
|
// NORDC-H-DAG: @v1 = internal global i32 undef
|
|
// RDC-H-DAG: @v1 = global i32 undef
|
|
__device__ int v1;
|
|
// DEV-DAG: @v2 = addrspace(4) externally_initialized constant i32 0
|
|
// NORDC-H-DAG: @v2 = internal global i32 undef
|
|
// RDC-H-DAG: @v2 = global i32 undef
|
|
__constant__ int v2;
|
|
// DEV-DAG: @v3 = addrspace(1) externally_initialized global ptr addrspace(1) null
|
|
// NORDC-H-DAG: @v3 = internal externally_initialized global ptr null
|
|
// RDC-H-DAG: @v3 = externally_initialized global ptr null
|
|
#if __HIP__
|
|
__managed__ int v3;
|
|
#endif
|
|
|
|
// DEV-DAG: @ev1 = external addrspace(1) global i32
|
|
// HOST-DAG: @ev1 = external global i32
|
|
extern __device__ int ev1;
|
|
// DEV-DAG: @ev2 = external addrspace(4) global i32
|
|
// HOST-DAG: @ev2 = external global i32
|
|
extern __constant__ int ev2;
|
|
// DEV-DAG: @ev3 = external addrspace(1) externally_initialized global ptr addrspace(1)
|
|
// HOST-DAG: @ev3 = external externally_initialized global ptr
|
|
#if __HIP__
|
|
extern __managed__ int ev3;
|
|
#endif
|
|
|
|
// NORDC-DAG: @_ZL3sv1 = addrspace(1) externally_initialized global i32 0
|
|
// RDC-DAG: @_ZL3sv1.static.[[HASH:.*]] = addrspace(1) externally_initialized global i32 0
|
|
// HOST-DAG: @_ZL3sv1 = internal global i32 undef
|
|
// CUDA-DAG: @_ZL3sv1__static__[[HASH:.*]] = addrspace(1) externally_initialized global i32 0
|
|
static __device__ int sv1;
|
|
// NORDC-DAG: @_ZL3sv2 = addrspace(4) externally_initialized constant i32 0
|
|
// RDC-DAG: @_ZL3sv2.static.[[HASH]] = addrspace(4) externally_initialized constant i32 0
|
|
// HOST-DAG: @_ZL3sv2 = internal global i32 undef
|
|
// CUDA-DAG: @_ZL3sv2__static__[[HASH]] = addrspace(4) externally_initialized constant i32 0
|
|
static __constant__ int sv2;
|
|
// NORDC-DAG: @_ZL3sv3 = addrspace(1) externally_initialized global ptr addrspace(1) null
|
|
// RDC-DAG: @_ZL3sv3.static.[[HASH]] = addrspace(1) externally_initialized global ptr addrspace(1) null
|
|
// HOST-DAG: @_ZL3sv3 = internal externally_initialized global ptr null
|
|
#if __HIP__
|
|
static __managed__ int sv3;
|
|
#endif
|
|
|
|
__device__ __host__ int work(int *x);
|
|
|
|
__device__ __host__ int fun1() {
|
|
return work(&ev1) + work(&ev2) + work(&sv1) + work(&sv2)
|
|
#if __HIP__
|
|
+ work(&ev3) + work(&sv3)
|
|
#endif
|
|
;
|
|
}
|
|
|
|
// HOST: hipRegisterVar({{.*}}@v1
|
|
// HOST: hipRegisterVar({{.*}}@v2
|
|
// HOST: hipRegisterManagedVar({{.*}}@v3
|
|
// HOST-NOT: hipRegisterVar({{.*}}@ev1
|
|
// HOST-NOT: hipRegisterVar({{.*}}@ev2
|
|
// HOST-NOT: hipRegisterManagedVar({{.*}}@ev3
|
|
// HOST: hipRegisterVar({{.*}}@_ZL3sv1
|
|
// HOST: hipRegisterVar({{.*}}@_ZL3sv2
|
|
// HOST: hipRegisterManagedVar({{.*}}@_ZL3sv3
|