1 // RUN: %clangxx_msan -O0 -g %s -o %t && not %run %t
5 #include <sanitizer/msan_interface.h>
11 size_t n
= wcsxfrm(q
, L
"abcdef", sizeof(q
) / sizeof(wchar_t));
12 assert(n
< sizeof(q
));
13 __msan_check_mem_is_initialized(q
, (n
+ 1) * sizeof(wchar_t));
15 locale_t loc
= newlocale(LC_ALL_MASK
, "", (locale_t
)0);
17 __msan_poison(&q
, sizeof(q
));
18 n
= wcsxfrm_l(q
, L
"qwerty", sizeof(q
) / sizeof(wchar_t), loc
);
19 assert(n
< sizeof(q
));
20 __msan_check_mem_is_initialized(q
, (n
+ 1) * sizeof(wchar_t));
24 __msan_poison(&q
, sizeof(q
));
27 // CHECK: WARNING: MemorySanitizer: use-of-uninitialized-value
28 // CHECK: in main {{.*}}wcsxfrm.cpp:25