1 // RUN: %clangxx_msan -m64 -O0 %s -o %t && %run %t
3 // Check that strlen() and similar intercepted functions can be called on shadow
11 const char *mem_to_shadow(const char *p
) {
12 return (char *)((uintptr_t)p
& ~0x400000000000ULL
);
16 const char *s
= "abcdef";
17 assert(strlen(s
) == 6);
18 assert(strlen(mem_to_shadow(s
)) == 0);
20 char *t
= new char[42];
22 assert(strlen(mem_to_shadow(t
)) == 41);