summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/msan/fstat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test/msan/fstat.cpp')
-rw-r--r--compiler-rt/test/msan/fstat.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/compiler-rt/test/msan/fstat.cpp b/compiler-rt/test/msan/fstat.cpp
new file mode 100644
index 00000000000..83f97054cea
--- /dev/null
+++ b/compiler-rt/test/msan/fstat.cpp
@@ -0,0 +1,15 @@
+// RUN: %clangxx_msan -O0 %s -o %t && %run %t
+
+#include <sys/stat.h>
+#include <stdlib.h>
+
+int main(void) {
+ struct stat st;
+ if (fstat(0, &st))
+ exit(1);
+
+ if (S_ISBLK(st.st_mode))
+ exit(0);
+
+ return 0;
+}
OpenPOWER on IntegriCloud