bolt/deps/llvm-18.1.8/compiler-rt/test/sanitizer_common/TestCases/Posix/wcsdup.c

16 lines
306 B
C
Raw Normal View History

2025-02-14 19:21:04 +01:00
// RUN: %clang %s -o %t && %run %t 2>&1
#include <assert.h>
#include <stdlib.h>
#include <wchar.h>
int main(int argc, char **argv) {
wchar_t *buff = wcsdup(L"foo");
assert(buff[0] == L'f');
assert(buff[1] == L'o');
assert(buff[2] == L'o');
assert(buff[3] == L'\0');
free(buff);
return 0;
}