brintos

brintos / llvm-project-archived public Read only

0
0
Text · 480 B · 9766d33 Raw
20 lines · cpp
1// RUN: %clangxx_msan -std=c++11 -O0 -g %s -o %t && %run %t2// REQUIRES: x86_64-linux3 4#include <assert.h>5#include <locale.h>6#include <sanitizer/msan_interface.h>7#include <stdlib.h>8#include <string.h>9 10extern "C" decltype(strxfrm_l) __strxfrm_l;11 12int 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;19}20