1 | // RUN: %clangxx_msan -O0 %s -o %t && %run %t |
---|---|
2 | |
3 | // REQUIRES: !android |
4 | |
5 | #include <assert.h> |
6 | #include <strings.h> |
7 | #include <sanitizer/msan_interface.h> |
8 | |
9 | int main(int argc, char *argv[]) { |
10 | char buf[100]; |
11 | assert(0 == __msan_test_shadow(buf, sizeof(buf))); |
12 | // *& to suppress bzero-to-memset optimization. |
13 | (*&bzero)(s: buf, n: 50); |
14 | assert(50 == __msan_test_shadow(buf, sizeof(buf))); |
15 | return 0; |
16 | } |
17 |