Files
RedBear-OS/local/recipes/dev/libclc/source/clang/test/Modules/lsv-private-macro.cpp
T
vasilito cb424d7448 build: static patch-sanity linter (shift-left the malformed-patch class)
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).
2026-08-01 05:13:02 +03:00

54 lines
1.4 KiB
C++

// RUN: rm -rf %t
//
// RUN: %clang_cc1 %s \
// RUN: -fmodules-local-submodule-visibility \
// RUN: -fmodule-map-file=%S/Inputs/lsv-private-macro/mod.map \
// RUN: -I%S/Inputs/lsv-private-macro -fmodule-name=self \
// RUN: -verify=expected-lsv
//
// RUN: %clang_cc1 %s \
// RUN: -fmodules -fmodules-cache-path=%t \
// RUN: -fmodule-map-file=%S/Inputs/lsv-private-macro/mod.map \
// RUN: -I%S/Inputs/lsv-private-macro -fmodule-name=self \
// RUN: -verify=expected-nolsv
//
// RUN: %clang_cc1 %s \
// RUN: -fmodules -fmodules-cache-path=%t \
// RUN: -fmodules-local-submodule-visibility \
// RUN: -fmodule-map-file=%S/Inputs/lsv-private-macro/mod.map \
// RUN: -I%S/Inputs/lsv-private-macro -fmodule-name=self \
// RUN: -verify=expected-lsv
#include "self.h"
// With local submodule visibility enabled, private macros don't leak out of
// their respective submodules, even within the same top-level module.
// expected-lsv-no-diagnostics
// expected-nolsv-error@+2 {{SELF_PRIVATE defined}}
#ifdef SELF_PRIVATE
#error SELF_PRIVATE defined
#endif
#ifndef SELF_PUBLIC
#error SELF_PUBLIC not defined
#endif
#ifndef SELF_DEFAULT
#error SELF_DEFAULT not defined
#endif
#include "other.h"
#ifdef OTHER_PRIVATE
#error OTHER_PRIVATE defined
#endif
#ifndef OTHER_PUBLIC
#error OTHER_PUBLIC not defined
#endif
#ifndef OTHER_DEFAULT
#error OTHER_DEFAULT not defined
#endif