Files
RedBear-OS/local/recipes/dev/libclc/source/clang/test/CodeGen/char-literal.c
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

81 lines
1.9 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-C %s
// RUN: %clang_cc1 -x c++ -std=c++11 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck -check-prefix=CHECK-CPP0X %s
#include <stddef.h>
int main(void) {
// CHECK-C: store i8 97
// CHECK-CPP0X: store i8 97
char a = 'a';
// Should truncate value (equal to last character).
// CHECK-C: store i8 98
// CHECK-CPP0X: store i8 98
char b = 'ab';
// Should get concatenated characters
// CHECK-C: store i32 24930
// CHECK-CPP0X: store i32 24930
int b1 = 'ab';
// Should get concatenated characters
// CHECK-C: store i32 808464432
// CHECK-CPP0X: store i32 808464432
int b2 = '0000';
// Should get truncated value (last four characters concatenated)
// CHECK-C: store i32 1919512167
// CHECK-CPP0X: store i32 1919512167
int b3 = 'somesillylongstring';
// CHECK-C: store i32 97
// CHECK-CPP0X: store i32 97
wchar_t wa = L'a';
#if __cplusplus >= 201103L
// CHECK-CPP0X: store i16 97
char16_t ua = u'a';
// CHECK-CPP0X: store i32 97
char32_t Ua = U'a';
// CHECK-CPP0X: store i16 1047
char16_t ua1 = u'З';
// CHECK-CPP0X: store i16 12538
char16_t ua2 = u'';
// CHECK-CPP0X: store i16 -27177
char16_t ua3 = u'';
// CHECK-CPP0X: store i32 181
char32_t Ua1 = U'µ';
// CHECK-CPP0X: store i32 38359
char32_t Ua2 = U'';
// CHECK-CPP0X: store i32 128128
char32_t Ua3 = U'💀';
#endif
// CHECK-C: store i32 61451
// CHECK-CPP0X: store i32 61451
wchar_t wc = L'\uF00B';
#if __cplusplus >= 201103L
// -4085 == 0xf00b
// CHECK-CPP0X: store i16 -4085
char16_t uc = u'\uF00B';
// CHECK-CPP0X: store i32 61451
char32_t Uc = U'\uF00B';
#endif
// CHECK-C: store i32 1110027
// CHECK-CPP0X: store i32 1110027
wchar_t wd = L'\U0010F00B';
#if __cplusplus >= 201103L
// CHECK-CPP0X: store i32 1110027
char32_t Ud = U'\U0010F00B';
#endif
}