Files
RedBear-OS/local/recipes/dev/libclc/source/clang/test/Parser/pragma-fp.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

76 lines
2.1 KiB
C++

// RUN: %clang_cc1 -std=c++11 -verify %s
void test_0(int *List, int Length) {
/* expected-error@+1 {{missing option; expected 'contract', 'reassociate', 'reciprocal', or 'exceptions'}} */
#pragma clang fp
for (int i = 0; i < Length; i++) {
List[i] = i;
}
}
void test_1(int *List, int Length) {
/* expected-error@+1 {{invalid option 'blah'; expected 'contract', 'reassociate', 'reciprocal', or 'exceptions'}} */
#pragma clang fp blah
for (int i = 0; i < Length; i++) {
List[i] = i;
}
}
void test_3(int *List, int Length) {
/* expected-error@+1 {{expected '('}} */
#pragma clang fp contract on
for (int i = 0; i < Length; i++) {
List[i] = i;
}
}
void test_4(int *List, int Length) {
/* expected-error@+1 {{unexpected argument 'while' to '#pragma clang fp contract'; expected 'fast' or 'on' or 'off'}} */
#pragma clang fp contract(while)
for (int i = 0; i < Length; i++) {
List[i] = i;
}
}
void test_5(int *List, int Length) {
/* expected-error@+1 {{unexpected argument 'maybe' to '#pragma clang fp contract'; expected 'fast' or 'on' or 'off'}} */
#pragma clang fp contract(maybe)
for (int i = 0; i < Length; i++) {
List[i] = i;
}
}
void test_6(int *List, int Length) {
/* expected-error@+1 {{expected ')'}} */
#pragma clang fp contract(fast
for (int i = 0; i < Length; i++) {
List[i] = i;
}
}
void test_7(int *List, int Length) {
/* expected-warning@+1 {{extra tokens at end of '#pragma clang fp' - ignored}} */
#pragma clang fp contract(fast) *
for (int i = 0; i < Length; i++) {
List[i] = i;
}
}
void test_8(int *List, int Length) {
for (int i = 0; i < Length; i++) {
List[i] = i;
/* expected-error@+1 {{'#pragma clang fp' can only appear at file scope or at the start of a compound statement}} */
#pragma clang fp contract(fast)
}
}
void test_9(float *dest, float a, float b) {
/* expected-error@+1 {{unexpected argument 'on' to '#pragma clang fp exceptions'; expected 'ignore', 'maytrap' or 'strict'}} */
#pragma clang fp exceptions(on)
*dest = a + b;
}
void test_10(float *dest, float a, float b) {
#pragma clang fp exceptions(maytrap) contract(fast) reassociate(on)
*dest = a + b;
}