1 | // RUN: %clangxx_msan -std=c++11 -O0 -g %s -o %t && %run %t |
---|---|
2 | // REQUIRES: x86_64-linux |
3 | |
4 | #include <assert.h> |
5 | #include <locale.h> |
6 | #include <sanitizer/msan_interface.h> |
7 | #include <stdlib.h> |
8 | #include <string.h> |
9 | |
10 | extern "C"decltype(strxfrm_l) __strxfrm_l; |
11 | |
12 | int main(void) { |
13 | char q[100]; |
14 | locale_t loc = newlocale(LC_ALL_MASK, locale: "", base: (locale_t)0); |
15 | size_t n = __strxfrm_l(q, "qwerty", sizeof(q), loc); |
16 | assert(n < sizeof(q)); |
17 | __msan_check_mem_is_initialized(x: q, size: n + 1); |
18 | return 0; |
19 | } |
20 |