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).
40 lines
1.8 KiB
C++
40 lines
1.8 KiB
C++
// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple x86_64-linux-gnu | FileCheck --check-prefixes=CHECK,LINUX_AIX %s
|
|
// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple powerpc64-unknown-aix-xcoff | FileCheck --check-prefixes=CHECK,LINUX_AIX %s
|
|
// RUN: %clang_cc1 -std=c++11 -emit-llvm %s -o - -triple x86_64-apple-darwin12 | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s
|
|
|
|
int &f();
|
|
|
|
// LINUX_AIX: @r ={{.*}} thread_local global ptr null
|
|
// DARWIN: @r = internal thread_local global ptr null
|
|
thread_local int &r = f();
|
|
|
|
// LINUX_AIX: @_ZTH1r ={{.*}} alias void (), ptr @__tls_init
|
|
// DARWIN: @_ZTH1r = internal alias void (), ptr @__tls_init
|
|
|
|
int &g() { return r; }
|
|
|
|
// CHECK: define {{.*}} @[[R_INIT:.*]]()
|
|
// CHECK: call noundef nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_Z1fv()
|
|
// CHECK: %[[R_ADDR:.+]] = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @r)
|
|
// CHECK: store ptr %{{.*}}, ptr %[[R_ADDR]], align 8
|
|
|
|
// CHECK-LABEL: define{{.*}} nonnull align {{[0-9]+}} dereferenceable({{[0-9]+}}) ptr @_Z1gv()
|
|
// LINUX_AIX: call ptr @_ZTW1r()
|
|
// DARWIN: call cxx_fast_tlscc ptr @_ZTW1r()
|
|
// CHECK: ret ptr %{{.*}}
|
|
|
|
// LINUX_AIX: define weak_odr hidden noundef ptr @_ZTW1r() [[ATTR0:#[0-9]+]]{{( comdat)?}} {
|
|
// DARWIN: define cxx_fast_tlscc noundef ptr @_ZTW1r() [[ATTR1:#[0-9]+]] {
|
|
// LINUX_AIX: call void @_ZTH1r()
|
|
// DARWIN: call cxx_fast_tlscc void @_ZTH1r()
|
|
// CHECK: %[[R_ADDR2:.+]] = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @r)
|
|
// CHECK: load ptr, ptr %[[R_ADDR2]], align 8
|
|
// CHECK: ret ptr %{{.*}}
|
|
|
|
// LINUX_AIX-LABEL: define internal void @__tls_init()
|
|
// DARWIN-LABEL: define internal cxx_fast_tlscc void @__tls_init()
|
|
// CHECK: call void @[[R_INIT]]()
|
|
|
|
// LINUX_AIX: attributes [[ATTR0]] = { {{.*}} }
|
|
// DARWIN: attributes [[ATTR1]] = { {{.*}}nounwind{{.*}}"target-features"{{.*}} }
|