diff options
Diffstat (limited to 'compiler-rt/test/sanitizer_common/TestCases/NetBSD/strmode.cc')
-rw-r--r-- | compiler-rt/test/sanitizer_common/TestCases/NetBSD/strmode.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler-rt/test/sanitizer_common/TestCases/NetBSD/strmode.cc b/compiler-rt/test/sanitizer_common/TestCases/NetBSD/strmode.cc new file mode 100644 index 00000000000..b8d7d8ccf5a --- /dev/null +++ b/compiler-rt/test/sanitizer_common/TestCases/NetBSD/strmode.cc @@ -0,0 +1,20 @@ +// RUN: %clangxx -O0 -g %s -o %t && %run %t + +#include <stdio.h> +#include <stdlib.h> +#include <sys/stat.h> +#include <unistd.h> + +int main(void) { + struct stat st; + char modep[15]; + + if (stat("/etc/hosts", &st)) + exit(1); + + strmode(st.st_mode, modep); + + printf("%s\n", modep); + + return 0; +} |