[msan] Intercept strxfrm.
[blocksruntime.git] / test / msan / strxfrm.cc
blobb930a6af69c4d5b9b2ff7d845e7ba589309364f6
1 // RUN: %clangxx_msan -m64 -O0 -g %s -o %t && %run %t
3 #include <assert.h>
4 #include <sanitizer/msan_interface.h>
5 #include <stdlib.h>
6 #include <string.h>
8 int main(void) {
9 const char *p = "abcdef";
10 char q[10];
11 size_t n = strxfrm(q, p, sizeof(q));
12 assert(n < sizeof(q));
13 __msan_check_mem_is_initialized(q, n + 1);
14 return 0;