Files
clang-p2996/compiler-rt/test/msan/Linux/bzero.cpp
Fangrui Song d21b3d346a compiler-rt: Rename .cc file in test/msan to .cpp
Like r367463, but for test/msan.

llvm-svn: 367653
2019-08-02 06:07:05 +00:00

17 lines
395 B
C++

// 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;
}