diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-05-08 12:04:01 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-05-08 12:04:01 +0000 |
commit | 578f6f9d4e04be4ffe4eb11b5948200470ab328b (patch) | |
tree | 656dc0a1c1f6b6bf55f70730060d3b8477270e1d /test | |
parent | 3c044f022a114a350d23e1f1f54e1da53c3223e1 (diff) |
[msan] Intercept strxfrm.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@208303 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/msan/strxfrm.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/msan/strxfrm.cc b/test/msan/strxfrm.cc new file mode 100644 index 000000000..b930a6af6 --- /dev/null +++ b/test/msan/strxfrm.cc @@ -0,0 +1,15 @@ +// RUN: %clangxx_msan -m64 -O0 -g %s -o %t && %run %t + +#include <assert.h> +#include <sanitizer/msan_interface.h> +#include <stdlib.h> +#include <string.h> + +int main(void) { + const char *p = "abcdef"; + char q[10]; + size_t n = strxfrm(q, p, sizeof(q)); + assert(n < sizeof(q)); + __msan_check_mem_is_initialized(q, n + 1); + return 0; +} |