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.1 KiB
C
40 lines
1.1 KiB
C
// RUN: %clang_cc1 %s -fsyntax-only -verify -pedantic
|
|
|
|
// Test that we can parse declarations at global scope.
|
|
int v;
|
|
|
|
void func(void) {
|
|
// Test that we can parse declarations within a compound statement.
|
|
int a;
|
|
{
|
|
int b;
|
|
}
|
|
|
|
int z = ({ // expected-warning {{use of GNU statement expression extension}}
|
|
// Test that we can parse declarations within a GNU statement expression.
|
|
int w = 12;
|
|
w;
|
|
});
|
|
|
|
// Test that we diagnose declarations where a statement is required.
|
|
// See GH92775.
|
|
if (1)
|
|
int x; // expected-error {{expected expression}}
|
|
for (;;)
|
|
int c; // expected-error {{expected expression}}
|
|
|
|
label:
|
|
int y; // expected-warning {{label followed by a declaration is a C23 extension}}
|
|
|
|
// Test that lookup works as expected.
|
|
(void)a;
|
|
(void)v;
|
|
(void)z;
|
|
(void)b; // expected-error {{use of undeclared identifier 'b'}}
|
|
(void)w; // expected-error {{use of undeclared identifier 'w'}}
|
|
(void)x; // expected-error {{use of undeclared identifier 'x'}}
|
|
(void)c; // expected-error {{use of undeclared identifier 'c'}}
|
|
(void)y;
|
|
}
|
|
|