1 // Uses various wchar_t * functions that have hand written SSE and/or AVX2
2 // assembly implementations in glibc.
3 // wcslen, wcscpy, wcscmp, wcsncmp, wcsrchr, wcschr.
9 int main(int argc
, char **argv
)
11 wchar_t a
[] = L
"The spazzy orange tiger jumped over the tawny jaguar.";
15 size_t l
= wcslen (a
);
16 fprintf (stderr
, "wcslen: %zd\n", l
); // wcslen: 53
18 b
= (wchar_t *) malloc((l
+ 1) * sizeof (wchar_t));
21 fprintf (stderr
, "wcscmp equal: %d\n", wcscmp (a
, b
)); // wcscmp equal: 0
23 "wcsncmp equal: %d\n", wcsncmp (a
, b
, l
)); // wcsncmp equal: 0
25 d
= wcsrchr (a
, L
'd');
28 fprintf (stderr
, "wcsrchr == wcschr: %d\n", d
== e
); // wcsrchr == wcschr: 1