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).
105 lines
3.3 KiB
C++
105 lines
3.3 KiB
C++
// Test that SYCL kernel name conflicts that occur across module boundaries are
|
|
// properly diagnosed and that declarations are properly merged so that spurious
|
|
// conflicts are not reported.
|
|
|
|
// RUN: rm -rf %t
|
|
// RUN: split-file %s %t
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
|
|
// RUN: -std=c++17 -fsycl-is-host %t/test.cpp -verify
|
|
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t \
|
|
// RUN: -std=c++17 -fsycl-is-device %t/test.cpp -verify
|
|
|
|
#--- module.modulemap
|
|
module M1 { header "m1.h" }
|
|
module M2 { header "m2.h" }
|
|
|
|
|
|
#--- common.h
|
|
template<int> struct KN;
|
|
|
|
[[clang::sycl_kernel_entry_point(KN<1>)]]
|
|
void common_test1() {}
|
|
|
|
template<typename T>
|
|
[[clang::sycl_kernel_entry_point(T)]]
|
|
void common_test2() {}
|
|
template void common_test2<KN<2>>();
|
|
|
|
|
|
#--- m1.h
|
|
#include "common.h"
|
|
|
|
[[clang::sycl_kernel_entry_point(KN<3>)]]
|
|
void m1_test3() {} // << expected previous declaration note here.
|
|
|
|
template<typename T>
|
|
[[clang::sycl_kernel_entry_point(T)]]
|
|
void m1_test4() {} // << expected previous declaration note here.
|
|
template void m1_test4<KN<4>>();
|
|
|
|
[[clang::sycl_kernel_entry_point(KN<5>)]]
|
|
void m1_test5() {} // << expected previous declaration note here.
|
|
|
|
template<typename T>
|
|
[[clang::sycl_kernel_entry_point(T)]]
|
|
void m1_test6() {} // << expected previous declaration note here.
|
|
template void m1_test6<KN<6>>();
|
|
|
|
|
|
#--- m2.h
|
|
#include "common.h"
|
|
|
|
[[clang::sycl_kernel_entry_point(KN<3>)]]
|
|
void m2_test3() {} // << expected kernel name conflict here.
|
|
|
|
template<typename T>
|
|
[[clang::sycl_kernel_entry_point(T)]]
|
|
void m2_test4() {} // << expected kernel name conflict here.
|
|
template void m2_test4<KN<4>>();
|
|
|
|
[[clang::sycl_kernel_entry_point(KN<7>)]]
|
|
void m2_test7() {} // << expected previous declaration note here.
|
|
|
|
template<typename T>
|
|
[[clang::sycl_kernel_entry_point(T)]]
|
|
void m2_test8() {} // << expected previous declaration note here.
|
|
template void m2_test8<KN<8>>();
|
|
|
|
|
|
#--- test.cpp
|
|
#include "m1.h"
|
|
#include "m2.h"
|
|
|
|
// Expected diagnostics for m1_test3() and m2_test3():
|
|
// expected-error@m2.h:4 {{'sycl_kernel_entry_point' kernel name argument conflicts with a previous declaration}}
|
|
// expected-note@m1.h:12 {{previous declaration is here}}
|
|
|
|
// Expected diagnostics for m1_test4<KN<4>>() and m2_test4<KN<4>>():
|
|
// expected-error@m2.h:8 {{'sycl_kernel_entry_point' kernel name argument conflicts with a previous declaration}}
|
|
// expected-note@m1.h:16 {{previous declaration is here}}
|
|
|
|
// expected-error@+3 {{'sycl_kernel_entry_point' kernel name argument conflicts with a previous declaration}}
|
|
// expected-note@m1.h:4 {{previous declaration is here}}
|
|
[[clang::sycl_kernel_entry_point(KN<5>)]]
|
|
void test5() {}
|
|
|
|
// expected-error@+3 {{'sycl_kernel_entry_point' kernel name argument conflicts with a previous declaration}}
|
|
// expected-note@m1.h:8 {{previous declaration is here}}
|
|
[[clang::sycl_kernel_entry_point(KN<6>)]]
|
|
void test6() {}
|
|
|
|
// expected-error@+3 {{'sycl_kernel_entry_point' kernel name argument conflicts with a previous declaration}}
|
|
// expected-note@m2.h:12 {{previous declaration is here}}
|
|
[[clang::sycl_kernel_entry_point(KN<7>)]]
|
|
void test7() {}
|
|
|
|
// expected-error@+3 {{'sycl_kernel_entry_point' kernel name argument conflicts with a previous declaration}}
|
|
// expected-note@m2.h:16 {{previous declaration is here}}
|
|
[[clang::sycl_kernel_entry_point(KN<8>)]]
|
|
void test8() {}
|
|
|
|
void f() {
|
|
common_test1();
|
|
common_test2<KN<2>>();
|
|
}
|