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).
62 lines
3.1 KiB
C
62 lines
3.1 KiB
C
// This file tests the -Rpass family of flags (-Rpass, -Rpass-missed
|
|
// and -Rpass-analysis) with the inliner. The test is designed to
|
|
// always trigger the inliner, so it should be independent of the
|
|
// optimization level (under the legacy PM). The inliner is not added to the new
|
|
// PM pipeline unless optimizations are present.
|
|
|
|
// The inliner for the new PM does not seem to be enabled at O0, but we still
|
|
// get the same remarks with at least O1. The remarks are also slightly
|
|
// different and located in another test file.
|
|
// RUN: %clang_cc1 %s -Rpass=inline -emit-llvm -o - 2>/dev/null | FileCheck %s
|
|
//
|
|
// Check that we can override -Rpass= with -Rno-pass.
|
|
// RUN: %clang_cc1 %s -Rpass=inline -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-REMARKS
|
|
// RUN: %clang_cc1 %s -Rpass=inline -Rno-pass -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-NO-REMARKS
|
|
// RUN: %clang_cc1 %s -Rpass=inline -Rno-everything -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-NO-REMARKS
|
|
// RUN: %clang_cc1 %s -Rpass=inline -Rno-everything -Reverything -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-REMARKS
|
|
// RUN: %clang_cc1 %s -Rpass -Rno-pass -round-trip-args -mllvm -mandatory-inlining-first=false -O1 -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-NO-REMARKS
|
|
//
|
|
// The inliner for the new PM does not seem to be enabled at O0, but we still
|
|
// get the same remarks with at least O1.
|
|
// RUN: %clang_cc1 %s -Rpass=inline -O1 -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-REMARKS
|
|
// RUN: %clang_cc1 %s -Rpass=inline -O1 -Rno-everything -Reverything -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-REMARKS
|
|
//
|
|
// Check that -w doesn't disable remarks.
|
|
// RUN: %clang_cc1 %s -Rpass=inline -w -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-REMARKS
|
|
// RUN: %clang_cc1 %s -Rpass=inline -O1 -w -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-REMARKS
|
|
//
|
|
// -Reverything implies -Rpass=.*.
|
|
// RUN: %clang_cc1 %s -Reverything -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-REMARKS
|
|
//
|
|
// -Rpass implies -Rpass=.*
|
|
// RUN: %clang_cc1 %s -Rpass -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-REMARKS
|
|
|
|
// CHECK-REMARKS: remark:
|
|
// CHECK-NO-REMARKS-NOT: remark:
|
|
|
|
// -Rpass should produce source location annotations, exclusively (just
|
|
// like -gmlt).
|
|
// CHECK: , !dbg !
|
|
// CHECK-NOT: DW_TAG_base_type
|
|
|
|
// The CU should be marked NoDebug (to prevent writing debug info to
|
|
// the final output).
|
|
// CHECK: !llvm.dbg.cu = !{![[CU:.*]]}
|
|
// CHECK: ![[CU]] = distinct !DICompileUnit({{.*}}emissionKind: NoDebug
|
|
|
|
int foo(int x, int y) __attribute__((always_inline));
|
|
int foo(int x, int y) { return x + y; }
|
|
|
|
float foz(int x, int y) __attribute__((noinline));
|
|
float foz(int x, int y) { return x * y; }
|
|
|
|
// The negative diagnostics are emitted twice because the inliner runs
|
|
// twice.
|
|
//
|
|
int bar(int j) {
|
|
// expected-remark@+3 {{'foz' not inlined into 'bar' because it should never be inlined (cost=never)}}
|
|
// expected-remark@+2 {{'foz' not inlined into 'bar' because it should never be inlined (cost=never)}}
|
|
// expected-remark@+1 {{'foo' inlined into 'bar'}}
|
|
return foo(j, j - 2) * foz(j - 2, j);
|
|
}
|