summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/msan/ioctl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test/msan/ioctl.cpp')
-rw-r--r--compiler-rt/test/msan/ioctl.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler-rt/test/msan/ioctl.cpp b/compiler-rt/test/msan/ioctl.cpp
new file mode 100644
index 00000000000..66ac6e95b66
--- /dev/null
+++ b/compiler-rt/test/msan/ioctl.cpp
@@ -0,0 +1,20 @@
+// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
+// RUN: %clangxx_msan -O3 -g %s -o %t && %run %t
+
+#include <assert.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+int main(int argc, char **argv) {
+ int fd = socket(AF_UNIX, SOCK_DGRAM, 0);
+
+ unsigned int z;
+ int res = ioctl(fd, FIOGETOWN, &z);
+ assert(res == 0);
+ close(fd);
+ if (z)
+ exit(0);
+ return 0;
+}
OpenPOWER on IntegriCloud