diff options
Diffstat (limited to 'compiler-rt/test/msan/ctermid.cpp')
-rw-r--r-- | compiler-rt/test/msan/ctermid.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler-rt/test/msan/ctermid.cpp b/compiler-rt/test/msan/ctermid.cpp new file mode 100644 index 00000000000..a2818e63068 --- /dev/null +++ b/compiler-rt/test/msan/ctermid.cpp @@ -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; +} |