scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 7a251b3e45be287e356b111341b3a76c010e28d5
parent c596a224283e7ca8ce64ca5a880b37c576477d4a
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date:   Fri, 10 Apr 2026 23:24:01 +0200

tests/cc: Add wide char string tests

Diffstat:
Atests/cc/execute/0264-wchar.c | 25+++++++++++++++++++++++++
Atests/cc/execute/0265-wchar.c | 8++++++++
Mtests/cc/execute/scc-tests.lst | 2++
3 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/tests/cc/execute/0264-wchar.c b/tests/cc/execute/0264-wchar.c @@ -0,0 +1,25 @@ +#include <wchar.h> + +#define W(L) L"Hello " L + +int +test(wchar_t *ws) +{ + int i; + static wchar_t str[] = L"Hello World!!!!!"; + + for (i = 0; ws[i] != L'\0'; ++i) { + if (ws[i] != str[i]) + return 1; + } + + return 0; +} + +int +main(void) +{ + wchar_t *ws = W(L"World!"); + + return test(ws); +} diff --git a/tests/cc/execute/0265-wchar.c b/tests/cc/execute/0265-wchar.c @@ -0,0 +1,8 @@ + +int v[1 + (L'\u0040' == 64)]; + +int +main(void) +{ + return !(sizeof(v) == sizeof(int [2])); +} diff --git a/tests/cc/execute/scc-tests.lst b/tests/cc/execute/scc-tests.lst @@ -254,3 +254,5 @@ 0261-macro.c 0262-macro.c 0263-macro.c +0264-wchar.c +0265-wchar.c