2015-03-03 03:34:27 +08:00
|
|
|
// RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t
|
2014-05-01 05:34:17 +08:00
|
|
|
// RUN: %run %t
|
2015-03-03 03:34:27 +08:00
|
|
|
// RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t
|
2014-05-01 05:34:17 +08:00
|
|
|
// RUN: %run %t
|
2014-03-21 18:12:17 +08:00
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sanitizer/msan_interface.h>
|
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
char s[20] = "string";
|
|
|
|
__msan_poison(s, sizeof(s));
|
|
|
|
__msan_unpoison_string(s);
|
|
|
|
assert(__msan_test_shadow(s, sizeof(s)) == strlen("string") + 1);
|
|
|
|
return 0;
|
|
|
|
}
|