diff options
Diffstat (limited to 'compiler-rt/test/msan/Linux/bzero.cpp')
| -rw-r--r-- | compiler-rt/test/msan/Linux/bzero.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler-rt/test/msan/Linux/bzero.cpp b/compiler-rt/test/msan/Linux/bzero.cpp new file mode 100644 index 00000000000..cb319a6cfa1 --- /dev/null +++ b/compiler-rt/test/msan/Linux/bzero.cpp @@ -0,0 +1,16 @@ +// RUN: %clangxx_msan -O0 %s -o %t && %run %t + +// REQUIRES: !android + +#include <assert.h> +#include <strings.h> +#include <sanitizer/msan_interface.h> + +int main(int argc, char *argv[]) { + char buf[100]; + assert(0 == __msan_test_shadow(buf, sizeof(buf))); + // *& to suppress bzero-to-memset optimization. + (*&bzero)(buf, 50); + assert(50 == __msan_test_shadow(buf, sizeof(buf))); + return 0; +} |

