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).
56 lines
1.5 KiB
Plaintext
56 lines
1.5 KiB
Plaintext
// RUN: %clang_cc1 -fcxx-exceptions -fcuda-is-device -fsyntax-only -verify %s
|
|
// RUN: %clang_cc1 -fcxx-exceptions -fsyntax-only -verify %s
|
|
|
|
#include "Inputs/cuda.h"
|
|
|
|
void host() {
|
|
throw NULL;
|
|
try {} catch(void*) {}
|
|
}
|
|
__device__ void device() {
|
|
throw NULL;
|
|
// expected-error@-1 {{cannot use 'throw' in __device__ function}}
|
|
try {} catch(void*) {}
|
|
// expected-error@-1 {{cannot use 'try' in __device__ function}}
|
|
}
|
|
__global__ void kernel() {
|
|
throw NULL;
|
|
// expected-error@-1 {{cannot use 'throw' in __global__ function}}
|
|
try {} catch(void*) {}
|
|
// expected-error@-1 {{cannot use 'try' in __global__ function}}
|
|
}
|
|
|
|
// Check that it's an error to use 'try' and 'throw' from a __host__ __device__
|
|
// function if and only if it's codegen'ed for device.
|
|
|
|
__host__ __device__ void hd1() {
|
|
throw NULL;
|
|
try {} catch(void*) {}
|
|
#ifdef __CUDA_ARCH__
|
|
// expected-error@-3 {{cannot use 'throw' in __host__ __device__ function}}
|
|
// expected-error@-3 {{cannot use 'try' in __host__ __device__ function}}
|
|
#endif
|
|
}
|
|
|
|
// No error, never instantiated on device.
|
|
inline __host__ __device__ void hd2() {
|
|
throw NULL;
|
|
try {} catch(void*) {}
|
|
}
|
|
void call_hd2() { hd2(); }
|
|
|
|
// Error, instantiated on device.
|
|
inline __host__ __device__ void hd3() {
|
|
throw NULL;
|
|
try {} catch(void*) {}
|
|
#ifdef __CUDA_ARCH__
|
|
// expected-error@-3 {{cannot use 'throw' in __host__ __device__ function}}
|
|
// expected-error@-3 {{cannot use 'try' in __host__ __device__ function}}
|
|
#endif
|
|
}
|
|
|
|
__device__ void call_hd3() { hd3(); }
|
|
#ifdef __CUDA_ARCH__
|
|
// expected-note@-2 {{called by 'call_hd3'}}
|
|
#endif
|