aboutsummaryrefslogtreecommitdiff
path: root/test/msan/Linux/forkpty.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/msan/Linux/forkpty.cc')
-rw-r--r--test/msan/Linux/forkpty.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/msan/Linux/forkpty.cc b/test/msan/Linux/forkpty.cc
new file mode 100644
index 000000000000..ae5c7d96ca8a
--- /dev/null
+++ b/test/msan/Linux/forkpty.cc
@@ -0,0 +1,18 @@
+// RUN: %clangxx_msan -O0 -g %s -lutil -o %t && %run %t
+#include <assert.h>
+#include <pty.h>
+
+#include <sanitizer/msan_interface.h>
+
+int
+main (int argc, char** argv)
+{
+ int master, slave;
+ openpty(&master, &slave, NULL, NULL, NULL);
+ assert(__msan_test_shadow(&master, sizeof(master)) == -1);
+ assert(__msan_test_shadow(&slave, sizeof(slave)) == -1);
+
+ int master2;
+ forkpty(&master2, NULL, NULL, NULL);
+ assert(__msan_test_shadow(&master2, sizeof(master2)) == -1);
+}