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).
80 lines
1.6 KiB
C++
80 lines
1.6 KiB
C++
// RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin10 -I%S -emit-llvm -o - %s | FileCheck %s
|
|
// RUN: %clang_cc1 -std=c++11 -triple x86_64-apple-darwin10 -I%S -emit-llvm -o - %s -fexperimental-new-constant-interpreter | FileCheck %s
|
|
|
|
#include <typeinfo>
|
|
|
|
// CHECK: @_ZTIDn = external constant ptr
|
|
int* a = nullptr;
|
|
|
|
void f() {
|
|
int* a = nullptr;
|
|
}
|
|
|
|
typedef decltype(nullptr) nullptr_t;
|
|
|
|
nullptr_t get_nullptr();
|
|
|
|
struct X { };
|
|
void g() {
|
|
// CHECK: call ptr @_Z11get_nullptrv()
|
|
int (X::*pmf)(int) = get_nullptr();
|
|
}
|
|
|
|
const std::type_info& f2() {
|
|
return typeid(nullptr_t);
|
|
}
|
|
|
|
union U {
|
|
int n;
|
|
nullptr_t b;
|
|
};
|
|
// CHECK-LABEL: define {{.*}}pr23833_a
|
|
// CHECK: store
|
|
// CHECK: load
|
|
// CHECK-NOT: load
|
|
// CHECK: ret i1 false
|
|
bool pr23833_a(U &u) { return bool(u.b); }
|
|
|
|
// CHECK-LABEL: define {{.*}}pr23833_b
|
|
// CHECK: store
|
|
// CHECK: load
|
|
// CHECK-NOT: load
|
|
// CHECK: ret ptr null
|
|
nullptr_t pr23833_b(nullptr_t &n) { return n; }
|
|
|
|
struct X1 { operator int*(); };
|
|
struct X2 { operator const nullptr_t&(); };
|
|
|
|
// CHECK-LABEL: define {{.*}}pr23833_c
|
|
// CHECK: call {{.*}}X1
|
|
// CHECK: call {{.*}}X2
|
|
// CHECK-NOT: load
|
|
// CHECK: ret i32
|
|
int pr23833_c() {
|
|
return X1() != X2();
|
|
}
|
|
|
|
// CHECK-LABEL: define {{.*}}pr23833_d
|
|
// CHECK: call {{.*}}X2
|
|
// CHECK-NOT: load
|
|
// CHECK: store
|
|
// CHECK: load
|
|
// CHECK: ret ptr
|
|
int *pr23833_d() {
|
|
int *p = X2();
|
|
return p;
|
|
}
|
|
|
|
namespace PR39528 {
|
|
constexpr nullptr_t null = nullptr;
|
|
void f(nullptr_t);
|
|
void g() { f(null); }
|
|
}
|
|
|
|
// CHECK-LABEL: define {{.*}}pr137276
|
|
// CHECK: {{^}} store i64 0, ptr %arr, align 8{{$}}
|
|
void pr137276(nullptr_t np, int i) {
|
|
long arr[] = { long(np), i, 0 };
|
|
(void)arr;
|
|
}
|