diff options
Diffstat (limited to 'test/msan/ctermid.cc')
-rw-r--r-- | test/msan/ctermid.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/msan/ctermid.cc b/test/msan/ctermid.cc new file mode 100644 index 0000000000000..a2818e6306864 --- /dev/null +++ b/test/msan/ctermid.cc @@ -0,0 +1,13 @@ +// RUN: %clangxx_msan -std=c++11 -O0 %s -o %t && %run %t + +#include <sanitizer/msan_interface.h> +#include <stdio.h> +#include <string.h> + +int main(void) { + unsigned char s[L_ctermid + 1]; + char *res = ctermid((char *)s); + if (res) + printf("%zd\n", strlen(res)); + return 0; +} |