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).
68 lines
3.1 KiB
C++
68 lines
3.1 KiB
C++
// Test without serialization:
|
|
// RUN: %clang_cc1 -ast-dump %s | FileCheck %s
|
|
//
|
|
// Test with serialization:
|
|
// RUN: %clang_cc1 -emit-pch -o %t %s
|
|
// RUN: %clang_cc1 -x c++ -include-pch %t -ast-dump-all /dev/null \
|
|
// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
|
|
// RUN: | FileCheck %s
|
|
|
|
template<int N = 0>
|
|
void pr43370() {
|
|
int arr[2];
|
|
__atomic_store_n(arr, 0, 5);
|
|
}
|
|
|
|
template<int N = 0>
|
|
void foo() {
|
|
int arr[2];
|
|
(void)__atomic_compare_exchange_n(arr, arr, 1, 0, 3, 4);
|
|
}
|
|
|
|
void useage(){
|
|
pr43370();
|
|
foo();
|
|
}
|
|
|
|
// CHECK:FunctionTemplateDecl 0x{{[0-9a-f]+}} <{{[^,]+}}, line:{{.*}}:1> line:{{.*}}:6 pr43370
|
|
// CHECK: AtomicExpr 0x{{[0-9a-f]+}} <{{.*}}> 'void' __atomic_store_n
|
|
// CHECK-NEXT: ImplicitCastExpr
|
|
// CHECK-SAME: <ArrayToPointerDecay>
|
|
// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:20> 'int[2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int[2]'
|
|
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:28> 'int' 5
|
|
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:25> 'int' 0
|
|
// CHECK:FunctionDecl 0x{{[0-9a-f]+}} <line:{{.*}}:1, line:{{.*}}:1> line:{{.*}}:6 used pr43370
|
|
// CHECK: AtomicExpr 0x{{[0-9a-f]+}} <{{.*}}> 'void' __atomic_store_n
|
|
// CHECK-NEXT: ImplicitCastExpr
|
|
// CHECK-SAME: <ArrayToPointerDecay>
|
|
// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:20> 'int[2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int[2]'
|
|
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:28> 'int' 5
|
|
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:25> 'int' 0
|
|
|
|
// CHECK:FunctionTemplateDecl 0x{{[0-9a-f]+}} <line:{{.*}}:1, line:{{.*}}:1> line:{{.*}}:6 foo
|
|
// CHECK: AtomicExpr 0x{{[0-9a-f]+}} <{{.*}}> 'bool' __atomic_compare_exchange_n
|
|
// CHECK-NEXT: ImplicitCastExpr
|
|
// CHECK-SAME: <ArrayToPointerDecay>
|
|
// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:37> 'int[2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int[2]'
|
|
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:53> 'int' 3
|
|
// CHECK-NEXT: ImplicitCastExpr
|
|
// CHECK-SAME: <ArrayToPointerDecay>
|
|
// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:42> 'int[2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int[2]'
|
|
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:56> 'int' 4
|
|
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:47> 'int' 1
|
|
// CHECK-NEXT: ImplicitCastExpr
|
|
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:50> 'int' 0
|
|
// CHECK:FunctionDecl 0x{{[0-9a-f]+}} <line:{{.*}}:1, line:{{.*}}:1> line:{{.*}}:6 used foo
|
|
// CHECK: AtomicExpr 0x{{[0-9a-f]+}} <{{.*}}> 'bool' __atomic_compare_exchange_n
|
|
// CHECK-NEXT: ImplicitCastExpr
|
|
// CHECK-SAME: <ArrayToPointerDecay>
|
|
// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:37> 'int[2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int[2]'
|
|
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:53> 'int' 3
|
|
// CHECK-NEXT: ImplicitCastExpr
|
|
// CHECK-SAME: <ArrayToPointerDecay>
|
|
// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:42> 'int[2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int[2]'
|
|
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:56> 'int' 4
|
|
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:47> 'int' 1
|
|
// CHECK-NEXT: ImplicitCastExpr
|
|
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:50> 'int' 0
|