Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / msan / __strxfrm_l.cpp
blob9766d33056857721a61efaa3f7a92499018fe86e
1 // RUN: %clangxx_msan -std=c++11 -O0 -g %s -o %t && %run %t
2 // REQUIRES: x86_64-linux
4 #include <assert.h>
5 #include <locale.h>
6 #include <sanitizer/msan_interface.h>
7 #include <stdlib.h>
8 #include <string.h>
10 extern "C" decltype(strxfrm_l) __strxfrm_l;
12 int main(void) {
13 char q[100];
14 locale_t loc = newlocale(LC_ALL_MASK, "", (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(q, n + 1);
18 return 0;